本文整理汇总了Java中org.sbml.jsbml.ModifierSpeciesReference类的典型用法代码示例。如果您正苦于以下问题:Java ModifierSpeciesReference类的具体用法?Java ModifierSpeciesReference怎么用?Java ModifierSpeciesReference使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModifierSpeciesReference类属于org.sbml.jsbml包,在下文中一共展示了ModifierSpeciesReference类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isPromoter
import org.sbml.jsbml.ModifierSpeciesReference; //导入依赖的package包/类
public static boolean isPromoter(ModifierSpeciesReference mod) {
if (AnnotationUtility.checkObsoleteAnnotation(mod,"promoter")) {
mod.setSBOTerm(GlobalConstants.SBO_PROMOTER_MODIFIER);
AnnotationUtility.removeObsoleteAnnotation(mod);
return true;
} else if (mod.isSetSBOTerm()) {
if (mod.getSBOTerm() == GlobalConstants.SBO_PROMOTER) {
mod.setSBOTerm(GlobalConstants.SBO_PROMOTER_MODIFIER);
return true;
} else if (mod.getSBOTerm() == GlobalConstants.SBO_PROMOTER_MODIFIER) {
return true;
}
} else if (isPromoterSpecies(mod.getSpeciesInstance())) {
mod.setSBOTerm(GlobalConstants.SBO_PROMOTER_MODIFIER);
return true;
}
return false;
}
示例2: isRegulator
import org.sbml.jsbml.ModifierSpeciesReference; //导入依赖的package包/类
public static boolean isRegulator(ModifierSpeciesReference modifier) {
if (modifier!=null) {
if (modifier.isSetSBOTerm()) {
if (modifier.getSBOTerm()==GlobalConstants.SBO_REGULATION) {
modifier.setSBOTerm(GlobalConstants.SBO_DUAL_ACTIVITY);
return true;
} else if (modifier.getSBOTerm()==GlobalConstants.SBO_DUAL_ACTIVITY) {
return true;
}
}
if (AnnotationUtility.checkObsoleteAnnotation(modifier,GlobalConstants.REGULATION)) {
modifier.setSBOTerm(GlobalConstants.SBO_DUAL_ACTIVITY);
AnnotationUtility.removeObsoleteAnnotation(modifier);
return true;
} else if (AnnotationUtility.checkObsoleteAnnotation(modifier,"promoter")) {
AnnotationUtility.removeObsoleteAnnotation(modifier);
return false;
}
}
return false;
}
示例3: modifierSpeciesReferenceMatch
import org.sbml.jsbml.ModifierSpeciesReference; //导入依赖的package包/类
private static boolean modifierSpeciesReferenceMatch(ModifierSpeciesReference ref,String refStr) {
String[] split = refStr.split(" ");
String id = "";
String dim = "";
String species = "";
String index = "";
int offset = 0;
if (refStr.contains(":")) {
id = split[0].split("\\[")[0];
if (split[0].contains("["))
dim = split[0].substring(split[0].indexOf("["));
offset = 2;
}
species = split[offset].split("\\[")[0];
if (split[offset].contains("["))
index = split[offset].substring(split[offset].indexOf("["));
if (ref.isSetId() && !ref.getId().equals(id)) return false;
if (!ref.getSpecies().equals(species)) return false;
String refDim = SBMLutilities.getDimensionString(ref);
if (!refDim.equals(dim)) return false;
String refIndex = SBMLutilities.getIndicesString(ref, "species");
if (!refIndex.equals(index)) return false;
return true;
}
示例4: boolSpeciesInModifierSReference
import org.sbml.jsbml.ModifierSpeciesReference; //导入依赖的package包/类
/**
* Bool species in modifier S reference.
*
* @param los the los
* @param losr the losr
* @return the boolean[]
*/
private boolean[] boolSpeciesInModifierSReference(ListOf<Species> los, ListOf<ModifierSpeciesReference> losr){
boolean[] bool = new boolean[(int)los.size()];
for(int i = 0; i < los.size(); i++)
for(int j = 0; j < losr.size(); j++)
if(los.get(i).getId().equals(losr.get(j).getSpecies()))
bool[i] = true;
return bool;
}
示例5: completeModifierSpeciesReference
import org.sbml.jsbml.ModifierSpeciesReference; //导入依赖的package包/类
/**
* Complete modifier species reference.
*
* @param modifierSpeciesReference
* the modifier species reference
* @return ListOf<ModifierSpeciesReference>
* TODO
*/
public static ListOf<ModifierSpeciesReference> completeModifierSpeciesReference(
ListOf<ModifierSpeciesReference> modifierSpeciesReference) {
for (ModifierSpeciesReference sr : modifierSpeciesReference) {
if (!sr.isSetSpecies()){
Species s = model.getSpecies(sr.getId());
if(s == null) {
sr.setSpecies(model.getSpecies(0));
} else {
sr.setSpecies(s);
}
}
}
return modifierSpeciesReference;
}
示例6: addNoInfluenceToProductionReaction
import org.sbml.jsbml.ModifierSpeciesReference; //导入依赖的package包/类
public Reaction addNoInfluenceToProductionReaction(String promoterId,String regulatorId,String productId) {
Reaction r = getProductionReaction(promoterId);
ModifierSpeciesReference modifier = r.getModifierForSpecies(regulatorId);
if (!regulatorId.equals("none") && modifier==null) {
modifier = r.createModifier();
modifier.setSpecies(regulatorId);
modifier.setSBOTerm(GlobalConstants.SBO_NEUTRAL);
} else if (modifier != null) {
return r;
}
if (modifier!=null) {
SBMLutilities.copyDimensionsToEdgeIndex(r, sbml.getModel().getSpecies(regulatorId), modifier, "species");
}
if (!productId.equals("none") && r.getProductForSpecies(productId)==null) {
SpeciesReference product = r.createProduct();
product.setSpecies(productId);
SBMLutilities.copyDimensionsToEdgeIndex(r, sbml.getModel().getSpecies(productId), product, "species");
double np = sbml.getModel().getParameter(GlobalConstants.STOICHIOMETRY_STRING).getValue();
product.setStoichiometry(np);
product.setConstant(true);
if (r.getProductForSpecies(promoterId + "_mRNA")!=null) {
r.removeProduct(promoterId+"_mRNA");
}
if (sbml.getModel().getSpecies(promoterId + "_mRNA")!=null) {
sbml.getModel().removeSpecies(promoterId+"_mRNA");
}
}
r.getKineticLaw().setMath(SBMLutilities.myParseFormula(createProductionKineticLaw(r)));
return r;
}
示例7: isActivator
import org.sbml.jsbml.ModifierSpeciesReference; //导入依赖的package包/类
public static boolean isActivator(ModifierSpeciesReference modifier) {
if (modifier.isSetSBOTerm()) {
if (modifier.getSBOTerm()==GlobalConstants.SBO_ACTIVATION) return true;
}
if (AnnotationUtility.checkObsoleteAnnotation(modifier,GlobalConstants.ACTIVATION)) {
modifier.setSBOTerm(GlobalConstants.SBO_ACTIVATION);
AnnotationUtility.removeObsoleteAnnotation(modifier);
return true;
}
return false;
}
示例8: isRepressor
import org.sbml.jsbml.ModifierSpeciesReference; //导入依赖的package包/类
public static boolean isRepressor(ModifierSpeciesReference modifier) {
if (modifier.isSetSBOTerm()) {
if (modifier.getSBOTerm()==GlobalConstants.SBO_REPRESSION) return true;
}
if (AnnotationUtility.checkObsoleteAnnotation(modifier,GlobalConstants.REPRESSION)) {
modifier.setSBOTerm(GlobalConstants.SBO_REPRESSION);
AnnotationUtility.removeObsoleteAnnotation(modifier);
return true;
}
return false;
}
示例9: isNeutral
import org.sbml.jsbml.ModifierSpeciesReference; //导入依赖的package包/类
public static boolean isNeutral(ModifierSpeciesReference modifier) {
if (modifier.isSetSBOTerm()) {
if (modifier.getSBOTerm()==GlobalConstants.SBO_NEUTRAL) return true;
}
if (AnnotationUtility.checkObsoleteAnnotation(modifier,GlobalConstants.NOINFLUENCE)) {
modifier.setSBOTerm(GlobalConstants.SBO_NEUTRAL);
AnnotationUtility.removeObsoleteAnnotation(modifier);
return true;
}
return false;
}
示例10: getPromoterId
import org.sbml.jsbml.ModifierSpeciesReference; //导入依赖的package包/类
public static String getPromoterId(Reaction productionReaction)
{
for (int i = 0; i < productionReaction.getModifierCount(); i++)
{
ModifierSpeciesReference modifier = productionReaction.getModifier(i);
if (BioModel.isPromoter(modifier))
{
return modifier.getSpecies();
}
}
return null;
}
示例11: removeModifier
import org.sbml.jsbml.ModifierSpeciesReference; //导入依赖的package包/类
public static ModifierSpeciesReference removeModifier(Reaction r, String species)
{
if (r.getListOfModifiers() != null)
{
return r.removeModifier(species);
}
return null;
}
示例12: generateActivatorReference
import org.sbml.jsbml.ModifierSpeciesReference; //导入依赖的package包/类
/**
* Convert SBOL participation that takes on the role of activator into its equivalent SBML SpeciesReference.
*
* @param activator - The SBOL participation to be annotated as SBML SpeciesReference.
* @param promoter - The SBOL FunctionalComponent promoter of the activator.
* @param moduleDef - The SBOL ModuleDefinition that contain the SBOL Participation.
* @param productionRxn - The SBML reaction that will store the SpeciesReference created from the converted activator SBOL Participation.
* @param targetModel - The SBML model to store the SBML Reaction and SpeciesReference created from the conversion.
*/
private static void generateActivatorReference(Participation activator, FunctionalComponent promoter,
ModuleDefinition moduleDef, Reaction productionRxn, BioModel targetModel) {
FunctionalComponent tf = moduleDef.getFunctionalComponent(activator.getParticipantURI());
targetModel.addActivatorToProductionReaction(getDisplayID(promoter),
getDisplayID(tf), "none", productionRxn, null, null, null);
// Annotate SBML activator species reference with SBOL activator participation
ModifierSpeciesReference activatorRef = productionRxn.getModifierForSpecies(getDisplayID(tf));
SBMLutilities.setDefaultMetaID(targetModel.getSBMLDocument(), activatorRef, 1);
annotateSpeciesReference(activatorRef, activator);
}
示例13: generateRepressorReference
import org.sbml.jsbml.ModifierSpeciesReference; //导入依赖的package包/类
/**
* Convert SBOL participation that takes on the role of repressor into its equivalent SBML SpeciesReference.
*
* @param repressor - The SBOL participation to be annotated as SBML SpeciesReference.
* @param promoter - The SBOL FunctionalComponent promoter of the repressor.
* @param moduleDef - The SBOL ModuleDefinition that contain the SBOL Participation.
* @param productionRxn - The SBML reaction that will store the SpeciesReference created from the converted repressor SBOL Participation.
* @param targetModel - The SBML model to store the SBML Reaction and SpeciesReference created from the conversion.
*/
private static void generateRepressorReference(Participation repressor, FunctionalComponent promoter,
ModuleDefinition moduleDef, Reaction productionRxn, BioModel targetModel) {
FunctionalComponent tf = moduleDef.getFunctionalComponent(repressor.getParticipantURI());
targetModel.addRepressorToProductionReaction(getDisplayID(promoter),
getDisplayID(tf), "none", productionRxn, null, null, null);
// Annotate SBML repressor species reference with SBOL repressor participation
ModifierSpeciesReference repressorRef = productionRxn.getModifierForSpecies(getDisplayID(tf));
SBMLutilities.setDefaultMetaID(targetModel.getSBMLDocument(), repressorRef, 1);
annotateSpeciesReference(repressorRef, repressor);
}
示例14: assignModifiers
import org.sbml.jsbml.ModifierSpeciesReference; //导入依赖的package包/类
private void assignModifiers(ListOf<ModifierSpeciesReference> modifiers) {
for (ModifierSpeciesReference reference : modifiers) {
logger.debug("Assigning Chemical Entity {} as catalytic modifier.", reference.getSpecies());
String identifier = reference.getSpecies();
currentReaction.getKineticLaw().referenceChemicalEntityToParameter(identifier, entities.get(identifier));
currentReaction.getCatalyticReactants().add(new CatalyticReactant(entities.get(identifier), ReactantRole.INCREASING));
}
}
示例15: addDefaultSBOTerm
import org.sbml.jsbml.ModifierSpeciesReference; //导入依赖的package包/类
/**
* Adds the default SBO term.
*
* @param node the node
*/
public static void addDefaultSBOTerm(TreeNode node) {
for (int i = 0; i < node.getChildCount(); i++) {
addDefaultSBOTerm(node.getChildAt(i));
}
if (!(node instanceof SBase) ) {
return ;
}
SBase sbase = (SBase) node;
if (sbase.isSetSBOTerm()) {
return;
}
if (sbase instanceof Model) {
sbase.setSBOTerm(intSBOTermForModel);
} else if (sbase instanceof Species) {
sbase.setSBOTerm(intSBOTermForGENERIC);
} else if (sbase instanceof Compartment) {
sbase.setSBOTerm(intSBOTermForCompartment);
} else if (sbase instanceof Parameter) {
sbase.setSBOTerm(intSBOTermForParameter);
} else if (sbase instanceof Rule) {
sbase.setSBOTerm(intSBOTermForRateRule);
} else if (sbase instanceof Compartment) {
sbase.setSBOTerm(intSBOTermForCompartment);
} else if (sbase instanceof Reaction) {
sbase.setSBOTerm(intSBOTermForReaction);
} else if (sbase instanceof SpeciesReference) {
Reaction r = (Reaction) ((SpeciesReference) sbase).getParentSBMLObject().getParentSBMLObject();
if (r.getListOfReactants().contains(sbase)) {
sbase.setSBOTerm(intSBOTermForReactant);
} else {
sbase.setSBOTerm(intSBOTermForProduct);
}
} else if (sbase instanceof ModifierSpeciesReference) {
sbase.setSBOTerm(intSBOTermForModifierSpeciesReference);
} else if (sbase instanceof KineticLaw) {
sbase.setSBOTerm(intSBOTermForKineticLaw);
}
}