1111import cbit .vcell .mapping .MappingException ;
1212import cbit .vcell .mapping .SimulationContext ;
1313import cbit .vcell .mongodb .VCMongoMessage ;
14+ import cbit .vcell .parser .Expression ;
1415import cbit .vcell .parser .ExpressionException ;
1516import cbit .vcell .xml .XMLSource ;
1617import cbit .vcell .xml .XmlHelper ;
@@ -34,8 +35,8 @@ public static void sbml_to_vcml(String sbml_content, Path vcmlPath)
3435 throws VCLoggerException , XmlParseException , IOException , MappingException {
3536
3637 GeometrySpec .avoidAWTImageCreation = true ;
38+ XmlHelper .cloneUsingXML = true ;
3739 VCMongoMessage .enabled = false ;
38- XmlHelper .cloneUsingXML = true ;
3940
4041 record LoggerMessage (VCLogger .Priority priority , VCLogger .ErrorType errorType , String message ) {};
4142 final ArrayList <LoggerMessage > messages = new ArrayList <>();
@@ -76,8 +77,8 @@ record LoggerMessage(VCLogger.Priority priority, VCLogger.ErrorType errorType, S
7677 public static void vcml_to_sbml (String vcml_content , String applicationName , Path sbmlPath , boolean roundTripValidation )
7778 throws XmlParseException , IOException , XMLStreamException , SbmlException , MappingException , ImageException , GeometryException , ExpressionException {
7879 GeometrySpec .avoidAWTImageCreation = true ;
80+ XmlHelper .cloneUsingXML = true ;
7981 VCMongoMessage .enabled = false ;
80- XmlHelper .cloneUsingXML = true ;
8182
8283 BioModel bioModel = XmlHelper .XMLToBioModel (new XMLSource (vcml_content ));
8384 bioModel .updateAll (false );
@@ -116,13 +117,20 @@ public static void vcml_to_sbml(String vcml_content, String applicationName, Pat
116117
117118 public static void vcml_to_vcml (String vcml_content , Path vcmlPath ) throws XmlParseException , IOException , MappingException {
118119 GeometrySpec .avoidAWTImageCreation = true ;
120+ XmlHelper .cloneUsingXML = true ;
119121 VCMongoMessage .enabled = false ;
120- XmlHelper .cloneUsingXML = true ;
121122
122123 BioModel bioModel = XmlHelper .XMLToBioModel (new XMLSource (vcml_content ));
123124 bioModel .updateAll (false );
124125 // write the BioModel to a VCML file
125126 String vcml_str = XmlHelper .bioModelToXML (bioModel );
126127 XmlUtil .writeXMLStringToFile (vcml_str , vcmlPath .toFile ().getAbsolutePath (), true );
127128 }
129+
130+ public static String get_python_infix (String vcellInfix ) throws ExpressionException {
131+ GeometrySpec .avoidAWTImageCreation = true ;
132+ XmlHelper .cloneUsingXML = true ;
133+ VCMongoMessage .enabled = false ;
134+ return new Expression (vcellInfix ).infix_Python ();
135+ }
128136}
0 commit comments