org.sbml.jsbml.util
public class SubModel extends java.lang.Object
Model
containing the elements passed as argument and all
the necessary dependencies.
You do not need to fill all of the parameter arrays. Here is how the sub-Model
generation works:
Compartment
ids, all the species inside these Compartment
are included.
Species
ids (and all added Species
from the Compartment
s), all the Reaction
s where one of these Species
is present are included
Species
involved in the Reaction
s given as parameter or added automatically from the given Species
are included.
Compartment
s where one of the included species is present is included.
UnitDefinition
s, SpeciesType
s and CompartmentType
s are included.
Rule
s and events passed as parameter along the one needed are included.
Parameter
s are added automatically at the moment, without checking if there are used or not.
FunctionDefinition
s used in the included MathML are added automatically.
Constructor and Description |
---|
SubModel() |
Modifier and Type | Method and Description |
---|---|
private static boolean |
contains(ListOf<? extends SimpleSpeciesReference> speciesReferences,
Species species) |
static SBMLDocument |
generateSubModel(Model model,
java.lang.String[] compartmentsIds,
java.lang.String[] speciesIds,
java.lang.String[] reactsIds)
Generates a sub-model containing the elements passed as argument and all
the necessary dependencies.
|
static SBMLDocument |
generateSubModel(Model model,
java.lang.String[] compartmentsIds,
java.lang.String[] speciesIds,
java.lang.String[] reactsIds,
java.lang.String[] rulesIds,
java.lang.String[] eventsIds)
Generates a sub-model containing the elements passed as argument and all
the necessary dependencies.
|
private static SBMLDocument |
generateSubModel(Model model,
java.lang.String[] compartmentsIds,
java.lang.String[] speciesIds,
java.lang.String[] reactsIds,
java.lang.String[] rulesIds,
java.lang.String[] eventsIds,
boolean inclComp,
boolean inclSpecies,
boolean inclReact,
boolean inclRules,
boolean inclEvents)
Creates a sub-model with the option to ignore certain items.
|
static java.lang.String[] |
getRelatedCompartments(Model model,
java.lang.String[] compartmentsIds,
java.lang.String[] speciesIds) |
private static java.lang.String[] |
getRelatedEvents(Model model,
java.lang.String[] eventsIds,
java.lang.String[] compartmentsIds,
java.lang.String[] speciesIds) |
private static void |
getRelatedFunctions(java.util.Set<java.lang.String> relatedFunctionsSet,
java.util.Set<java.lang.String> allFunctionsIdSet,
ASTNode mathNode) |
private static void |
getRelatedFunctionsId(java.util.Set<java.lang.String> relatedFunctionsSet,
java.util.Set<java.lang.String> allFunctionsIdSet,
ASTNode mathNode) |
static java.lang.String[] |
getRelatedReactions(Model model,
java.lang.String[] reactsIds,
java.lang.String[] speciesIds)
Returns an array of reaction id related to the
reactsIds or speciesIds . |
private static java.lang.String[] |
getRelatedRules(Model model,
java.lang.String[] rulesIds,
java.lang.String[] compartmentsIds,
java.lang.String[] speciesIds) |
static java.lang.String[] |
getRelatedSpecies(Model model,
java.lang.String[] reactsIds,
java.lang.String[] compartmentsIds,
java.lang.String[] speciesIds) |
private static void |
processUnitsMap(java.util.Map<java.lang.String,UnitDefinition> unitsMap,
Model model,
KineticLaw kineticLaw) |
private static void |
processUnitsMap(java.util.Map<java.lang.String,UnitDefinition> unitsMap,
Model model,
java.lang.String elementUnits) |
public static SBMLDocument generateSubModel(Model model, java.lang.String[] compartmentsIds, java.lang.String[] speciesIds, java.lang.String[] reactsIds)
model
- compartmentsIds
- speciesIds
- reactsIds
- public static SBMLDocument generateSubModel(Model model, java.lang.String[] compartmentsIds, java.lang.String[] speciesIds, java.lang.String[] reactsIds, java.lang.String[] rulesIds, java.lang.String[] eventsIds)
You do not need to fill all of the parameter arrays. Here is how the sub-Model
generation works:
Compartment
ids, all the species inside these Compartment
are included.
Species
ids (and all added Species
from the Compartment
s), all the Reaction
s where one of these Species
is present are included
Species
involved in the Reaction
s given as parameter or added automatically from the given Species
are included.
Compartment
s where one of the included species is present is included.
UnitDefinition
s, SpeciesType
s and CompartmentType
s are included.
Rule
s and events passed as parameter along the one needed are included.
Parameter
s are added automatically at the moment, without checking if there are used or not.
FunctionDefinition
s used in the included MathML are added automatically.
model
- the SBML model where we want to extract a sub-model.compartmentsIds
- the list of compartment to keepspeciesIds
- the list of species to keepreactsIds
- the list of reactions to keeprulesIds
- the list of rules to keepeventsIds
- the list of events to keepprivate static SBMLDocument generateSubModel(Model model, java.lang.String[] compartmentsIds, java.lang.String[] speciesIds, java.lang.String[] reactsIds, java.lang.String[] rulesIds, java.lang.String[] eventsIds, boolean inclComp, boolean inclSpecies, boolean inclReact, boolean inclRules, boolean inclEvents)
model
- compartmentsIds
- speciesIds
- reactsIds
- rulesIds
- eventsIds
- inclComp
- inclSpecies
- inclReact
- inclRules
- inclEvents
- private static void processUnitsMap(java.util.Map<java.lang.String,UnitDefinition> unitsMap, Model model, java.lang.String elementUnits)
unitsMap
- model
- the original model from which a sub-model is to be created.elementUnits
- private static void processUnitsMap(java.util.Map<java.lang.String,UnitDefinition> unitsMap, Model model, KineticLaw kineticLaw)
unitsMap
- model
- the original model from which a sub-model is to be created.kineticLaw
- private static boolean contains(ListOf<? extends SimpleSpeciesReference> speciesReferences, Species species)
speciesReferences
- species
- public static java.lang.String[] getRelatedCompartments(Model model, java.lang.String[] compartmentsIds, java.lang.String[] speciesIds)
model
- the original model from which a sub-model is to be created.compartmentsIds
- speciesIds
- public static java.lang.String[] getRelatedSpecies(Model model, java.lang.String[] reactsIds, java.lang.String[] compartmentsIds, java.lang.String[] speciesIds)
model
- the original model from which a sub-model is to be created.reactsIds
- compartmentsIds
- speciesIds
- private static java.lang.String[] getRelatedRules(Model model, java.lang.String[] rulesIds, java.lang.String[] compartmentsIds, java.lang.String[] speciesIds)
model
- the original model from which a sub-model is to be created.rulesIds
- compartmentsIds
- speciesIds
- private static java.lang.String[] getRelatedEvents(Model model, java.lang.String[] eventsIds, java.lang.String[] compartmentsIds, java.lang.String[] speciesIds)
model
- the original model from which a sub-model is to be created.eventsIds
- compartmentsIds
- speciesIds
- public static java.lang.String[] getRelatedReactions(Model model, java.lang.String[] reactsIds, java.lang.String[] speciesIds)
reactsIds
or speciesIds
.
All the reactions in reactsIds
should be part of the result if
the function is called properly with valid reacionId.
Reaction
s, where the Species
in the speciesIds
array are involved as reactant,
product or modifier, are added in the returned reaction id array.model
- the original model from which a sub-model is to be created.reactsIds
- the list of Reaction
s selected by the user to create a sub-modelspeciesIds
- the list of Species
selected by the user to create a sub-modelReaction
s id or null
if no related reactions are found.private static void getRelatedFunctionsId(java.util.Set<java.lang.String> relatedFunctionsSet, java.util.Set<java.lang.String> allFunctionsIdSet, ASTNode mathNode)
relatedFunctionsSet
- allFunctionsIdSet
- mathNode
- private static void getRelatedFunctions(java.util.Set<java.lang.String> relatedFunctionsSet, java.util.Set<java.lang.String> allFunctionsIdSet, ASTNode mathNode)
relatedFunctionsSet
- allFunctionsIdSet
- mathNode
-