From: <spa...@us...> - 2007-11-27 02:24:47
|
Revision: 2582 http://sashimi.svn.sourceforge.net/sashimi/?rev=2582&view=rev Author: spacepod Date: 2007-11-26 18:24:17 -0800 (Mon, 26 Nov 2007) Log Message: ----------- merging in mzXML/mzML writer fixes from trunk rev 2581, for source code correctness only Revision Links: -------------- http://sashimi.svn.sourceforge.net/sashimi/?rev=2581&view=rev Modified Paths: -------------- branches/release_3-4-0/trans_proteomic_pipeline/src/mzXML/common/mzMLWriter.cpp branches/release_3-4-0/trans_proteomic_pipeline/src/mzXML/common/mzXMLWriter.cpp Modified: branches/release_3-4-0/trans_proteomic_pipeline/src/mzXML/common/mzMLWriter.cpp =================================================================== --- branches/release_3-4-0/trans_proteomic_pipeline/src/mzXML/common/mzMLWriter.cpp 2007-11-27 01:25:58 UTC (rev 2581) +++ branches/release_3-4-0/trans_proteomic_pipeline/src/mzXML/common/mzMLWriter.cpp 2007-11-27 02:24:17 UTC (rev 2582) @@ -95,17 +95,17 @@ open("indexedmzML"); - attr("xmlns", "http://psi.hupo.org/schema_revision/mzML_0.99.0"); + attr("xmlns", "http://psi.hupo.org/schema_revision/mzML_0.99.1"); attr("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); - attr("xsi:schemaLocation", "http://psi.hupo.org/schema_revision/mzML_0.99.0 mzML0.99.0_idx.xsd"); + attr("xsi:schemaLocation", "http://psi.hupo.org/schema_revision/mzML_0.99.1 mzML0.99.1_idx.xsd"); open("mzML"); - attr("xmlns", "http://psi.hupo.org/schema_revision/mzML_0.99.0"); + attr("xmlns", "http://psi.hupo.org/schema_revision/mzML_0.99.1"); attr("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); - attr("xsi:schemaLocation", "http://psi.hupo.org/schema_revision/mzML_0.99.0 mzML0.93.xsd"); + attr("xsi:schemaLocation", "http://psi.hupo.org/schema_revision/mzML_0.99.1 mzML0.99.1.xsd"); attr("accession", ""); attr("id", convertToIDString(inputFileName_, hostName_)); - attr("version", "0.99.0"); + attr("version", "0.99.1"); // ontology info open("cvList"); @@ -132,9 +132,7 @@ sourceFileType = "Xcalibur RAW file"; } else if (isWaters) { - // hack until OBO updated for Waters file type - sourceFileType = "Xcalibur RAW file"; - // sourceFileType = "Waters RAW directory content"; + sourceFileType = "MassLynx raw format"; } else { cerr << "unknown source file type" << endl; @@ -159,7 +157,7 @@ attr("id", toString(f+1)); attr("sourceFileName", inputFileNameList_[f]); attr("sourceFileLocation", convertToURI(inputFileNameList_[f], hostName_)); // check if this strips filename - cvParam("MS", "MS:1000563", sourceFileType, ""); + cvParam("MS", "MS:1000526", sourceFileType, ""); cvParam("MS", "MS:1000569", "SHA-1", inputFileSHA1List_[f]); close(); // sourceFile } @@ -327,10 +325,9 @@ paccession = "MS:1000541"; } else if (programName_ == "wolf") { - paccession = "MS:999999"; // waiting for OBO + paccession = "MS:1000538"; // waiting for OBO // TODO: fix when OBO adds wolf - programName_ = "ReAdW"; - paccession = "MS:1000541"; + programName_ = "Wolf"; } else { cerr << "unknown converter name " << programName_ << endl; @@ -397,6 +394,7 @@ attr("sampleRef", "1"); attr("startTimeStamp", instrumentInterface_->timeStamp_); open("sourceFileRefList"); + attr("count","1"); open("sourceFileRef"); attr("ref", "1"); close(); //sourceFileRef @@ -433,34 +431,9 @@ cvParam("MS", "MS:1000580", "MSn spectrum", ""); open("spectrumDescription"); - cvParam("MS", "MS:1000016", "scan time", - toString(curScan->retentionTimeInSec_)); - - if (curScan->polarity_ != POLARITY_UNDEF) { - if (curScan->polarity_ == POSITIVE) { - cvParam("MS", "MS:1000130", "positive scan", ""); - } - else { - // negative - cvParam("MS", "MS:1000129", "negative scan", toString(curScan->minObservedMZ_)); - } - } - if (curScan->isCentroided_) { cvParam("MS", "MS:1000127", "centroid mass spectrum", ""); } - - MSScanType scanType = curScan->scanType_; - if (scanType == SCAN_UNDEF) { - cerr << "unknown scan type: " << scanType << endl; - cerr << "please contact developer." << endl; - exit(-1); - } - else { - string scanDescr = toOBOText(scanType); - string scanAccession = toOBO(scanType); - cvParam("MS", scanAccession, scanDescr, ""); - } cvParam("MS", "MS:1000528", "lowest m/z value", toString(curScan->minObservedMZ_)); cvParam("MS", "MS:1000527", "highest m/z value", toString(curScan->maxObservedMZ_)); @@ -512,7 +485,31 @@ open("scan"); attr("instrumentRef", toString(instrumentInterface_->instrumentInfo_.instrumentModel_)); + cvParam("MS", "MS:1000016", "scan time", + toString(curScan->retentionTimeInSec_)); + + MSScanType scanType = curScan->scanType_; + if (scanType == SCAN_UNDEF) { + cerr << "unknown scan type: " << scanType << endl; + cerr << "please contact developer." << endl; + exit(-1); + } + else { + string scanDescr = toOBOText(scanType); + string scanAccession = toOBO(scanType); + cvParam("MS", scanAccession, scanDescr, ""); + } + if (curScan->polarity_ != POLARITY_UNDEF) { + if (curScan->polarity_ == POSITIVE) { + cvParam("MS", "MS:1000130", "positive scan", ""); + } + else { + // negative + cvParam("MS", "MS:1000129", "negative scan", toString(curScan->minObservedMZ_)); + } + } + // TODO: paramGroupRef here if (curScan->isThermo_) { Modified: branches/release_3-4-0/trans_proteomic_pipeline/src/mzXML/common/mzXMLWriter.cpp =================================================================== --- branches/release_3-4-0/trans_proteomic_pipeline/src/mzXML/common/mzXMLWriter.cpp 2007-11-27 01:25:58 UTC (rev 2581) +++ branches/release_3-4-0/trans_proteomic_pipeline/src/mzXML/common/mzXMLWriter.cpp 2007-11-27 02:24:17 UTC (rev 2582) @@ -134,13 +134,13 @@ toString(instrumentInterface_->instrumentInfo_.detector_)); close(); // msDetector - open("softwareType"); + open("software"); attr("type", "acquisition"); attr( "name", toString(instrumentInterface_->instrumentInfo_.acquisitionSoftware_)); attr("version", instrumentInterface_->instrumentInfo_.acquisitionSoftwareVersion_); - close(); // softwareType + close(); // software close(); // msInstrument @@ -314,9 +314,10 @@ delete curScan; } - if (instrumentInterface_->totalNumScans_>0) { - // close the last scan - close(); //scan + // close the last scan(s) + while (!lastMSLevel.empty()) { + close(); // scan + lastMSLevel.pop(); } close(); //msRun This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |