Search in sources :

Example 1 with PeptideIonSerie

use of net.sf.mzmine.modules.peaklistmethods.identification.mascot.data.PeptideIonSerie in project mzmine2 by mzmine.

the class MascotParserUtils method parseIonSeriesSignificance.

/*
   * ion series
   * 
   * [Mascot 2.2] 0 a 1 place holder 2 a++
   * 
   * 3 b 4 place holder 5 b++
   * 
   * 6 y 7 place holder 8 y++
   * 
   * 9 c 10 c++ 11 x 12 x++ 13 z 14 z++ 15 z+H 16 z+H++ 17 z+2H 18 z+2H++
   * 
   * 0 0 0 0 0 0 0 0 0 0 1 0 0 2 0 0 2 0 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
   */
public static PeptideIonSerie parseIonSeriesSignificance(String seriesIonString) {
    PeptideIonSerie peptideIonSeries = new PeptideIonSerie();
    IonSignificance significance = IonSignificance.NOT_Sign_NOT_Scoring;
    for (int i = 0; i < seriesIonString.length(); i++) {
        significance = IonSignificance.NOT_Sign_NOT_Scoring;
        switch(seriesIonString.charAt(i)) {
            case '1':
                significance = IonSignificance.NOT_Sign_NOT_Scoring;
                break;
            case '2':
                significance = IonSignificance.NOT_Sign_NOT_Scoring;
                break;
        }
        switch(i) {
            case // a-ion
            0:
                peptideIonSeries.addSerie(SerieIonType.A_SERIES, significance);
                break;
            case // a-double-ion
            2:
                peptideIonSeries.addSerie(SerieIonType.A_DOUBLE_SERIES, significance);
                break;
            case // b-ion
            3:
                peptideIonSeries.addSerie(SerieIonType.B_SERIES, significance);
                break;
            case // b-double-ion
            5:
                peptideIonSeries.addSerie(SerieIonType.B_DOUBLE_SERIES, significance);
                break;
            case // y-ion
            6:
                peptideIonSeries.addSerie(SerieIonType.Y_SERIES, significance);
                break;
            case // y-ion
            8:
                peptideIonSeries.addSerie(SerieIonType.Y_DOUBLE_SERIES, significance);
                break;
            case // c-ion
            9:
                peptideIonSeries.addSerie(SerieIonType.C_SERIES, significance);
                break;
            case // c-double-ion
            10:
                peptideIonSeries.addSerie(SerieIonType.C_DOUBLE_SERIES, significance);
                break;
            case // x-ion
            11:
                peptideIonSeries.addSerie(SerieIonType.X_SERIES, significance);
                break;
            case // x-double-ion
            12:
                peptideIonSeries.addSerie(SerieIonType.X_DOUBLE_SERIES, significance);
                break;
            case // z-ion
            13:
                peptideIonSeries.addSerie(SerieIonType.Z_SERIES, significance);
                break;
            case // z-double-ion
            14:
                peptideIonSeries.addSerie(SerieIonType.Z_DOUBLE_SERIES, significance);
                break;
            case // zh-ion
            15:
                peptideIonSeries.addSerie(SerieIonType.ZH_SERIES, significance);
                break;
            case // zh-double-ion
            16:
                peptideIonSeries.addSerie(SerieIonType.ZH_DOUBLE_SERIES, significance);
                break;
            case // zhh-ion
            17:
                peptideIonSeries.addSerie(SerieIonType.ZHH_SERIES, significance);
                break;
            case // zhh-double-ion
            18:
                peptideIonSeries.addSerie(SerieIonType.ZHH_DOUBLE_SERIES, significance);
                break;
            default:
                break;
        }
    }
    return peptideIonSeries;
}
Also used : PeptideIonSerie(net.sf.mzmine.modules.peaklistmethods.identification.mascot.data.PeptideIonSerie) IonSignificance(net.sf.mzmine.modules.peaklistmethods.identification.mascot.data.IonSignificance) DataPoint(net.sf.mzmine.datamodel.DataPoint) SimpleDataPoint(net.sf.mzmine.datamodel.impl.SimpleDataPoint)

Example 2 with PeptideIonSerie

use of net.sf.mzmine.modules.peaklistmethods.identification.mascot.data.PeptideIonSerie in project mzmine2 by mzmine.

the class MascotParserUtils method parsePeptideInfo.

/*
   * String "info" is divided into three sections by ";", which the first one is peptide, second
   * protein and third is peptide terminals.
   * 
   * Peptide section must have 11 elements: missed cleavages, peptide mass, delta mass, number of
   * matched ions, aa sequence, peaks used from ion 1, variable modifications (binary code), ion
   * score, ion series, peaks used from ions2, peaks used from ion 3
   * 
   * Protein section must have 5 elements: accesion name, frame number, start, stop and multiplicity
   * 
   * Peptide terminal section must have 2 elements; left aa, right aa of the sequence
   * 
   * Example=' 1,743.428955,0.000893,5,KGAAQLR,25,000001000,27.19,0002001000000000000 ,0,0;
   * "SPBC839.04":0:23:29:1,"SPBC2F12.07c":0:23:29:1,"SPAC1F7.13c":0:23:29:1; R,T:R,T:R,T '
   */
