Changeset 4560


Ignore:
Timestamp:
Sep 1, 2014, 3:35:15 PM (8 years ago)
Author:
Fredrik Levander
Message:

Refs #821,#777. Added average m/z column.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugin/src/org/proteios/plugins/FeatureComparison.java

    r4539 r4560  
    138138        .println("File generated by Proteios SE " + proteiosVersion + " build " + proteiosBuildNumber + " (" + timestamp + ")");
    139139      writer.println("");
    140       writer.print("File\t\t\t\t");
     140      writer.print("File\t\t\t\t\t");
    141141      if (progress != null)
    142142      {
     
    151151      }
    152152      writer.println();
    153       writer.print("Sample name\t\t\t\t");
     153      writer.print("Sample name\t\t\t\t\t");
    154154      for (FileInfo fi : infoList)
    155155      {
     
    157157      }
    158158      writer.println();
    159       writer.print("Fraction\t\t\t\t");
     159      writer.print("Fraction\t\t\t\t\t");
    160160      for (FileInfo fi : infoList)
    161161      {
     
    163163      }
    164164      writer.println();
    165       writer.print("Replicate\t\t\t\t");
     165      writer.print("Replicate\t\t\t\t\t");
    166166      for (FileInfo fi : infoList)
    167167      {
     
    198198    float nValues = 0;
    199199    float rtSum = 0;
     200    double mzSum = 0d;
    200201    String currentSequence = "";
    201202    String currentAcc = "";
     
    203204    Float[] values = null;
    204205    writer
    205       .println("Cluster ID\tPeptide Sequence\tExternal IDs\tCharge\tAverage RT");
     206      .println("Cluster ID\tPeptide Sequence\tExternal IDs\tCharge\tAverage RT\tAverage m/z");
    206207    ItemResultIterator<Feature> fit = featureQuery.iterate(dc);
    207208    while (fit.hasNext())
     
    213214        {
    214215          treatRow(writer, values, currentCluster, currentSequence,
    215             currentAcc, currentCharge, rtSum, nValues, conflict);
     216            currentAcc, currentCharge, rtSum, mzSum, nValues, conflict);
    216217        }
    217218        values = new Float[entries];
     
    222223        currentCluster = feature.getClusterId();
    223224        rtSum = 0f;
     225        mzSum = 0d;
    224226        nValues = 0;
    225227        nEntries = 0;
     
    275277        currentCharge = feature.getChargeState();
    276278      rtSum += feature.getApexRetentionTimeInMinutes();
     279      mzSum += feature.getMassToChargeRatio();
    277280
    278281    }
    279282    if (nEntries >= 1) treatRow(writer, values, currentCluster, currentSequence, currentAcc,
    280       currentCharge, rtSum, nValues, conflict);
     283      currentCharge, rtSum, mzSum, nValues, conflict);
    281284    for (String key : valueMap.keySet())
    282285    {
     
    285288      printRow(writer, featureRow.values, featureRow.clusterIds,
    286289        parts[0], featureRow.acc, Integer.valueOf(parts[1]),
    287         featureRow.rtSum, featureRow.nValues, featureRow.conflict);
     290        featureRow.rtSum, featureRow.mzSum, featureRow.nValues, featureRow.conflict);
    288291    }
    289292  }
     
    292295  private void treatRow(PrintWriter writer, Float[] values,
    293296      Long currentCluster, String currentSequence, String currentAcc,
    294       int currentCharge, float rtSum, float nValues, boolean conflict)
     297      int currentCharge, float rtSum, double mzSum, float nValues, boolean conflict)
    295298  {
    296299    if (!currentSequence.equals(""))
     
    317320        featureRow.nValues += nValues;
    318321        featureRow.rtSum += rtSum;
     322        featureRow.mzSum += mzSum;
    319323        if (featureRow.acc.equals(""))
    320324          featureRow.acc = currentAcc;
     
    330334        featureRow.values = values;
    331335        featureRow.rtSum = rtSum;
     336        featureRow.mzSum = mzSum;
    332337        featureRow.nValues = nValues;
    333338        valueMap.put(key, featureRow);
     
    337342    {
    338343      printRow(writer, values, currentCluster.toString(),
    339         currentSequence, currentAcc, currentCharge, rtSum, nValues,
     344        currentSequence, currentAcc, currentCharge, rtSum, mzSum, nValues,
    340345        conflict);
    341346    }
     
    345350  private void printRow(PrintWriter writer, Float[] values,
    346351      String currentCluster, String currentSequence, String currentAcc,
    347       int currentCharge, float rtSum, float nValues, boolean conflict)
     352      int currentCharge, float rtSum, double mzSum, float nValues, boolean conflict)
    348353  {
    349354    if (values != null && (!currentSequence.equals("") || !identifiedOnly))
     
    360365          writer.print(",+");
    361366        writer
    362           .print("\t" + currentAcc + "\t" + currentCharge + "\t" + (rtSum / nValues));
     367          .print("\t" + currentAcc + "\t" + currentCharge + "\t" + (rtSum / nValues) + "\t" + (mzSum / nValues));
    363368        for (Float value : values)
    364369        {
     
    481486    String acc;
    482487    float rtSum;
     488    double mzSum;
    483489    float nValues;
    484490    boolean conflict;
Note: See TracChangeset for help on using the changeset viewer.