use of net.sf.mzmine.datamodel.RawDataFile in project mzmine2 by mzmine.
the class ProjectOpeningTask method loadRawDataFile.
private void loadRawDataFile(InputStream is, String fileID, String fileName) throws IOException, ParserConfigurationException, SAXException, InstantiationException, IllegalAccessException {
logger.info("Loading raw data file #" + fileID + ": " + fileName);
currentLoadedObjectName = fileName;
File scansFile = scanFilesIDMap.get(fileID);
if (scansFile == null) {
throw new IOException("Missing scans data for file ID " + fileID);
}
RawDataFile newFile = rawDataFileOpenHandler.readRawDataFile(is, scansFile);
newProject.addFile(newFile);
dataFilesIDMap.put(fileID, newFile);
}
use of net.sf.mzmine.datamodel.RawDataFile in project mzmine2 by mzmine.
the class PeakListOpenHandler_2_0 method initializePeakList.
/**
* Initializes the feature list
*/
private void initializePeakList() {
RawDataFile[] dataFiles = currentPeakListDataFiles.toArray(new RawDataFile[0]);
buildingPeakList = new SimplePeakList(peakListName, dataFiles);
for (int i = 0; i < appliedMethods.size(); i++) {
String methodName = appliedMethods.elementAt(i);
String methodParams = appliedMethodParameters.elementAt(i);
PeakListAppliedMethod pam = new SimplePeakListAppliedMethod(methodName, methodParams);
buildingPeakList.addDescriptionOfAppliedTask(pam);
}
buildingPeakList.setDateCreated(dateCreated);
}
use of net.sf.mzmine.datamodel.RawDataFile in project mzmine2 by mzmine.
the class RawDataFileOpenHandler_2_0 method readRawDataFile.
/**
* Create a new raw data file using the information from the XML raw data description file
*
* @param Name raw data file name
* @throws SAXException
* @throws ParserConfigurationException
*/
public RawDataFile readRawDataFile(InputStream is, File scansFile) throws IOException, ParserConfigurationException, SAXException {
storageFileOffset = 0;
charBuffer = new StringBuffer();
newRawDataFile = (RawDataFileImpl) MZmineCore.createNewFile(null);
newRawDataFile.openDataPointsFile(scansFile);
// Reads the XML file (raw data description)
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser saxParser = factory.newSAXParser();
saxParser.parse(is, this);
// Adds the raw data file to MZmine
RawDataFile rawDataFile = newRawDataFile.finishWriting();
return rawDataFile;
}
use of net.sf.mzmine.datamodel.RawDataFile in project mzmine2 by mzmine.
the class PeakListOpenHandler_2_3 method initializePeakList.
/**
* Initializes the feature list
*/
private void initializePeakList() {
RawDataFile[] dataFiles = currentPeakListDataFiles.toArray(new RawDataFile[0]);
buildingPeakList = new SimplePeakList(peakListName, dataFiles);
for (int i = 0; i < appliedMethods.size(); i++) {
String methodName = appliedMethods.elementAt(i);
String methodParams = appliedMethodParameters.elementAt(i);
PeakListAppliedMethod pam = new SimplePeakListAppliedMethod(methodName, methodParams);
buildingPeakList.addDescriptionOfAppliedTask(pam);
}
buildingPeakList.setDateCreated(dateCreated);
}
use of net.sf.mzmine.datamodel.RawDataFile in project mzmine2 by mzmine.
the class RawDataFileOpenHandler_2_3 method readRawDataFile.
/**
* Extract the scan file and copies it into the temporary folder. Create a new raw data file using
* the information from the XML raw data description file
*
* @param Name raw data file name
* @throws SAXException
* @throws ParserConfigurationException
*/
public RawDataFile readRawDataFile(InputStream is, File scansFile) throws IOException, ParserConfigurationException, SAXException {
storageFileOffset = 0;
charBuffer = new StringBuffer();
currentMassLists = new ArrayList<SimpleMassList>();
allMassLists = new ArrayList<SimpleMassList>();
newRawDataFile = (RawDataFileImpl) MZmineCore.createNewFile(null);
newRawDataFile.openDataPointsFile(scansFile);
// Reads the XML file (raw data description)
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser saxParser = factory.newSAXParser();
saxParser.parse(is, this);
// instead of being part of the data points file.
for (SimpleMassList ml : allMassLists) {
Scan s = ml.getScan();
s.addMassList(ml);
}
RawDataFile rawDataFile = newRawDataFile.finishWriting();
return rawDataFile;
}
Aggregations