SigPath

org.sigpath.bioimport
Class XMLExport

java.lang.Object
  extended by org.sigpath.bioimport.XMLExport

public class XMLExport
extends Object

Performs XML Export of Sigpath Data.


Constructor Summary
XMLExport(PrintStream out, String schemaURL, boolean standaloneOutput, boolean interactive)
          Creates a new xml exmport using the specified schema url and print stream.
XMLExport(XDebug xdebug)
          Creates a new xml exmport using the default schema url.
XMLExport(XDebug xdebug, String schema)
          Creates a new xml exmport using the specified schema url.
 
Method Summary
static Vector collectModifiedChemicals()
           
static void displayCommandLineUsage()
          Displays the Command Line Usage.
 String displaySubmission(SigpathSubmission submission)
          Outputs XML.
 String exportAll()
          Exports everything.
 String exportAll(List list)
          Exports everything in the list.
 String exportBySpid(String spid)
          Exports the SigPathEntity that that spid refers to.
 SigpathSubmission exportComplex(SigpathSubmission submission, HashMap spidsToTempIDs, String spid)
          If spid is null exports all complexes.
 SigpathSubmission exportComponents(SigpathSubmission submission, HashMap spidsToTempIDs, String spid)
          If spid is null exports all complexes and modified chemicals.
 SigpathSubmission exportConcentrations(SigpathSubmission submission, HashMap spidsToTempIDs, String spid)
           
 void exportDataSource(SPDBManager dbm, SigpathSubmission submission, HashMap spidsToCastorInstances, DataSource dataSource)
          Export SigPath instances to XML
 SigpathSubmission exportModels(SigpathSubmission submission, HashMap spidsToTempIDs, String spid)
           
 SigpathSubmission exportModifiedChemical(SigpathSubmission submission, HashMap spidsToTempIDs, String spid)
          If spid is null exports all modified chemicals.
 SigpathSubmission exportNamedChemicalInteractions(SigpathSubmission submission, HashMap spidsToTempIDs, String spid)
          If spid is null exports all named chemical interactions.
 SigpathSubmission exportNamedChemicals(SigpathSubmission submission, HashMap spidsToTempIDs, String spid)
          If spid is null exports all named chemicals.
 SigpathSubmission exportPathways(SigpathSubmission submission, HashMap spidsToTempIDs, DataSource dataSource)
          Export Pathways - If spid is null exports all Pathways.
 SigpathSubmission exportPendingReviews(SigpathSubmission submission, HashMap spidsToTempIDs, DataSource dataSource)
          Export PendingList - If spid is null exports all Pathways.
 SigpathSubmission exportProteins(SigpathSubmission submission, HashMap spidsToTempIDs, String spid)
          If spid is null exports all proteins.
 SigpathSubmission exportSmallMolecules(SigpathSubmission submission, HashMap spidsToTempIDs, String spid)
          Export small molecules to XML Submission.
 List getIdrefActions()
           
 int getNumOfTempIDs()
           
 XDebug getXDebug()
          Get the XDebug object associated with this export.
 boolean isStandaloneOutput()
          Should this model be exported standalone?
static void main(String[] args)
           
 void setProgressListener(ProgressListener progressListener)
          Set a progress listener for this export.
 void setStandaloneOutput(boolean standaloneOutput)
          Decide if the output should be standalone.
 void writeSubmission(SigpathSubmission submission, Writer writer)
          Writes the submission to the given writer object.
 void writeSubmissionWithoutValidation(SigpathSubmission submission, Writer writer)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLExport

public XMLExport(XDebug xdebug)
Creates a new xml exmport using the default schema url.

Parameters:
xdebug - debug object

XMLExport

public XMLExport(XDebug xdebug,
                 String schema)
Creates a new xml exmport using the specified schema url.

Parameters:
xdebug - debug object
schema - url of the schema to use

XMLExport

public XMLExport(PrintStream out,
                 String schemaURL,
                 boolean standaloneOutput,
                 boolean interactive)
          throws IOException,
                 SigPathDatabaseException,
                 MarshalException,
                 ValidationException
Creates a new xml exmport using the specified schema url and print stream.

Parameters:
out - PrintStream to write xml to
schemaURL - URL of the schema to use when generating the xml
standaloneOutput - true if the output should include all the data it needs to be a complete submission
interactive - true if the export should prompt the user for input.
Throws:
IOException
SigPathDatabaseException
MarshalException
ValidationException
Method Detail

getXDebug

public XDebug getXDebug()
Get the XDebug object associated with this export.

Returns:
the XDebug object

setProgressListener

public void setProgressListener(ProgressListener progressListener)
Set a progress listener for this export.

Parameters:
progressListener -

displayCommandLineUsage

public static void displayCommandLineUsage()
Displays the Command Line Usage.


writeSubmission

public void writeSubmission(SigpathSubmission submission,
                            Writer writer)
                     throws IOException,
                            ValidationException,
                            MarshalException
Writes the submission to the given writer object.

Parameters:
submission - Submission to write
writer - The writer
Throws:
IOException
ValidationException
MarshalException

writeSubmissionWithoutValidation

public void writeSubmissionWithoutValidation(SigpathSubmission submission,
                                             Writer writer)
                                      throws IOException,
                                             ValidationException,
                                             MarshalException
Deprecated. 

Writes the submission to the given writer object.

Parameters:
submission - Submission to write
writer - The writer
Throws:
IOException
ValidationException
MarshalException

displaySubmission

public String displaySubmission(SigpathSubmission submission)
                         throws MarshalException,
                                ValidationException,
                                IOException
Outputs XML.

Throws:
MarshalException
ValidationException
IOException

exportSmallMolecules