public static Peptide[] parsePeptideInfo(int queryNumber, String info, double mass, double massExpected, int precursorCharge, PeptideIdentityDataFile pepDataFile, double identityThreshold, boolean isTopScore) {
    String[] tokens = info.split(";");
    String peptideSection = tokens[0];
    String proteinSection = tokens[1];
    String terminalSection = tokens[2];
    // Terminals
    tokens = terminalSection.split(":");
    String[] peptideInfos = new String[tokens.length];
    for (int i = 0; i < tokens.length; i++) {
        peptideInfos[i] = peptideSection + "," + tokens[i];
    }
    // Proteins
    tokens = proteinSection.split(",");
    String[] proteinInfos = new String[tokens.length];
    for (int i = 0; i < tokens.length; i++) {
        proteinInfos[i] = tokens[i];
    }
    if (proteinInfos.length != peptideInfos.length)
        return null;
    Vector<Peptide> peptides = new Vector<Peptide>();
    // Peptide
    for (int pepIndex = 0; pepIndex < peptideInfos.length; pepIndex++) {
        tokens = peptideInfos[pepIndex].split(",");
        int missedCleavages = Integer.parseInt(tokens[0]);
        double precursorMass = Double.parseDouble(tokens[1]);
        double deltaMass = Double.parseDouble(tokens[2]);
        String sequence = tokens[11] + tokens[4] + tokens[12];
        String modSeries = tokens[6];
        double ionScore = Double.parseDouble(tokens[7]);
        if (ionScore >= identityThreshold)
            continue;
        Peptide peptide = new Peptide(queryNumber, sequence, ionScore, mass, massExpected, precursorCharge, precursorMass, deltaMass, missedCleavages, null, "Mascot", isTopScore);
        HashMap<Integer, ModificationPeptide> modifications = new HashMap<Integer, ModificationPeptide>();
        ModificationPeptide[] searchedMods = pepDataFile.getSearchedModifications();
        // site.
        for (int pos = 0; pos < modSeries.length(); pos++) {
            if (modSeries.charAt(pos) == '1') {
                char aa = sequence.charAt(pos);
                for (int index = 0; index < searchedMods.length; index++) {
                    if (searchedMods[index].getSite() == aa) {
                        modifications.put(pos, searchedMods[index]);
                    }
                }
            }
        }
        peptide.setModifications(modifications);
        // Ion serie
        PeptideIonSerie peptideIonSerie = parseIonSeriesSignificance(tokens[8]);
        peptide.setIonSeries(peptideIonSerie);
        // Calculate fragmentation
        PeptideFragmentation fragmentation = new PeptideFragmentation(peptide, pepDataFile);
        peptide.setFragmentation(fragmentation);
        // Protein info
        ProteinSection section;
        tokens = proteinInfos[pepIndex].split(":");
        String sysname = tokens[0].replace("\"", "");
        Protein protein = pepDataFile.getProtein(sysname);
        if (protein == null)
            protein = new Protein(sysname);
        int startRegion = Integer.parseInt(tokens[2]);
        int stopRegion = Integer.parseInt(tokens[3]);
        int multiplicity = Integer.parseInt(tokens[4]);
        section = new ProteinSection(startRegion, stopRegion, multiplicity);
        // Link peptide and protein
        peptide.setProtein(protein);
        protein.addPeptide(peptide, section, isTopScore);
        peptides.add(peptide);
    }
    return peptides.toArray(new Peptide[0]);
}
Also used : HashMap(java.util.HashMap) PeptideIonSerie(net.sf.mzmine.modules.peaklistmethods.identification.mascot.data.PeptideIonSerie) ProteinSection(net.sf.mzmine.modules.peaklistmethods.identification.mascot.data.ProteinSection) DataPoint(net.sf.mzmine.datamodel.DataPoint) SimpleDataPoint(net.sf.mzmine.datamodel.impl.SimpleDataPoint) Protein(net.sf.mzmine.modules.peaklistmethods.identification.mascot.data.Protein) Peptide(net.sf.mzmine.modules.peaklistmethods.identification.mascot.data.Peptide) ModificationPeptide(net.sf.mzmine.modules.peaklistmethods.identification.mascot.data.ModificationPeptide) Vector(java.util.Vector) ModificationPeptide(net.sf.mzmine.modules.peaklistmethods.identification.mascot.data.ModificationPeptide) PeptideFragmentation(net.sf.mzmine.modules.peaklistmethods.identification.mascot.data.PeptideFragmentation)

Aggregations

DataPoint (net.sf.mzmine.datamodel.DataPoint)2 SimpleDataPoint (net.sf.mzmine.datamodel.impl.SimpleDataPoint)2 PeptideIonSerie (net.sf.mzmine.modules.peaklistmethods.identification.mascot.data.PeptideIonSerie)2 HashMap (java.util.HashMap)1 Vector (java.util.Vector)1 IonSignificance (net.sf.mzmine.modules.peaklistmethods.identification.mascot.data.IonSignificance)1 ModificationPeptide (net.sf.mzmine.modules.peaklistmethods.identification.mascot.data.ModificationPeptide)1 Peptide (net.sf.mzmine.modules.peaklistmethods.identification.mascot.data.Peptide)1 PeptideFragmentation (net.sf.mzmine.modules.peaklistmethods.identification.mascot.data.PeptideFragmentation)1 Protein (net.sf.mzmine.modules.peaklistmethods.identification.mascot.data.Protein)1 ProteinSection (net.sf.mzmine.modules.peaklistmethods.identification.mascot.data.ProteinSection)1