Changeset 4547


Ignore:
Timestamp:
Feb 28, 2014, 11:58:27 AM (9 years ago)
Author:
Fredrik Levander
Message:

Corrected formatting of peaks and added protein ids in msp library export.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/contrib/SpectrumLibraryExport/src/satoshi/LibraryExportPlugin.java

    r4546 r4547  
    358358      outCoreFile2.setName(coreFilename2);
    359359      fileNameAssigned2 = true;
     360      outCoreFile2.setMimeType("text/plain");
    360361      /*
    361362       * Save core file item before getting uploadstream
     
    590591      List<String> requestSpectraSEQ = new ArrayList<String>();
    591592      List<String> requestSpectraModification = new ArrayList<String>();
     593      List<String> requestSpectraProtein = new ArrayList<String>();
    592594      List<Float> requestSpectraEXP = new ArrayList<Float>();
    593595      List<List<String>> requestSpectraExternalID = new ArrayList<List<String>>();
     
    610612            .contains(phit.getSpectrumStringId())) {
    611613          requestSpectraStringID.add(phit.getSpectrumStringId());
     614          String externalID = phit.getExternalId();
    612615          String[] s1 = phit.getDescription().split(" ", 2);
    613616          if (s1.length == 2 && s1[1].contains(">"))
     
    622625                int pos = Integer.parseInt(s2.substring(s2.indexOf('@')+2,s2.indexOf('(')));
    623626                char newchar = s2.charAt(s2.indexOf('>')+1);
     627                externalID += " " + s2.substring(s2.indexOf('>')-1,s2.indexOf('>')+2) + "@" + pos;
    624628                if (pos>0) --pos;
    625629                String newSeq = s1[0].substring(0,pos)+newchar+s1[0].substring(pos+1);
     
    635639            s1[1]=newString;
    636640          }
    637          
     641          requestSpectraProtein.add(externalID);
    638642          requestSpectraSEQ.add(s1[0]); // sequence
    639643          if (s1.length == 2) {
     
    10321036          // output2.write(" Pep=Tryptic");
    10331037          // output2.write(" Fullname= ");
     1038          output2.write(" Protein=\""+requestSpectraProtein.get(i)+"\"");
    10341039          if (mods == null) {
    10351040            output2.write(" Mods=0 \n");
     
    10421047          // output2.write(" Mz_exact= ");
    10431048          // output2.write(" Mz_az= ");
    1044           // output2.write(" Protein= ");
     1049         
    10451050          // output2.write(" /gene= ");
    10461051          // output2.write(" /function= ");
     
    10891094          // print out masses and intensities
    10901095          for (int l = 0; l < mzs.size(); l++) {
    1091             output2.write(fourDecimals.format(mzs.get(l)) + "\t"
    1092                 + ints.get(l) + "\t\"");
    10931096            List<Ion<PeptideFragment>> matchedIons = PeptideUtil.matchingIons(ions, mzs.get(l), mzTolerance);
    10941097            if (!matchedIons.isEmpty())
Note: See TracChangeset for help on using the changeset viewer.