Update Converter.java

Fixed trying to read a document without specifying outputdir
Fixed code trying to read only .xml and not also .sbol files
This commit is contained in:
Pedro Fontanarrosa 2022-04-18 12:15:35 -04:00
parent b6aa5bf573
commit 2adf6d6425

View file

@ -73,7 +73,6 @@ public class Converter {
+ "and can convert to/from SBOL 1.1, to/from SBML, GenBank, and FASTA formats.");
System.err.println();
System.err.println("Usage:");
//TODO PEDRO shouldnt this be conersion 3.0.0-SNAPSHOT?
System.err.println("\tjava -jar iBioSim-conversion-0.0.1-SNAPSHOT-jar-with-dependencies.jar [options] inputFile ");
System.err.println();
System.err.println("Convert SBOL to SBML Example:");
@ -496,6 +495,7 @@ public class Converter {
SBOLDocument sbolDoc = SBOLUtility.loadSBOLFile(fullInputFileName, URIPrefix);
String circuit_name = file.getName();
circuit_name = circuit_name.replace(".xml", "");
circuit_name = circuit_name.replace(".sbol", "");
String vpr_output = circuit_name + "_topModule";
if(!topLevelURIStr.isEmpty())
@ -554,7 +554,7 @@ public class Converter {
}
if (topModelId != null) {
SBMLDocument topModel = SBMLutilities.readSBML(vpr_output+".xml", null, null);
SBMLDocument topModel = SBMLutilities.readSBML(outputDir + File.separator + vpr_output+ ".xml", null, null);
topModel.getModel().setId(topModelId);
SBMLWriter writer = new SBMLWriter();
try {