本文整理汇总了Java中org.sbml.jsbml.Model.getSpeciesCount方法的典型用法代码示例。如果您正苦于以下问题:Java Model.getSpeciesCount方法的具体用法?Java Model.getSpeciesCount怎么用?Java Model.getSpeciesCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.sbml.jsbml.Model
的用法示例。
在下文中一共展示了Model.getSpeciesCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseSpeciesSBOL
import org.sbml.jsbml.Model; //导入方法依赖的package包/类
private void parseSpeciesSBOL(Model sbmlModel, HashMap<String, AssemblyNode2> idToNode) {
for (int i = 0; i < sbmlModel.getSpeciesCount(); i++) {
Species sbmlSpecies = sbmlModel.getListOfSpecies().get(i);
AssemblyNode2 speciesNode = constructNode(sbmlSpecies, sbmlSpecies.getId());
if (speciesNode.getURIs().size() > 0)
containsSBOL = true;
idToNode.put(sbmlSpecies.getId(), speciesNode);
if (sbmlSpecies.getExtensionPackages().containsKey(CompConstants.namespaceURI))
parsePortMappings(sbmlSpecies, speciesNode, idToNode);
}
}
示例2: 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);
}