Search in sources :

Example 11 with SbmlException

use of org.vcell.sbml.SbmlException in project vcell by virtualcell.

the class SimulationServiceImpl method getSBML.

public String getSBML(String vcml, String applicationName) throws ThriftDataAccessException, TException {
    try {
        BioModel bioModel = XmlHelper.XMLToBioModel(new XMLSource(vcml));
        SimulationContext simContext = bioModel.getSimulationContext(applicationName);
        SBMLExporter exporter = new SBMLExporter(simContext, 3, 1, simContext.getGeometry().getDimension() > 0);
        VCellSBMLDoc sbmlDoc = exporter.convertToSBML();
        return sbmlDoc.xmlString;
    } catch (SBMLException | XmlParseException | SbmlException | XMLStreamException e) {
        e.printStackTrace();
        throw new ThriftDataAccessException("failed to generate SBML document: " + e.getMessage());
    }
}
Also used : SBMLException(org.sbml.jsbml.SBMLException) XMLStreamException(javax.xml.stream.XMLStreamException) BioModel(cbit.vcell.biomodel.BioModel) VCellSBMLDoc(org.vcell.sbml.vcell.SBMLExporter.VCellSBMLDoc) ThriftDataAccessException(org.vcell.vcellij.api.ThriftDataAccessException) SBMLExporter(org.vcell.sbml.vcell.SBMLExporter) XmlParseException(cbit.vcell.xml.XmlParseException) SbmlException(org.vcell.sbml.SbmlException) SimulationContext(cbit.vcell.mapping.SimulationContext) XMLSource(cbit.vcell.xml.XMLSource)

Aggregations

SbmlException (org.vcell.sbml.SbmlException)11 XMLStreamException (javax.xml.stream.XMLStreamException)9 BioModel (cbit.vcell.biomodel.BioModel)8 SimulationContext (cbit.vcell.mapping.SimulationContext)7 ExpressionException (cbit.vcell.parser.ExpressionException)7 SBMLException (org.sbml.jsbml.SBMLException)7 IOException (java.io.IOException)6 StructureMapping (cbit.vcell.mapping.StructureMapping)5 Expression (cbit.vcell.parser.Expression)5 Model (cbit.vcell.model.Model)4 SpeciesContext (cbit.vcell.model.SpeciesContext)4 Simulation (cbit.vcell.solver.Simulation)4 SimulationJob (cbit.vcell.solver.SimulationJob)4 InteriorPoint (org.sbml.jsbml.ext.spatial.InteriorPoint)4 ImageException (cbit.image.ImageException)3 KineticsParameter (cbit.vcell.model.Kinetics.KineticsParameter)3 ModelUnitSystem (cbit.vcell.model.ModelUnitSystem)3 Structure (cbit.vcell.model.Structure)3 SolverException (cbit.vcell.solver.SolverException)3 ODESolverResultSet (cbit.vcell.solver.ode.ODESolverResultSet)3