Search in sources :

Example 1 with PeptideScan

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;
}
Also used : SimpleDataPoint(net.sf.mzmine.datamodel.impl.SimpleDataPoint) StringTokenizer(java.util.StringTokenizer) PeptideScan(net.sf.mzmine.modules.peaklistmethods.identification.mascot.data.PeptideScan) Vector(java.util.Vector) DataPoint(net.sf.mzmine.datamodel.DataPoint) SimpleDataPoint(net.sf.mzmine.datamodel.impl.SimpleDataPoint)

Aggregations

StringTokenizer (java.util.StringTokenizer)1 Vector (java.util.Vector)1 DataPoint (net.sf.mzmine.datamodel.DataPoint)1 SimpleDataPoint (net.sf.mzmine.datamodel.impl.SimpleDataPoint)1 PeptideScan (net.sf.mzmine.modules.peaklistmethods.identification.mascot.data.PeptideScan)1