本文整理汇总了Java中org.sbml.jsbml.Model.getReactionCount方法的典型用法代码示例。如果您正苦于以下问题:Java Model.getReactionCount方法的具体用法?Java Model.getReactionCount怎么用?Java Model.getReactionCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.sbml.jsbml.Model
的用法示例。
在下文中一共展示了Model.getReactionCount方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: constructGraph
import org.sbml.jsbml.Model; //导入方法依赖的package包/类
private Set<SynthesisNode> constructGraph(Model sbmlModel, SBOLFileManager fileManager) throws SBOLException {
HashMap<String, SynthesisNode> idToNode = new HashMap<String, SynthesisNode>();
edges = new HashMap<SynthesisNode, List<SynthesisNode>>();
nucleotideCount = 0;
compURIs = new HashSet<URI>();
signals = new HashSet<String>();
for (int i = 0; i < sbmlModel.getReactionCount(); i++)
{
Reaction sbmlReaction = sbmlModel.getReaction(i);
if (sbmlReaction.getProductCount() > 0)
if (BioModel.isProductionReaction(sbmlReaction))
{
constructTranscriptionMotif(sbmlReaction, idToNode, sbmlModel, fileManager);
}
else if ((BioModel.isComplexReaction(sbmlReaction)))
{
constructComplexationMotif(sbmlReaction, idToNode, sbmlModel, fileManager);
}
}
//TODO: why return the value of idToNode and ignore the key?
//NOTE: create a table of all the values in idToNode which contains transcription and complex formation reaction
return new HashSet<SynthesisNode>(idToNode.values());
}
示例2: getDegradationReaction
import org.sbml.jsbml.Model; //导入方法依赖的package包/类
public static Reaction getDegradationReaction(String speciesId, Model sbmlModel) {
String componentId = "";
String shortSpeciesId = speciesId;
if (speciesId.contains("__")) {
componentId = speciesId.substring(0,speciesId.lastIndexOf("__")+2);
shortSpeciesId = speciesId.substring(speciesId.lastIndexOf("__")+2);
}
Reaction degradation = sbmlModel.getReaction(componentId + GlobalConstants.DEGRADATION + "_" + shortSpeciesId);
if (degradation == null) {
for (int i = 0; i < sbmlModel.getReactionCount(); i++) {
Reaction r = sbmlModel.getReaction(i);
if (BioModel.isDegradationReaction(r) && r.hasReactant(new Species(speciesId)))
return r;
}
} else if (BioModel.isDegradationReaction(degradation))
return degradation;
return null;
}
示例3: getProductionReaction
import org.sbml.jsbml.Model; //导入方法依赖的package包/类
public static Reaction getProductionReaction(String promoterId, Model sbmlModel) {
String componentId = "";
String shortPromoterId = promoterId;
if (promoterId.contains("__")) {
componentId = promoterId.substring(0, promoterId.lastIndexOf("__") + 2);
shortPromoterId = promoterId.substring(promoterId.lastIndexOf("__") + 2);
}
Reaction production = sbmlModel.getReaction(componentId + GlobalConstants.PRODUCTION + "_" + shortPromoterId);
if (production == null)
for (int i = 0; i < sbmlModel.getReactionCount(); i++) {
Reaction r = sbmlModel.getReaction(i);
if (BioModel.isProductionReaction(r) && r.hasModifier(new Species(promoterId)))
return r;
}
else if (BioModel.isProductionReaction(production))
return production;
return null;
}
示例4: getComplexReaction
import org.sbml.jsbml.Model; //导入方法依赖的package包/类
public static Reaction getComplexReaction(String speciesId, Model sbmlModel) {
String componentId = "";
String shortSpeciesId = speciesId;
if (speciesId.contains("__")) {
componentId = speciesId.substring(0,speciesId.lastIndexOf("__")+2);
shortSpeciesId = speciesId.substring(speciesId.lastIndexOf("__")+2);
}
Reaction complexation = sbmlModel.getReaction(componentId + GlobalConstants.COMPLEXATION
+ "_" + shortSpeciesId);
if (complexation == null) {
for (int i = 0; i < sbmlModel.getReactionCount(); i++) {
Reaction r = sbmlModel.getReaction(i);
if (BioModel.isComplexReaction(r) && r.hasProduct(new Species(speciesId)))
return r;
}
} else if (BioModel.isComplexReaction(complexation))
return complexation;
return null;
}
示例5: parseSBMLModel
import org.sbml.jsbml.Model; //导入方法依赖的package包/类
/**
* Convert the specified SBML model to its equivalent SBOL ModuleDefinition.
* All SBML SBase referencing this SBML model will be converted to SBOL data object.
* In this case, all SBML species will be converted to SBOL ComponentDefinition and FunctionalComponent.
* All SBML reactions will be converted to SBOL Interactions.
* All SBML replacements will be converted to SBOL MapsTo.
*
* @param source - reference to the source file for the given SBML model
* @param externalSBMLPath - The full path of external SBML files to be referenced in the SBML2SBOL conversion
* @param sbmlDoc - The SBML Document to be converted to SBOL
* @param model - The SBML model to be converted to SBOL ModuleDefinition
* @param sbolDoc - The SBOL document to store all SBOL objects converted from the SBML Document
* @param sbol_Library - The global SBOL document that contains all SBOL objects referenced in conversion.
* @throws SBOLValidationException - SBOL Exception occurred when loading referenced SBOL files
* @throws XMLStreamException - Invalid XML file.
* @throws IOException - Input Exception occurred.
*/
private static void parseSBMLModel(String source, String externalSBMLPath, SBMLDocument sbmlDoc, Model model, SBOLDocument sbolDoc, SBOLDocument sbol_Library) throws SBOLValidationException, XMLStreamException, IOException
{
//String modelId = model.getId();
URI sourceURI = URI.create(source);
URI LANGUAGE = EDAMOntology.SBML;
URI FRAMEWORK = SystemsBiologyOntology.DISCRETE_FRAMEWORK;
org.sbolstandard.core2.Model sbolModel = sbolDoc.getModel(model.getId() + "_model", VERSION);
if (sbolModel!=null) {
sbolDoc.removeModel(sbolModel);
}
sbolModel = sbolDoc.createModel(model.getId() + "_model", VERSION, sourceURI, LANGUAGE, FRAMEWORK);
String identityStr = model.getId() + "_md";
ModuleDefinition moduleDef = sbolDoc.getModuleDefinition(identityStr, VERSION);
if (moduleDef!=null) {
sbolDoc.removeModuleDefinition(moduleDef);
}
moduleDef = sbolDoc.createModuleDefinition(identityStr, VERSION);
moduleDef.addModel(sbolModel);
for (int i = 0; i < model.getSpeciesCount(); i++)
{
Species species = model.getSpecies(i);
ComponentDefinition compDef = setComponentDefinition(sbol_Library, sbolDoc, model, species);
setFunctionalComponent(sbmlDoc, model, moduleDef, compDef, species);
}
for (int i = 0; i < model.getReactionCount(); i++)
{
Reaction reaction = model.getReaction(i);
if(BioModel.isProductionReaction(reaction))
{
// if production reaction, then you want to examine the modifiers, and create interactions for
// each modifier that is a repressor from this species to the promoter
parseProductionReaction(moduleDef, reaction);
}
else if(BioModel.isComplexReaction(reaction))
{
// if complex reaction, then create on interaction
parseComplexReaction(moduleDef, reaction);
}
else if(BioModel.isDegradationReaction(reaction))
{
// if degradation reaction, then create an interaction
parseDegradationReaction(moduleDef, reaction);
}
else
{
parseBiochemicalReaction(moduleDef, reaction);
}
}
extractSubModels(source, externalSBMLPath, sbmlDoc, sbol_Library, sbolDoc, moduleDef, model);
}