Last update: 2011-06-23

org.proteios.io.mzdata
Class MzDataExporter

java.lang.Object
  extended by org.proteios.io.mzdata.MzDataExporter

public class MzDataExporter
extends Object

This class supports export of mzData files from Proteios. An mzData file contains information on a mass spectrometry experiment. Given a Proteios peakListSet, MzDataExporter fetches stored data related to this peakListSet and stores it in an mzData file. The mzData file is then validated against the XML Schema Definition file mzdata.xsd.

Version:
2.0
Author:
Olle
Last modified
$Date: 2006-10-31 14:06:37 +0100 (Tue, 31 Oct 2006) $

Constructor Summary
MzDataExporter()
          Default constructor.
MzDataExporter(SessionControl sc)
          Constructor that takes a SessionControl as parameter.
MzDataExporter(String xsdFilePath)
          Constructor that takes an xml schema definition as parameter.
MzDataExporter(String xsdFilePath, SessionControl sc)
          Constructor that takes an xml schema definition and a SessionControl as parameter.
 
Method Summary
 void enableDbControl()
          Make sure that DbControl is running.
 void enableDbControl(BasicItem item)
          Make sure that DbControl is running, and that the item is attached to it.
 void export(int id, String xmlFilePath)
          Exports mzData in Proteios to an mzData XML file.
 void export(PeakListSet peakListSetSource, File coreFile)
          Exports mzData in Proteios to mzData XML data in a core file.
 void export(PeakListSet peakListSetSource, OutputStream oStream)
          Exports mzData in Proteios to an OutputStream.
 void export(PeakListSet peakListSetSource, String xmlFilePath)
          Exports mzData in Proteios to an mzData XML file.
 ProgressReporter getProgressReporter()
          Get the ProgressReporter.
 String getXMLFilePath()
          Get mzData XML file path.
 String getXsdFilePath()
          Get XSD schema file to validate against.
 void processMzDataObjectGraph(PeakListSet peakListSet)
          Processes the mzData information stored in the PeakListSet by navigating the object graph, and write the data to an XML output stream.
 void setProgressReporter(ProgressReporter progress)
          Set the ProgressReporter.
 void setXMLFilePath(String xmlFilePath)
          Set mzData XML file path.
 void setXsdFilePath(String xsdFilePath)
          Set XSD schema file to validate against.
 boolean valid(String xmlFilePath)
          Validates mzData file against current mzData XSD file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MzDataExporter

public MzDataExporter()
Default constructor.


MzDataExporter

public MzDataExporter(SessionControl sc)
Constructor that takes a SessionControl as parameter.

Parameters:
sc - The SessionControl to use.

MzDataExporter

public MzDataExporter(String xsdFilePath)
Constructor that takes an xml schema definition as parameter.

Parameters:
xsdFilePath - The XML Schema Definition to use.

MzDataExporter

public MzDataExporter(String xsdFilePath,
                      SessionControl sc)
Constructor that takes an xml schema definition and a SessionControl as parameter.

Parameters:
xsdFilePath - The XML Schema Definition to use.
sc - The SessionControl to use.
Method Detail

getXsdFilePath

public String getXsdFilePath()
Get XSD schema file to validate against.

Returns:
xsdFilePath String with path for XSD schema file.

setXsdFilePath

public void setXsdFilePath(String xsdFilePath)
Set XSD schema file to validate against.

Parameters:
xsdFilePath - String with path for XSD schema file.

getXMLFilePath

public String getXMLFilePath()
Get mzData XML file path.

Returns:
xmlFilePath String with path for mzData XML file.

setXMLFilePath

public void setXMLFilePath(String xmlFilePath)
Set mzData XML file path.

Parameters:
xmlFilePath - String with path for mzData XML file.

getProgressReporter

public ProgressReporter getProgressReporter()
Get the ProgressReporter.

Returns:
The ProgressReporter object.

setProgressReporter

public void setProgressReporter(ProgressReporter progress)
Set the ProgressReporter.

Parameters:
progress - The ProgressReporter object to set.

valid

public boolean valid(String xmlFilePath)
              throws javax.xml.stream.XMLStreamException,
                     SAXException
Validates mzData file against current mzData XSD file.

Parameters:
xmlFilePath - String with path of XML file to validate.
Returns:
True if the file is valid, else false
Throws:
javax.xml.stream.XMLStreamException - If there is an XML Stream related error
SAXException

export

public void export(int id,
                   String xmlFilePath)
            throws javax.xml.stream.XMLStreamException,
                   SAXException
Exports mzData in Proteios to an mzData XML file.

Parameters:
id - int id of the PeakListSet to be exported to an mzData file.
xmlFilePath - String with path for exported mzData XML file.
Throws:
javax.xml.stream.XMLStreamException - If there is an XML Stream related error
SAXException

export

public void export(PeakListSet peakListSetSource,
                   String xmlFilePath)
            throws javax.xml.stream.XMLStreamException,
                   SAXException
Exports mzData in Proteios to an mzData XML file.

Parameters:
peakListSetSource - PeakListSet for mzData to be exported to mzData XML file.
xmlFilePath - String with path for exported mzData XML file.
Throws:
javax.xml.stream.XMLStreamException - If there is an XML Stream related error
SAXException

export

public void export(PeakListSet peakListSetSource,
                   File coreFile)
            throws javax.xml.stream.XMLStreamException,
                   SAXException
Exports mzData in Proteios to mzData XML data in a core file.

Parameters:
peakListSetSource - PeakListSet for mzData to be exported to mzData XML data.
coreFile - org.proteios.core.File Core file for exported mzData XML data.
Throws:
javax.xml.stream.XMLStreamException - If there is an XML Stream related error
SAXException

export

public void export(PeakListSet peakListSetSource,
                   OutputStream oStream)
            throws javax.xml.stream.XMLStreamException,
                   SAXException
Exports mzData in Proteios to an OutputStream.

Parameters:
peakListSetSource - PeakListSet for mzData to be exported to mzData XML file.
oStream - OutputSteam The OutputStream to write exported mzData XML data to.
Throws:
javax.xml.stream.XMLStreamException - If there is an XML Stream related error
SAXException

processMzDataObjectGraph

public void processMzDataObjectGraph(PeakListSet peakListSet)
                              throws javax.xml.stream.XMLStreamException
Processes the mzData information stored in the PeakListSet by navigating the object graph, and write the data to an XML output stream.

Parameters:
peakListSet - PeakListSet peakListSet used
Throws:
javax.xml.stream.XMLStreamException - If there is an XML Stream related error

enableDbControl

public void enableDbControl()
Make sure that DbControl is running.


enableDbControl

public void enableDbControl(BasicItem item)
Make sure that DbControl is running, and that the item is attached to it.

Parameters:
item - BasicItem item to reattach to DbController

Last update: 2011-06-23