public class EscherConverter
extends de.zbit.Launcher
Constructor and Description |
---|
EscherConverter(String... args)
Called by the main method.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
addCopyrightToSplashScreen() |
protected boolean |
addVersionNumberToSplashScreen() |
void |
batchProcess(File input,
File output,
de.zbit.util.prefs.SBProperties properties)
Convert files one by one by calling the
convert(File, File, SBProperties) recursively. |
void |
commandLineMode(de.zbit.AppConf appConf) |
static <T> Escher2Standard<T> |
configure(Escher2Standard<T> converter,
de.zbit.util.prefs.SBProperties properties)
This configures the generic
Escher2Standard and sets the common layout options. |
static <T> T |
convert(EscherMap map,
Class<? extends T> format,
de.zbit.util.prefs.SBProperties properties)
Generic method which converts the given
EscherMap instance to the specified
generic parameter format , by calling the corresponding converter. |
static <T> T |
convert(File input,
Class<? extends T> format,
de.zbit.util.prefs.SBProperties properties)
Converts given JSON
input to given output format . |
void |
convert(File input,
File output,
de.zbit.util.prefs.SBProperties properties)
Called by
batchProcess(File, File, SBProperties) for every file. |
static EscherMap |
convert(org.sbgn.bindings.Sbgn document,
de.zbit.util.prefs.SBProperties properties)
Calls SBGN-ML to Escher converter.
|
static List<EscherMap> |
convert(org.sbml.jsbml.SBMLDocument document,
de.zbit.util.prefs.SBProperties properties)
Calls SBML Layout Extension to Escher converter.
|
static boolean |
extractCobraModel(File file)
Extracts CoBRA from
SBMLDocument if it is FBC compliant. cobrapy must be present for
this. |
List<Class<? extends de.zbit.util.prefs.KeyProvider>> |
getCmdLineOptions() |
String |
getInstitute() |
List<Class<? extends de.zbit.util.prefs.KeyProvider>> |
getInteractiveOptions() |
String[] |
getLogPackages() |
String |
getOrganization() |
String |
getProvider() |
URL |
getURLlicenseFile() |
URL |
getURLOnlineUpdate() |
String |
getVersionNumber() |
short |
getYearOfProgramRelease() |
short |
getYearWhenProjectWasStarted() |
Window |
initGUI(de.zbit.AppConf appConf) |
static void |
main(String[] args)
Starts the program.
|
static EscherMap |
parseEscherJson(File input)
Parses given JSON file into an
EscherMap instance using Jackson. |
static EscherMap |
parseEscherJson(InputStream stream)
Parses an
InputStream that represents an Escher JSON file into an
EscherMap instance using Jackson. |
static EscherMap |
parseSBGNML(File input,
de.zbit.util.prefs.SBProperties properties) |
static EscherMap |
parseSBGNML(InputStream is,
de.zbit.util.prefs.SBProperties properties)
Parses an SBGNML input and calls a convert method to
EscherMap . |
boolean |
showsGUI() |
static void |
writeEscherJson(EscherMap map,
File output)
Serializes an
EscherMap instance to JSON and writes to output file. |
static void |
writeEscherJson(List<EscherMap> mapList,
File output)
Serializes a
List to JSON and writes to output directory. |
checkForUpdate, configureSystemProperties, connectToGaruda, equals, exit, exit, exit, getAppConf, getAppName, getCitation, getCommandLineArgs, getCopyrightYears, getId, getLogLevel, getPersistentOptions, getResources, guiMode, hashCode, isGarudaEnabled, isTerminateJVMwhenDone, launchCommandLineMode, parseCmdArgs, printCopyrightMessage, run, setTerminateJVMwhenDone, setUp, toString
public EscherConverter(String... args)
args
- Command line options, if any.public static <T> Escher2Standard<T> configure(Escher2Standard<T> converter, de.zbit.util.prefs.SBProperties properties)
Escher2Standard
and sets the common layout options.converter
- The converter to configure.properties
- Command line options, to configure the converter with.public static <T> T convert(EscherMap map, Class<? extends T> format, de.zbit.util.prefs.SBProperties properties)
EscherMap
instance to the specified
generic parameter format
, by calling the corresponding converter.map
- EscherMap
instance to convert.format
- Output format to convert to.properties
- Command line options, if any.format
type created from the escher map.public static EscherMap convert(org.sbgn.bindings.Sbgn document, de.zbit.util.prefs.SBProperties properties)
SBGN2Escher
.document
- SBGN-ML (Sbgn
) document to convert.properties
- Command line options, if any.EscherMap
instance.public static List<EscherMap> convert(org.sbml.jsbml.SBMLDocument document, de.zbit.util.prefs.SBProperties properties)
SBML2Escher
.document
- SBMLDocument
to convert.properties
- Command line options, if any.EscherMap
extracted from the SBML file, as there may be more than
one.public static <T> T convert(File input, Class<? extends T> format, de.zbit.util.prefs.SBProperties properties) throws IOException, org.json.simple.parser.ParseException
input
to given output format
. Simply calls the
convert(EscherMap, Class, SBProperties)
with the parsed JSON.input
- JSON file which has an EscherMap
.format
- Output format to convert to.properties
- Command line options, if any.format
type created from the escher map.IOException
- Thrown if there are problems in reading the input
file.org.json.simple.parser.ParseException
- Thrown if the JSON in input
file is invalid.public static EscherMap parseEscherJson(File input) throws IOException
EscherMap
instance using Jackson.input
- The File
to parse.EscherMap
instance.IOException
- Thrown if there are problems in reading the input
file.public static EscherMap parseEscherJson(InputStream stream) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
InputStream
that represents an Escher JSON file into an
EscherMap
instance using Jackson.stream
- IOException
com.fasterxml.jackson.core.JsonProcessingException
public static void main(String[] args)
args
- Command line options, if any.protected boolean addCopyrightToSplashScreen()
addCopyrightToSplashScreen
in class de.zbit.Launcher
protected boolean addVersionNumberToSplashScreen()
addVersionNumberToSplashScreen
in class de.zbit.Launcher
public void batchProcess(File input, File output, de.zbit.util.prefs.SBProperties properties) throws org.json.simple.parser.ParseException, JAXBException, IOException, XMLStreamException, ParserConfigurationException, SAXException, TransformerException
convert(File, File, SBProperties)
recursively.
Only called once if single file.input
- Single file or input directory to convert from.output
- Single file or output directory to convert to.properties
- Command line options, if any.IOException
- Thrown if there are problems in reading the input
file(s).TransformerException
- Thrown if there are problems in parsing XML file(s).ParserConfigurationException
- Thrown if there are problems in parsing XML file(s).SAXException
- Thrown if there are problems in parsing XML file(s).JAXBException
- Thrown if there are problems in parsing XML file(s).XMLStreamException
- Thrown if there are problems in parsing XML file(s).org.json.simple.parser.ParseException
- Thrown if there are problems in parsing JSON file(s).org.sbml.jsbml.SBMLException
- Thrown if there are problems in parsing XML file(s).public void commandLineMode(de.zbit.AppConf appConf)
commandLineMode
in class de.zbit.Launcher
public void convert(File input, File output, de.zbit.util.prefs.SBProperties properties) throws IOException, org.json.simple.parser.ParseException, XMLStreamException, org.sbml.jsbml.SBMLException, JAXBException, SAXException, ParserConfigurationException, TransformerException
batchProcess(File, File, SBProperties)
for every file. Calls the
appropriate overloads.input
- Input (single) File
.output
- Output (single) File
.properties
- Command line options, if any.IOException
- Thrown if there are problems in reading the input
file(s).XMLStreamException
- Thrown if there are problems in parsing XML file(s).TransformerException
- Thrown if there are problems in parsing XML file(s).ParserConfigurationException
- Thrown if there are problems in parsing XML file(s).SAXException
- Thrown if there are problems in parsing XML file(s).JAXBException
- Thrown if there are problems in parsing XML file(s).org.json.simple.parser.ParseException
- Thrown if there are problems in parsing JSON file(s).org.sbml.jsbml.SBMLException
- Thrown if there are problems in parsing XML file(s).public static EscherMap parseSBGNML(File input, de.zbit.util.prefs.SBProperties properties) throws JAXBException
input
- properties
- JAXBException
public static EscherMap parseSBGNML(InputStream is, de.zbit.util.prefs.SBProperties properties) throws JAXBException
EscherMap
.is
- InputStream of the SBGNML file.properties
- Command line arguments, if applicableis
converted to EscherMap
JAXBException
public static boolean extractCobraModel(File file) throws IOException, XMLStreamException
SBMLDocument
if it is FBC compliant. cobrapy must be present for
this.file
- Input file.IOException
- Thrown if there are problems in reading the input
file(s).XMLStreamException
- Thrown if there are problems in parsing XML file(s).public static void writeEscherJson(EscherMap map, File output) throws IOException
EscherMap
instance to JSON and writes to output
file.map
- Escher map to serialize.output
- Output file to write to.IOException
- Thrown if there are problems in reading the input
file(s).public static void writeEscherJson(List<EscherMap> mapList, File output)
List
to JSON and writes to output
directory.mapList
- List of Escher maps to serialize.output
- Directory to create files in.public List<Class<? extends de.zbit.util.prefs.KeyProvider>> getCmdLineOptions()
getCmdLineOptions
in class de.zbit.Launcher
public String getInstitute()
getInstitute
in class de.zbit.Launcher
public List<Class<? extends de.zbit.util.prefs.KeyProvider>> getInteractiveOptions()
getInteractiveOptions
in class de.zbit.Launcher
public String[] getLogPackages()
getLogPackages
in class de.zbit.Launcher
public String getOrganization()
getOrganization
in class de.zbit.Launcher
public String getProvider()
getProvider
in class de.zbit.Launcher
public URL getURLlicenseFile()
getURLlicenseFile
in class de.zbit.Launcher
public URL getURLOnlineUpdate()
getURLOnlineUpdate
in class de.zbit.Launcher
public String getVersionNumber()
getVersionNumber
in class de.zbit.Launcher
public short getYearOfProgramRelease()
getYearOfProgramRelease
in class de.zbit.Launcher
public short getYearWhenProjectWasStarted()
getYearWhenProjectWasStarted
in class de.zbit.Launcher
public Window initGUI(de.zbit.AppConf appConf)
initGUI
in class de.zbit.Launcher
public boolean showsGUI()
showsGUI
in class de.zbit.Launcher
Copyright © 2015–2019 University of Tübingen. All rights reserved.