public SigpathSubmission exportSmallMolecules(SigpathSubmission submission,
                                              HashMap spidsToTempIDs,
                                              String spid)
                                       throws SigPathDatabaseException
Export small molecules to XML Submission. If spid arguemnt is null, will export all small molecules.

Parameters:
submission - The castor xml submission where the molecules will be written
spidsToTempIDs - The spid to xml-id map. Relation between spid and xml id is written in this map during the call
spid - SigPath identifier of one molecule, or null, to export all molecules.
Throws:
SigPathDatabaseException

exportProteins

public SigpathSubmission exportProteins(SigpathSubmission submission,
                                        HashMap spidsToTempIDs,
                                        String spid)
                                 throws SigPathDatabaseException
If spid is null exports all proteins.

Throws:
SigPathDatabaseException

exportComponents

public SigpathSubmission exportComponents(SigpathSubmission submission,
                                          HashMap spidsToTempIDs,
                                          String spid)
                                   throws SigPathDatabaseException
If spid is null exports all complexes and modified chemicals.

Throws:
SigPathDatabaseException

exportComplex

public SigpathSubmission exportComplex(SigpathSubmission submission,
                                       HashMap spidsToTempIDs,
                                       String spid)
                                throws SigPathDatabaseException
If spid is null exports all complexes.

Throws:
SigPathDatabaseException

exportModifiedChemical

public SigpathSubmission exportModifiedChemical(SigpathSubmission submission,
                                                HashMap spidsToTempIDs,
                                                String spid)
                                         throws SigPathDatabaseException
If spid is null exports all modified chemicals.

Throws:
SigPathDatabaseException

exportNamedChemicals

public SigpathSubmission exportNamedChemicals(SigpathSubmission submission,
                                              HashMap spidsToTempIDs,
                                              String spid)
                                       throws SigPathDatabaseException
If spid is null exports all named chemicals.

Throws:
SigPathDatabaseException

exportConcentrations

public SigpathSubmission exportConcentrations(SigpathSubmission submission,
                                              HashMap spidsToTempIDs,
                                              String spid)
                                       throws SigPathDatabaseException
Throws:
SigPathDatabaseException

exportModels

public SigpathSubmission exportModels(SigpathSubmission submission,
                                      HashMap spidsToTempIDs,
                                      String spid)
                               throws SigPathDatabaseException
Throws:
SigPathDatabaseException

exportPathways

public SigpathSubmission exportPathways(SigpathSubmission submission,
                                        HashMap spidsToTempIDs,
                                        DataSource dataSource)
                                 throws SigPathDatabaseException
Export Pathways - If spid is null exports all Pathways.

Throws:
SigPathDatabaseException

exportPendingReviews

public SigpathSubmission exportPendingReviews(SigpathSubmission submission,
                                              HashMap spidsToTempIDs,
                                              DataSource dataSource)
                                       throws SigPathDatabaseException
Export PendingList - If spid is null exports all Pathways.

Throws:
SigPathDatabaseException

exportNamedChemicalInteractions

public SigpathSubmission exportNamedChemicalInteractions(SigpathSubmission submission,
                                                         HashMap spidsToTempIDs,
                                                         String spid)
                                                  throws SigPathDatabaseException
If spid is null exports all named chemical interactions.

Throws:
SigPathDatabaseException

exportBySpid

public String exportBySpid(String spid)
                    throws SigPathDatabaseException,
                           IOException,
                           ValidationException,
                           MarshalException
Exports the SigPathEntity that that spid refers to.

Parameters:
spid - of the entity to export.
Returns:
Xml representation of the entity.
Throws:
SigPathDatabaseException
IOException
ValidationException
MarshalException

exportAll

public String exportAll(List list)
                 throws SigPathDatabaseException,
                        ValidationException,
                        MarshalException,
                        IOException
Exports everything in the list.

Parameters:
list - List of spids
Throws:
SigPathDatabaseException
ValidationException
MarshalException
IOException

getNumOfTempIDs

public int getNumOfTempIDs()

getIdrefActions

public List getIdrefActions()

exportDataSource

public void exportDataSource(SPDBManager dbm,
                             SigpathSubmission submission,
                             HashMap spidsToCastorInstances,
                             DataSource dataSource)
                      throws SigPathDatabaseException
Export SigPath instances to XML

Parameters:
submission - The submission where to store exported instances
spidsToCastorInstances - Id to castor instance map.
dataSource - Source of SigPathEntity instances.
Throws:
SigPathDatabaseException

exportAll

public String exportAll()
                 throws SigPathDatabaseException,
                        ValidationException,
                        MarshalException,
                        IOException
Exports everything.

Throws:
SigPathDatabaseException
ValidationException
MarshalException
IOException

collectModifiedChemicals

public static Vector collectModifiedChemicals()
                                       throws SigPathDatabaseException
Throws:
SigPathDatabaseException

isStandaloneOutput

public boolean isStandaloneOutput()
Should this model be exported standalone?

Returns:
true if the model should be exported so that it can be reimported in a fresh database.

setStandaloneOutput

public void setStandaloneOutput(boolean standaloneOutput)
Decide if the output should be standalone. Standalone outputs will contain all the information needed to reconstruct a model in a fresh database. In practice, when standalone output is set to true, the XML output will include molecules even if they are background information. The model will also include reactions and enzymatic reactions that it references. Standalone outputs are useful to generate standalone XML submissions for models. This comes handy when building regression tests for model export.

Parameters:
standaloneOutput - frue to generate standalone output. false (default) otherwise.

main

public static void main(String[] args)
                 throws IOException,
                        ValidationException,
                        MarshalException,
                        SigPathDatabaseException
Throws:
IOException
ValidationException
MarshalException
SigPathDatabaseException

SigPath

Copyright © 2002-2005 Institute for Computational Biomedicine, All Rights Reserved.