当前位置: 首页>>代码示例>>Java>>正文


Java Species类代码示例

本文整理汇总了Java中org.sbml.jsbml.Species的典型用法代码示例。如果您正苦于以下问题:Java Species类的具体用法?Java Species怎么用?Java Species使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Species类属于org.sbml.jsbml包,在下文中一共展示了Species类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generateReplacedBy

import org.sbml.jsbml.Species; //导入依赖的package包/类
/**
 * Convert the given SBOL MapsTo object into SBML replacedBy for the given remote and local SBOL ModuleDefinition.
 * Annotation will be performed on SBML replacedBy for any SBOL MapsTo information that can't be mapped directly.
 * 
 * @param mapping - The SBOL MapsTo to be converted to SBML replacedBy.  
 * @param subModule - The SBOL Module that is considered to be the remote model in the replacedBy object.
 * @param moduleDef - The SBOL ModuleDefinition that is considered to be the local model in the replacedBy object.
 * @param sbolDoc - The SBOL Document that contains the SBOL objects to convert to SBML replacedBy.
 * @param subTargetModel - The SBML remote model that contain the SBML replacedBy.
 * @param targetModel - The SBML local model that contain the SBML replacedBy.
 */
private static void generateReplacedBy(MapsTo mapping, Module subModule, ModuleDefinition moduleDef, 
		SBOLDocument sbolDoc, BioModel subTargetModel, BioModel targetModel) {
	ModuleDefinition subModuleDef = sbolDoc.getModuleDefinition(subModule.getDefinitionURI());
	FunctionalComponent remoteSpecies = subModuleDef.getFunctionalComponent(mapping.getRemoteURI());
	FunctionalComponent localSpecies = moduleDef.getFunctionalComponent(mapping.getLocalURI());

	Species localSBMLSpecies = targetModel.getSBMLDocument().getModel().getSpecies(getDisplayID(localSpecies));
	Port port = subTargetModel.getPortByIdRef(getDisplayID(remoteSpecies));
	SBMLutilities.addReplacedBy(localSBMLSpecies, getDisplayID(subModule), port.getId(), new String[]{""}, 
			new String[]{""}, new String[]{""}, new String[]{""});

	// Annotate SBML replaced-by with SBOL maps-to
	CompSBasePlugin compSBML = SBMLutilities.getCompSBasePlugin(localSBMLSpecies);
	SBMLutilities.setDefaultMetaID(targetModel.getSBMLDocument(), compSBML.getReplacedBy(), 1);
	annotateReplacedBy(compSBML.getReplacedBy(), mapping);
}
 
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:28,代码来源:SBOL2SBML.java

示例2: speciesToVector

import org.sbml.jsbml.Species; //导入依赖的package包/类
/**
 * Species to vector.
 *
 * @param s the s
 * @return the vector
 */
private Vector<Object> speciesToVector(Species s){
	Vector<Object> v = new Vector<Object>();
	v.add(s.getId());
	if(s.isSetInitialAmount()){
		v.add("amount");
		v.add(s.getInitialAmount());
	} else if(s.isSetInitialConcentration()){
		v.add("concentration");
		v.add(s.getInitialConcentration());
	}
	v.add(s.getCompartment());
	v.add(s.getSubstanceUnits());
	v.add(s.getHasOnlySubstanceUnits());
	v.add(s.getBoundaryCondition());
	v.add(s.getConstant());
	
	return v;
}
 
开发者ID:spatialsimulator,项目名称:XitoSBML,代码行数:25,代码来源:SpeciesTable.java

示例3: edit

import org.sbml.jsbml.Species; //导入依赖的package包/类
@Override
void edit(int index) throws IllegalArgumentException{
	if(index == -1 ) return ;
	if(sd == null)
		sd = new SpeciesDialog(model);
	Species s = sd.showDialog((Species) memberList.get(index));
	
	if(s == null) return;
	
	memberList.set(index, s);

	// copy contents of Species(JTable) to Species(Model)
	Species sp = (Species) list.getElementBySId(s.getId());
	SBMLProcessUtil.copySpeciesContents(s, sp);

	((MyTableModel)table.getModel()).updateRow(index, speciesToVector(s));
	
}
 
