Changes between Version 2 and Version 3 of CreatingAnnotion


Ignore:
Timestamp:
11/30/2016 04:22:02 PM (4 years ago)
Author:
dbrentw
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CreatingAnnotion

    v2 v3  
    12121) MS1 scan (example code)
    1313{{{
    14    Scan ms1scan = new Scan();
    15    ms1scan.setScanNo(1);
    16    ms1scan.setMsLevel(1);
    17    List<Peak> peakList = new ArrayList<>();
    18    Peak precursorPeak = new Peak();
    19    precursorPeak.setMz(528.2);
    20    precursorPeak.setIntensity(10000.0);
    21    precursorPeak.setIsPrecursor(true);
    22    precursorPeak.setId(1);
    23    precursorPeak.setPrecursorMz(528.2);
    24    peakList.add(precursorPeak);
    25    ms1scan.setPeaklist(peakList);
     14   Scan ms1scan = new Scan();  // create new Scan object
     15   ms1scan.setScanNo(1);  // set the scan number to 1
     16   ms1scan.setMsLevel(1); // set the MS level to 1
     17   List<Peak> peakList = new ArrayList<>();  // create a new peak list for the MS1 scan
     18   Peak precursorPeak = new Peak();  // create a new peak that will be a precursor peak (generates an MS/MS event)
     19   precursorPeak.setMz(528.2);  // set the m/z value of the peak (could be anything)
     20   precursorPeak.setIntensity(10000.0);  // set the intensity to something > 0
     21   precursorPeak.setIsPrecursor(true);  // identify the peak as a precursor peak
     22   precursorPeak.setId(1);  // the peak MUST have a unique ID
     23   precursorPeak.setPrecursorMz(528.18);  // when the ion in the MS1 is trapped for fragmentation, this is the m/z of the ions trapped...could slightly differ from the peak in the full MS1 scan
     24   peakList.add(precursorPeak);  // add the precursor peak to the peak list
     25   ms1scan.setPeaklist(peakList);  // set the peak list of the full MS1 scan to the newly created peak list
    2626}}}
    2727
    28282) MS2 scan (example code)
    2929{{{
    30    Scan ms2scan = new Scan();
    31    ms2scan.setScanNo(2);
    32    ms2scan.setMsLevel(2);
    33    ms2scan.setPrecursor(precursorPeak);
    34    peakList = new ArrayList<>();
    35    Peak fragPeak = new Peak(); // not sure if even needed
     30   Scan ms2scan = new Scan();  // create new Scan object
     31   ms2scan.setScanNo(2);  // set the scan number to 2
     32   ms2scan.setMsLevel(2);  // set the MS level to 2
     33   ms2scan.setPrecursor(precursorPeak);  // set the precursor variable to the precursorPeak created above. This ties the MS2 scan to the precursor peak in the parent MS1 scan
     34   List<Peak> peakList = new ArrayList<>();  // if you want to id fragment peaks, create a new peak list for the MS2 scan
     35   Peak fragPeak = new Peak(); // create a fragment peak
    3636   fragPeak.setMz(940.2);
    3737   fragPeak.setIntensity(5000.0);
     
    4040   peakList.add(fragPeak);
    4141   ms2scan.setPeaklist(peakList);
    42    ms2scan.setParentScan(1);
     42   ms2scan.setParentScan(1);   // set the parent scan of this MS/MS scan to the full MS scan
    4343}}}
    4444
    45453) Populate the MS1 object with subscans
    4646{{{
    47    List<Integer> subScans = new ArrayList<>();
    48    subScans.add(2);
    49    ms1scan.setSubScans(subScans);
     47   List<Integer> subScans = new ArrayList<>();   // create a list of integers to contain all scan numbers that were subscans of the full MS1 scan
     48   subScans.add(2);  // scan number 2 is the only subscan in this example, so add the number 2
     49   ms1scan.setSubScans(subScans);  // add the subscan list to the full MS1 scan
    5050}}}
    5151
    52524) Add the scans to the Hashmap datastructure
    5353{{{
    54    HashMap<Integer, Scan> testData = new HashMap<>();
    55    testData.put(1, ms1scan);
    56    testData.put(2, ms2scan);
     54   HashMap<Integer, Scan> testData = new HashMap<>(); // create the data structure to be used by Gelato
     55   testData.put(1, ms1scan); // put the ms1 scan in the Hashmap, key is scan number 1
     56   testData.put(2, ms2scan); // put the ms2 scan in the Hashmap, key is scan number 2
    5757}}}
     58