use of net.sf.mzmine.modules.peaklistmethods.identification.mascot.data.PeptideScan in project mzmine2 by mzmine.
the class MascotParserUtils method parseScanIons.
/**
* Parse the information of data points (MS/MS peaks) and generate a new PeptideScan
*
* @param queryNumber
* @param HashMap sectionMap with the data points info
* @param pepDataFile
* @return
*/
public static PeptideScan parseScanIons(int queryNumber, HashMap<?, ?> sectionMap, PeptideIdentityDataFile pepDataFile) {
String titleScan = (String) sectionMap.get("title");
titleScan = titleScan.replace("%2e", ",");
String[] tokens = titleScan.split(",");
String rawFileName = tokens[0];
int rawScanNumber = Integer.parseInt(tokens[1]);
PeptideScan scan = new PeptideScan(pepDataFile, rawFileName, queryNumber, rawScanNumber);
Vector<SimpleDataPoint> dataPoints = new Vector<SimpleDataPoint>();
double mass, intensity;
String ions = (String) sectionMap.get("Ions1");
StringTokenizer tokenizer = new StringTokenizer(ions, ",");
while (tokenizer.hasMoreTokens()) {
tokens = tokenizer.nextToken().split(":");
mass = Double.parseDouble(tokens[0]);
intensity = Double.parseDouble(tokens[1]);
dataPoints.add(new SimpleDataPoint(mass, intensity));
}
scan.setDataPoints(dataPoints.toArray(new SimpleDataPoint[0]));
return scan;
}
Aggregations