开发者ID:spatialsimulator,项目名称:XitoSBML,代码行数:19,代码来源:SpeciesTable.java

示例4: showDialog

import org.sbml.jsbml.Species; //导入依赖的package包/类
/**
 * Show dialog.
 *
 * @return the species
 * @throws IllegalArgumentException the illegal argument exception
 * @throws IdentifierException the identifier exception
 */
public Species showDialog()throws IllegalArgumentException, IdentifierException{
	gd = new GenericDialog("Add Species");
	gd.setResizable(true);
	gd.pack();

	gd.addStringField("id:", "");
	gd.addRadioButtonGroup("initial:", initial, 1, 2, "amount");
	gd.addNumericField("quantity:", 0, 1);
	gd.addChoice("compartment:", SBMLProcessUtil.listIdToStringArray(model.getListOfCompartments()), null);
	gd.addChoice("substanceUnit:", units, null);
	gd.addRadioButtonGroup("boundaryCondition:",bool,1,2,"false");
	gd.addRadioButtonGroup("constant:",bool,1,2,"false");
	
	gd.showDialog();
	if(gd.wasCanceled())
		return null;

	species  = model.createSpecies();
	setSpeciesData();
	
	return species;
}
 
开发者ID:spatialsimulator,项目名称:XitoSBML,代码行数:30,代码来源:SpeciesDialog.java

示例5: completeSpecies

import org.sbml.jsbml.Species; //导入依赖的package包/类
/**
 * Complete species.
 *
 * @param species
 *        the species
 * @return ListOf<Species>
 *         TODO
 */
public static ListOf<Species> completeSpecies(ListOf<Species> species) {
  int i = 0;
  for (Species s : species) {
    if (!s.isSetId()) {
      s.setId(s.getClass().getSimpleName() + i++);
    }
    if (!s.isSetCompartment()) {
      s.setCompartment(model.getCompartment(0));
    }
    if (!s.isSetHasOnlySubstanceUnits()) {
      s.setHasOnlySubstanceUnits(true);
    }
    if (!s.isSetBoundaryCondition()) {
      s.setBoundaryCondition(true);
    }
    if (!s.isSetConstant()) {
      s.setConstant(true);
    }
  }
  return species;
}
 
开发者ID:funasoul,项目名称:celldesigner-parser,代码行数:30,代码来源:SBMLModelCompleter.java

示例6: completeSpeciesReference

import org.sbml.jsbml.Species; //导入依赖的package包/类
/**
 * Complete species reference.
 *
 * @param speciesReference
 *        the species reference
 * @return ListOf<SpeciesReference>
 *         TODO
 */
public static ListOf<SpeciesReference> completeSpeciesReference(
  ListOf<SpeciesReference> speciesReference) {
  for (SpeciesReference sr : speciesReference) {
    if (!sr.isSetSpecies()){
      Species s = model.getSpecies(sr.getId());
      if(s == null) {
        sr.setSpecies(model.getSpecies(0));
      } else {
        sr.setSpecies(s);
      }
    }
    if (!sr.isSetStoichiometry()) {
      sr.setStoichiometry(1d);
    }
    if (!sr.isSetConstant()) {
      sr.setConstant(true);
    }
  }
  return speciesReference;
}
 
开发者ID:funasoul,项目名称:celldesigner-parser,代码行数:29,代码来源:SBMLModelCompleter.java

示例7: createInterSpecies

import org.sbml.jsbml.Species; //导入依赖的package包/类
private static Species createInterSpecies(String inputSubSpeciesID, String outputSubSpeciesID, 
		String inputSubDNA, String outputSubDNA, BioModel biomodel) {
	String speciesID;
	int speciesIndex = 0;
	if (outputSubDNA.length() == 0 && inputSubDNA.length() > 0) {
		speciesID = inputSubSpeciesID;
		while (biomodel.isSIdInUse(speciesID)) {
			speciesID = inputSubSpeciesID + "_" + speciesIndex;
			speciesIndex++;
		}
	} else {
		speciesID = outputSubSpeciesID;
		while (biomodel.isSIdInUse(speciesID)) {
			speciesID = outputSubSpeciesID + "_" + speciesIndex;
			speciesIndex++;
		}
	}
	biomodel.createSpecies(speciesID, 0, 0);
	return biomodel.getSBMLDocument().getModel().getSpecies(speciesID);
}
 
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:21,代码来源:Synthesizer.java

示例8: isPromoterSpecies

import org.sbml.jsbml.Species; //导入依赖的package包/类
public static boolean isPromoterSpecies(Species species) {
	if (species.isSetSBOTerm()) {
		if (species.getSBOTerm()==GlobalConstants.SBO_OLD_PROMOTER_SPECIES) {
			species.setSBOTerm(GlobalConstants.SBO_PROMOTER_BINDING_REGION);
			return true;
		}
		if (species.getSBOTerm()==GlobalConstants.SBO_PROMOTER_SPECIES) {
			species.setSBOTerm(GlobalConstants.SBO_PROMOTER_BINDING_REGION);
			return true;
		} else if (species.getSBOTerm()==GlobalConstants.SBO_PROMOTER_BINDING_REGION) {
			return true;
		} else if (species.getSBOTermID().equals(GlobalConstants.SBO_DNA_SEGMENT)) {
			//species.setSBOTerm(GlobalConstants.SBO_PROMOTER_BINDING_REGION);
			return true;
			// TODO: assuming DNA_SEGMENT is promoter
		}
	}
	if (AnnotationUtility.checkObsoleteAnnotation(species,GlobalConstants.TYPE+"="+GlobalConstants.PROMOTER)) {
		species.setSBOTerm(GlobalConstants.SBO_PROMOTER_BINDING_REGION);
		AnnotationUtility.removeObsoleteAnnotation(species);
		return true;
	}
	return false;
}
 
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:25,代码来源:BioModel.java

示例9: getDegradationReaction

import org.sbml.jsbml.Species; //导入依赖的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;
}
 
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:19,代码来源:BioModel.java

示例10: getProductionReaction

import org.sbml.jsbml.Species; //导入依赖的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;
}
 
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:19,代码来源:BioModel.java

示例11: getComplexReaction

import org.sbml.jsbml.Species; //导入依赖的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;
}
 
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:20,代码来源:BioModel.java

示例12: parseSpeciesArrayAnnotation

import org.sbml.jsbml.Species; //导入依赖的package包/类
public static int[] parseSpeciesArrayAnnotation(Species species) {
	String annotation;
	try {
		annotation = species.getAnnotationString().replace("<annotation>", "").replace("</annotation>", "").trim();
		Pattern arrayPattern = Pattern.compile(SPECIES_ARRAY_ANNOTATION);
		Matcher arrayMatcher = arrayPattern.matcher(annotation);
		if (arrayMatcher.find()) {
			if (arrayMatcher.group(1)!=null && arrayMatcher.group(2)!=null &&
					arrayMatcher.group(3)!=null && arrayMatcher.group(4)!=null) {
				int[] result = new int[4];
				result[0] = Integer.parseInt(arrayMatcher.group(1));
				result[1] = Integer.parseInt(arrayMatcher.group(2));
				result[2] = Integer.parseInt(arrayMatcher.group(3));
				result[3] = Integer.parseInt(arrayMatcher.group(4));
				return result;
			}
		}
	}
	catch (XMLStreamException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	return null;
}
 
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:25,代码来源:AnnotationUtility.java

示例13: printRNAP

import org.sbml.jsbml.Species; //导入依赖的package包/类
/**
 * Prints the RNAP molecule to the document
 * 
 * @param document
 *            the SBML document
 */
private void printRNAP(SBMLDocument document) {
	double rnap = 30;
	if (properties != null) {
		rnap = Double.parseDouble(properties.getParameter(GlobalConstants.RNAP_STRING));
	}
	Species s = Utility.makeSpecies("RNAP", document.getModel().getCompartment(0).getId(), rnap, -1);		
	s.setHasOnlySubstanceUnits(true);
	Utility.addSpecies(document, s);
	//Adds RNA polymerase for compartments other than default
	this.compartments = new HashMap<String,Properties>(); 
	for (int i=0; i < document.getModel().getCompartmentCount(); i++) {
		compartments.put(document.getModel().getCompartment(i).getId(), null);
	}
	for (String compartment : compartments.keySet()) {
		Properties prop = compartments.get(compartment);
		if (prop != null && prop.containsKey(GlobalConstants.RNAP_STRING)) {
			rnap = Double.parseDouble((String)prop.get(GlobalConstants.RNAP_STRING));
		}
		Species sc = Utility.makeSpecies(compartment + "__RNAP", compartment, rnap, -1);
		sc.setHasOnlySubstanceUnits(true);
		Utility.addSpecies(document, sc);
	}
}
 
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:30,代码来源:GeneticNetwork.java

示例14: visitSpasticSpecies

import org.sbml.jsbml.Species; //导入依赖的package包/类
@Override
public void visitSpasticSpecies(SpasticSpecies specie) {
	loadValues(specie);
	String compartment = checkCompartments(specie.getId());
	Species s = Utility.makeSpecies(specie.getId(), compartment, amount, concentration);
	s.setName(specie.getName());
	s.setHasOnlySubstanceUnits(true);
	Utility.addSpecies(document, s);
	
	r = new org.sbml.jsbml.Reaction(GlobalConstants.SBML_LEVEL, GlobalConstants.SBML_VERSION);
	r.setId("Constitutive_production_" + s.getId());
	r.setCompartment(compartment);
	r.addProduct(Utility.SpeciesReference(s.getId(), specie.getnp()));
	
	r.setReversible(false);
	//r.setFast(false);
	kl = r.createKineticLaw();
	Utility.Parameter(kl, "kp", specie.getKo());
	kl.setMath(SBMLutilities.myParseFormula("kp"));
	Utility.addReaction(document, r);		
}
 
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:22,代码来源:PrintSpeciesVisitor.java

示例15: visitDiffusibleConstitutiveSpecies

import org.sbml.jsbml.Species; //导入依赖的package包/类
@Override
public void visitDiffusibleConstitutiveSpecies(DiffusibleConstitutiveSpecies specie) {
	
	loadValues(specie);
	String compartment = checkCompartments(specie.getId());
	Species s = Utility.makeSpecies(specie.getId(), compartment, amount, concentration);
	s.setName(specie.getName());
	s.setHasOnlySubstanceUnits(true);
	Utility.addSpecies(document, s);
	
	r = new org.sbml.jsbml.Reaction(GlobalConstants.SBML_LEVEL, GlobalConstants.SBML_VERSION);
	r.setId("Constitutive_production_" + s.getId());
	r.setCompartment(compartment);
	r.addProduct(Utility.SpeciesReference(s.getId(), Double.parseDouble(parameters.getParameter(GlobalConstants.STOICHIOMETRY_STRING))));
	
	r.setReversible(false);
	//r.setFast(false);
	kl = r.createKineticLaw();
	Utility.Parameter(kl, "kp", Double.parseDouble(parameters
				.getParameter((GlobalConstants.OCR_STRING))));	
	kl.setMath(SBMLutilities.myParseFormula("kp"));
	Utility.addReaction(document, r);	
}
 
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:24,代码来源:PrintSpeciesVisitor.java


注:本文中的org.sbml.jsbml.Species类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。