Changeset 4281


Ignore:
Timestamp:
Feb 8, 2012, 12:51:13 PM (12 years ago)
Author:
Fredrik Levander
Message:

Refs #777. First version of report for all features in project.

Location:
trunk
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/api/core/conf/common-queries.xml

    r4280 r4281  
    243243  </query>
    244244
     245  <query id="GET_HIT_FOR_FEATURE_MSFILE_FOR_PROJECT" type="HQL">
     246    <sql>
     247      SELECT h
     248      FROM HitData h
     249      WHERE h.feature.msFile = :msFile AND h.project = :project
     250    </sql>
     251    <description>
     252      Load all hits which have features with the given msFile in the Feature table for a project
     253    </description>
     254  </query>
     255
    245256  <query id="GET_UNIQUE_MSFILES_IN_FEATURES_FOR_PROJECT" type="HQL">
    246257    <sql>
  • trunk/api/core/src/org/proteios/core/Hit.java

    r4269 r4281  
    2828package org.proteios.core;
    2929
    30 import org.proteios.core.data.FeatureData;
    3130import org.proteios.core.data.HitData;
    3231import org.proteios.core.data.ProjectData;
     
    3534
    3635import java.util.Date;
     36import java.util.Iterator;
    3737import java.util.List;
    3838
     
    112112
    113113  @SuppressWarnings("unchecked")
    114   public static List<Integer> getUniqueCharges(Project project,
    115       DbControl dc)
     114  public static List<Integer> getUniqueCharges(Project project, DbControl dc)
    116115  {
    117116    org.hibernate.Query query = HibernateUtil.getPredefinedQuery(dc
    118       .getHibernateSession(),
    119       "GET_UNIQUE_CHARGES_IN_HITS_FOR_PROJECT");
     117      .getHibernateSession(), "GET_UNIQUE_CHARGES_IN_HITS_FOR_PROJECT");
    120118    query.setEntity("project", project.getData());
    121119    return query.list();
     
    124122
    125123  @SuppressWarnings("unchecked")
    126   public static List<String> getUniqueExternalIds(Project project, DbControl dc)
     124  public static List<String> getUniqueExternalIds(Project project,
     125      DbControl dc)
    127126  {
    128127    org.hibernate.Query query = HibernateUtil.getPredefinedQuery(dc
     
    134133
    135134
     135  @SuppressWarnings("unchecked")
     136  public static Hit getHitForFeatureMsFile(Project project, File msFile,
     137      DbControl dc)
     138  {
     139    org.hibernate.Query query = HibernateUtil.getPredefinedQuery(dc
     140      .getHibernateSession(), "GET_HIT_FOR_FEATURE_MSFILE_FOR_PROJECT");
     141    query.setEntity("project", project.getData());
     142    query.setEntity("msFile", msFile.getData());
     143    Iterator<HitData> hitIt = query.iterate();
     144    if (hitIt.hasNext())
     145    {
     146      HitData data = hitIt.next();
     147      return new Hit(data);
     148    }
     149    return null;
     150  }
     151
     152
    136153  public String getGelExternalId()
    137154  {
     
    269286
    270287  /**
    271    * The maximum length of the replicate ID that can be stored in the database.
     288   * The maximum length of the replicate ID that can be stored in the
     289   * database.
    272290   *
    273291   * @see #setReplicateId(String)
     
    771789  }
    772790
     791
    773792  /**
    774793   * Best matching feature, source for precursor quantity
     
    776795  public void setFeature(Feature feature)
    777796  {
    778     if (feature!=null)
     797    if (feature != null)
    779798    {
    780799      getData().setFeature(feature.getData());
     
    785804    }
    786805  }
    787  
     806
    788807}
  • trunk/client/servlet/src/content/about.html

    r4247 r4281  
    1414  Fredrik Levander<br>
    1515  Olle M&aring;nsson<br>
     16  Marianne Sandin<br>
    1617  <span style="color: #777">Gregory Vincic(inactive) Lead developer until 2011-01-01</span><br>
    1718  <br>
  • trunk/plugin/src/org/proteios/plugins/HitsComparisonQuantitativeReportPlugin.java

    r4265 r4281  
    617617        //
    618618        // Get hit selection 1 sequence list
    619         //values = (List<?>) job.getValues("hitSelection1Sequence");
    620         //List<String> hitSelection1SequenceList = pruneStringList(values);
    621         List<String> hitSelection1SequenceList = Hit.getUniquePeptideSequences(hitSelection1Project, dc);
     619        // values = (List<?>) job.getValues("hitSelection1Sequence");
     620        // List<String> hitSelection1SequenceList =
     621        // pruneStringList(values);
     622        List<String> hitSelection1SequenceList = Hit
     623          .getUniquePeptideSequences(hitSelection1Project, dc);
    622624        hitSelection1SequenceList = pruneStringList(hitSelection1SequenceList);
    623625        log
     
    625627        //
    626628        // Get hit selection 1 charge list
    627         //values = (List<?>) job.getValues("hitSelection1Charge");
    628         //List<Integer> hitSelection1ChargeList = pruneIntegerList(values);
    629         List<Integer> hitSelection1ChargeList = Hit.getUniqueCharges(hitSelection1Project, dc);
     629        // values = (List<?>) job.getValues("hitSelection1Charge");
     630        // List<Integer> hitSelection1ChargeList =
     631        // pruneIntegerList(values);
     632        List<Integer> hitSelection1ChargeList = Hit.getUniqueCharges(
     633          hitSelection1Project, dc);
    630634        hitSelection1ChargeList = pruneIntegerList(hitSelection1ChargeList);
    631635        log
     
    633637        //
    634638        // Get hit selection 1 external id list
    635         //values = (List<?>) job.getValues("hitSelection1ExternalId");
    636         //List<String> hitSelection1ExternalIdList = pruneStringList(values);
    637         List<String> hitSelection1ExternalIdList = Hit.getUniqueExternalIds(hitSelection1Project, dc);
     639        // values = (List<?>) job.getValues("hitSelection1ExternalId");
     640        // List<String> hitSelection1ExternalIdList =
     641        // pruneStringList(values);
     642        List<String> hitSelection1ExternalIdList = Hit
     643          .getUniqueExternalIds(hitSelection1Project, dc);
    638644        hitSelection1ExternalIdList = pruneStringList(hitSelection1ExternalIdList);
    639645        log
     
    684690        //
    685691        // Get hit selection 2 sequence list
    686         //values = (List<?>) job.getValues("hitSelection2Sequence");
    687         //List<String> hitSelection2SequenceList = pruneStringList(values);
    688         List<String> hitSelection2SequenceList = Hit.getUniquePeptideSequences(hitSelection2Project, dc);
     692        // values = (List<?>) job.getValues("hitSelection2Sequence");
     693        // List<String> hitSelection2SequenceList =
     694        // pruneStringList(values);
     695        List<String> hitSelection2SequenceList = Hit
     696          .getUniquePeptideSequences(hitSelection2Project, dc);
    689697        hitSelection2SequenceList = pruneStringList(hitSelection2SequenceList);
    690698        log
     
    692700        //
    693701        // Get hit selection 2 charge list
    694         //values = (List<?>) job.getValues("hitSelection2Charge");
    695         //List<Integer> hitSelection2ChargeList = pruneIntegerList(values);
    696         List<Integer> hitSelection2ChargeList = Hit.getUniqueCharges(hitSelection2Project, dc);
     702        // values = (List<?>) job.getValues("hitSelection2Charge");
     703        // List<Integer> hitSelection2ChargeList =
     704        // pruneIntegerList(values);
     705        List<Integer> hitSelection2ChargeList = Hit.getUniqueCharges(
     706          hitSelection2Project, dc);
    697707        hitSelection2ChargeList = pruneIntegerList(hitSelection2ChargeList);
    698708        log
     
    700710        //
    701711        // Get hit selection 2 external id list
    702         //values = (List<?>) job.getValues("hitSelection2ExternalId");
    703         //List<String> hitSelection2ExternalIdList = pruneStringList(values);
    704         List<String> hitSelection2ExternalIdList = Hit.getUniqueExternalIds(hitSelection2Project, dc);
     712        // values = (List<?>) job.getValues("hitSelection2ExternalId");
     713        // List<String> hitSelection2ExternalIdList =
     714        // pruneStringList(values);
     715        List<String> hitSelection2ExternalIdList = Hit
     716          .getUniqueExternalIds(hitSelection2Project, dc);
    705717        hitSelection2ExternalIdList = pruneStringList(hitSelection2ExternalIdList);
    706718        log
     
    717729        //
    718730        // Get quantityVariable (precursorQuantity/totalIntensity)
    719         String quantityVariable = (String) job.getValue("quantityVariable");
     731        String quantityVariable = (String) job
     732          .getValue("quantityVariable");
    720733        log.debug("quantityVariable = \"" + quantityVariable + "\"");
    721734        //
     
    11241137      log.debug("hitSelection2ExternalIdList = " + hcd
    11251138        .getHitSelection2ExternalIdList());
    1126       log.debug("quantitativeComparison = " + hcd.isQuantitativeComparison());
     1139      log.debug("quantitativeComparison = " + hcd
     1140        .isQuantitativeComparison());
    11271141      log.debug("comparisonType = \"" + hcd.getComparisonType() + "\"");
    11281142      log.debug("project = " + hcd.getProject());
    11291143      log.debug("comparisonMode = \"" + hcd.getComparisonMode() + "\"");
    1130       log.debug("quantityVariable = \"" + hcd.getQuantityVariable() + "\"");
     1144      log
     1145        .debug("quantityVariable = \"" + hcd.getQuantityVariable() + "\"");
    11311146      log.debug("quantityEntry = \"" + hcd.getQuantityEntry() + "\"");
    11321147      log.debug("ignoreFdrCutoff = " + hcd.isIgnoreFdrCutoff());
     
    12231238        .println("Hit selection 1 FDR upper cutoff = " + hitSelection1FdrCutoff);
    12241239      /*
    1225       writer
    1226         .println("Hit selection 1 Sequence list = " + hitSelection1SequenceList);
    1227       writer
    1228         .println("Hit selection 1 Charge list = " + hitSelection1ChargeList);
    1229       writer
    1230         .println("Hit selection 1 External id list = " + hitSelection1ExternalIdList);
    1231       */
     1240       * writer .println("Hit selection 1 Sequence list = " +
     1241       * hitSelection1SequenceList); writer
     1242       * .println("Hit selection 1 Charge list = " +
     1243       * hitSelection1ChargeList); writer
     1244       * .println("Hit selection 1 External id list = " +
     1245       * hitSelection1ExternalIdList);
     1246       */
    12321247      writer.println("");
    12331248      writer
     
    12431258        .println("Hit selection 2 FDR upper cutoff = " + hitSelection2FdrCutoff);
    12441259      /*
    1245       writer
    1246         .println("Hit selection 2 Sequence list = " + hitSelection2SequenceList);
    1247       writer
    1248         .println("Hit selection 2 Charge list = " + hitSelection2ChargeList);
    1249       writer
    1250         .println("Hit selection 2 External id list = " + hitSelection2ExternalIdList);
    1251       */
     1260       * writer .println("Hit selection 2 Sequence list = " +
     1261       * hitSelection2SequenceList); writer
     1262       * .println("Hit selection 2 Charge list = " +
     1263       * hitSelection2ChargeList); writer
     1264       * .println("Hit selection 2 External id list = " +
     1265       * hitSelection2ExternalIdList);
     1266       */
    12521267      writer.println("");
    12531268      writer
     
    12831298          hitSelection2FdrCutoff = null;
    12841299        }
    1285         // Reset peptide comparison only parameters if not peptide comparison
     1300        // Reset peptide comparison only parameters if not peptide
     1301        // comparison
    12861302        modificationsIncluded = false;
    12871303      }
    12881304      else
    12891305      {
    1290         // Reset protein comparison only parameters if not protein comparison
     1306        // Reset protein comparison only parameters if not protein
     1307        // comparison
    12911308        ignoreFdrCutoff = false;
    12921309        scoreType = null;
     
    13131330        .size());
    13141331      //
    1315       // Combine sequence lists and charge lists into one list of each type
     1332      // Combine sequence lists and charge lists into one list of each
     1333      // type
    13161334      List<String> sequenceList = new ArrayList<String>();
    1317       for (int i=0; i < hitSelection1SequenceList.size(); i++)
     1335      for (int i = 0; i < hitSelection1SequenceList.size(); i++)
    13181336      {
    13191337        String sequence = hitSelection1SequenceList.get(i);
    1320         String compareSequence = pruneCompareString(sequence, comparisonType, modificationsIncluded);
    1321         if (compareSequence != null && !sequenceList.contains(compareSequence))
     1338        String compareSequence = pruneCompareString(sequence,
     1339          comparisonType, modificationsIncluded);
     1340        if (compareSequence != null && !sequenceList
     1341          .contains(compareSequence))
    13221342        {
    13231343          sequenceList.add(compareSequence);
    13241344        }
    13251345      }
    1326       for (int i=0; i < hitSelection2SequenceList.size(); i++)
     1346      for (int i = 0; i < hitSelection2SequenceList.size(); i++)
    13271347      {
    13281348        String sequence = hitSelection2SequenceList.get(i);
    1329         String compareSequence = pruneCompareString(sequence, comparisonType, modificationsIncluded);
    1330         if (compareSequence != null && !sequenceList.contains(compareSequence))
     1349        String compareSequence = pruneCompareString(sequence,
     1350          comparisonType, modificationsIncluded);
     1351        if (compareSequence != null && !sequenceList
     1352          .contains(compareSequence))
    13311353        {
    13321354          sequenceList.add(compareSequence);
     
    13381360      //
    13391361      List<Integer> chargeList = new ArrayList<Integer>();
    1340       for (int i=0; i < hitSelection1ChargeList.size(); i++)
     1362      for (int i = 0; i < hitSelection1ChargeList.size(); i++)
    13411363      {
    13421364        Integer charge = hitSelection1ChargeList.get(i);
     
    13461368        }
    13471369      }
    1348       for (int i=0; i < hitSelection2ChargeList.size(); i++)
     1370      for (int i = 0; i < hitSelection2ChargeList.size(); i++)
    13491371      {
    13501372        Integer charge = hitSelection2ChargeList.get(i);
     
    13601382      // Combine external id lists into one list
    13611383      List<String> externalIdList = new ArrayList<String>();
    1362       for (int i=0; i < hitSelection1ExternalIdList.size(); i++)
     1384      for (int i = 0; i < hitSelection1ExternalIdList.size(); i++)
    13631385      {
    13641386        String externalId = hitSelection1ExternalIdList.get(i);
     
    13681390        }
    13691391      }
    1370       for (int i=0; i < hitSelection2ExternalIdList.size(); i++)
     1392      for (int i = 0; i < hitSelection2ExternalIdList.size(); i++)
    13711393      {
    13721394        String externalId = hitSelection2ExternalIdList.get(i);
     
    13871409      if (comparisonType.equals("peptide"))
    13881410      {
    1389         writer.println("Hit selection 1 sequence list size (including modifications) = " + hitSelection1SequenceList.size());
    1390         writer.println("Hit selection 2 sequence list size (including modifications) = " + hitSelection2SequenceList.size());
    1391         writer.println("Combined sequence list size                                  = " + sequenceList.size());
    1392         writer.println("Hit selection 1 charge list size = " + hitSelection1ChargeList.size());
    1393         writer.println("Hit selection 2 charge list size = " + hitSelection2ChargeList.size());
    1394         writer.println("Combined charge list size        = " + chargeList.size());
     1411        writer
     1412          .println("Hit selection 1 sequence list size (including modifications) = " + hitSelection1SequenceList
     1413            .size());
     1414        writer
     1415          .println("Hit selection 2 sequence list size (including modifications) = " + hitSelection2SequenceList
     1416            .size());
     1417        writer
     1418          .println("Combined sequence list size                                  = " + sequenceList
     1419            .size());
     1420        writer
     1421          .println("Hit selection 1 charge list size = " + hitSelection1ChargeList
     1422            .size());
     1423        writer
     1424          .println("Hit selection 2 charge list size = " + hitSelection2ChargeList
     1425            .size());
     1426        writer
     1427          .println("Combined charge list size        = " + chargeList
     1428            .size());
    13951429      }
    13961430      else if (comparisonType.equals("protein"))
    13971431      {
    1398         writer.println("Hit selection 1 external id list size = " + hitSelection1ExternalIdList.size());
    1399         writer.println("Hit selection 2 external id list size = " + hitSelection2ExternalIdList.size());
    1400         writer.println("Combined external id list size        = " + externalIdList.size());
    1401       }
    1402       writer.println("Hit selection 1 hit list size = " + hitSelection1HitList.size());
    1403       writer.println("Hit selection 2 hit list size = " + hitSelection2HitList.size());
     1432        writer
     1433          .println("Hit selection 1 external id list size = " + hitSelection1ExternalIdList
     1434            .size());
     1435        writer
     1436          .println("Hit selection 2 external id list size = " + hitSelection2ExternalIdList
     1437            .size());
     1438        writer
     1439          .println("Combined external id list size        = " + externalIdList
     1440            .size());
     1441      }
     1442      writer
     1443        .println("Hit selection 1 hit list size = " + hitSelection1HitList
     1444          .size());
     1445      writer
     1446        .println("Hit selection 2 hit list size = " + hitSelection2HitList
     1447          .size());
    14041448      writer.println("");
    1405       writer.println("Prefix for local sample id for hit selection 1 = HS1:");
    1406       writer.println("Prefix for local sample id for hit selection 2 = HS2:");
     1449      writer
     1450        .println("Prefix for local sample id for hit selection 1 = HS1:");
     1451      writer
     1452        .println("Prefix for local sample id for hit selection 2 = HS2:");
    14071453      writer.println("");
    14081454      //
     
    14101456      //
    14111457      String header = fetchTabDelimitedHitTableHeaderForQuantitativeReport(
    1412         comparisonType,
    1413         hitSelection1LocalSampleIdList, hitSelection2LocalSampleIdList);
     1458        comparisonType, hitSelection1LocalSampleIdList,
     1459        hitSelection2LocalSampleIdList);
    14141460      writer.println(header);
    14151461      //
     
    14181464      if (comparisonType.equals("peptide"))
    14191465      {
    1420        
    1421         createQuantitativeReportPeptideTable(
    1422           writer,
    1423           sequenceList, chargeList,
    1424           modificationsIncluded,
     1466
     1467        createQuantitativeReportPeptideTable(writer, sequenceList,
     1468          chargeList, modificationsIncluded, hitSelection1HitList,
     1469          hitSelection2HitList, quantityVariable, quantityEntry,
     1470          hitSelection1LocalSampleIdList,
     1471          hitSelection2LocalSampleIdList);
     1472      }
     1473      else if (comparisonType.equals("protein"))
     1474      {
     1475
     1476        createQuantitativeReportProteinTable(writer, externalIdList,
    14251477          hitSelection1HitList, hitSelection2HitList,
    14261478          quantityVariable, quantityEntry,
     
    14281480          hitSelection2LocalSampleIdList);
    14291481      }
    1430       else if (comparisonType.equals("protein"))
    1431       {
    1432        
    1433         createQuantitativeReportProteinTable(
    1434           writer,
    1435           externalIdList,
    1436           hitSelection1HitList, hitSelection2HitList,
    1437           quantityVariable, quantityEntry,
    1438           hitSelection1LocalSampleIdList,
    1439           hitSelection2LocalSampleIdList);
    1440       }
    14411482      //
    14421483      // Close PrintWriter
     
    14511492
    14521493
    1453  
    1454   private void createQuantitativeReportPeptideTable(
    1455       PrintWriter writer,
     1494  private void createQuantitativeReportPeptideTable(PrintWriter writer,
    14561495      List<String> sequenceList, List<Integer> chargeList,
    1457       Boolean modificationsIncluded,
    1458       List<Hit> hitSelection1HitList, List<Hit> hitSelection2HitList,
    1459       String quantityVariable, String quantityEntry,
    1460       List<String> hitSelection1LocalSampleIdList,
     1496      Boolean modificationsIncluded, List<Hit> hitSelection1HitList,
     1497      List<Hit> hitSelection2HitList, String quantityVariable,
     1498      String quantityEntry, List<String> hitSelection1LocalSampleIdList,
    14611499      List<String> hitSelection2LocalSampleIdList)
    14621500  {
     
    14661504    boolean gelBasedComparison = false;
    14671505    String comparisonType = new String("peptide");
    1468     for (int i=0; i < sequenceList.size(); i++)
     1506    for (int i = 0; i < sequenceList.size(); i++)
    14691507    {
    14701508      String sequence = sequenceList.get(i);
    1471       String compareSequence = pruneCompareString(sequence, comparisonType, modificationsIncluded);
    1472       //log.debug("sequenceList: compareSequence = \"" + compareSequence + "\"");
    1473       for (Integer charge: chargeList)
    1474       {
    1475         //log.debug("   chargeList: charge = " + charge);
    1476         // Collect hits with current local sample id and charge
     1509      String compareSequence = pruneCompareString(sequence,
     1510        comparisonType, modificationsIncluded);
     1511      // log.debug("sequenceList: compareSequence = \"" + compareSequence
     1512      // + "\"");
     1513      for (Integer charge : chargeList)
     1514      {
     1515        // log.debug("   chargeList: charge = " + charge);
     1516        // Collect hits with current local sample id and charge
    14771517        List<Hit> hitList = new ArrayList<Hit>();
    1478         for (Hit hit: hitSelection1HitList)
    1479         {
    1480           String hitSequence = fetchCompareString(hit, gelBasedComparison, comparisonType, modificationsIncluded);
     1518        for (Hit hit : hitSelection1HitList)
     1519        {
     1520          String hitSequence = fetchCompareString(hit,
     1521            gelBasedComparison, comparisonType,
     1522            modificationsIncluded);
    14811523          if (hitSequence.equals(compareSequence))
    14821524          {
    1483             //log.debug("      hitSelection1HitList: compareSequence = \"" + compareSequence + "\" hitSequence = \"" + hitSequence + "\" hitCharge = " + hit.getCharge());
     1525            // log.debug("      hitSelection1HitList: compareSequence = \""
     1526            // + compareSequence + "\" hitSequence = \"" +
     1527            // hitSequence + "\" hitCharge = " + hit.getCharge());
    14841528            // Check if charge is selected
    1485             if (hit.getCharge() != null && hit.getCharge().equals(charge))
     1529            if (hit.getCharge() != null && hit.getCharge().equals(
     1530              charge))
    14861531            {
    14871532              if (!hitList.contains(hit))
     
    14921537          }
    14931538        }
    1494         for (Hit hit: hitSelection2HitList)
    1495         {
    1496           String hitSequence = fetchCompareString(hit, gelBasedComparison, comparisonType, modificationsIncluded);
     1539        for (Hit hit : hitSelection2HitList)
     1540        {
     1541          String hitSequence = fetchCompareString(hit,
     1542            gelBasedComparison, comparisonType,
     1543            modificationsIncluded);
    14971544          if (hitSequence.equals(compareSequence))
    14981545          {
    1499             //log.debug("      hitSelection2HitList: compareSequence = \"" + compareSequence + "\" hitSequence = \"" + hitSequence + "\" hitCharge = " + hit.getCharge());
     1546            // log.debug("      hitSelection2HitList: compareSequence = \""
     1547            // + compareSequence + "\" hitSequence = \"" +
     1548            // hitSequence + "\" hitCharge = " + hit.getCharge());
    15001549            // Check if charge is selected
    1501             if (hit.getCharge() != null && hit.getCharge().equals(charge))
     1550            if (hit.getCharge() != null && hit.getCharge().equals(
     1551              charge))
    15021552            {
    15031553              if (!hitList.contains(hit))
     
    15121562        {
    15131563          log.debug("   hitList.size() = " + hitList.size());
    1514           // Check if unique external id value can be found in hit list
     1564          // Check if unique external id value can be found in hit
     1565          // list
    15151566          String tmpExternalId = null;
    1516           for (Hit hit: hitList)
     1567          for (Hit hit : hitList)
    15171568          {
    15181569            if (hit.getExternalId() != null)
     
    15231574                tmpExternalId = hit.getExternalId();
    15241575              }
    1525               // Retain the longest string (most external ids) to avoid singling out proteins at this stage
    1526               else if (!hit.getExternalId().equals(tmpExternalId) && hit.getExternalId().length()>tmpExternalId.length())
     1576              // Retain the longest string (most external ids) to
     1577              // avoid singling out proteins at this stage
     1578              else if (!hit.getExternalId().equals(tmpExternalId) && hit
     1579                .getExternalId().length() > tmpExternalId
     1580                .length())
    15271581              {
    15281582                tmpExternalId = hit.getExternalId();
     
    15301584            }
    15311585          }
    1532             externalId = tmpExternalId;
     1586          externalId = tmpExternalId;
    15331587        }
    15341588        // Print one table row
    15351589        printQuantitativeReportTableRow(writer, hitList,
    1536           hitSelection1HitList,
    1537           hitSelection2HitList,
    1538           sequence, charge, externalId,
    1539           quantityVariable, quantityEntry,
     1590          hitSelection1HitList, hitSelection2HitList, sequence,
     1591          charge, externalId, quantityVariable, quantityEntry,
    15401592          hitSelection1LocalSampleIdList,
    15411593          hitSelection2LocalSampleIdList);
     
    15451597
    15461598
    1547   private void createQuantitativeReportProteinTable(
    1548       PrintWriter writer,
    1549       List<String> externalIdList,
    1550       List<Hit> hitSelection1HitList, List<Hit> hitSelection2HitList,
    1551       String quantityVariable, String quantityEntry,
    1552       List<String> hitSelection1LocalSampleIdList,
     1599  private void createQuantitativeReportProteinTable(PrintWriter writer,
     1600      List<String> externalIdList, List<Hit> hitSelection1HitList,
     1601      List<Hit> hitSelection2HitList, String quantityVariable,
     1602      String quantityEntry, List<String> hitSelection1LocalSampleIdList,
    15531603      List<String> hitSelection2LocalSampleIdList)
    15541604  {
     
    15591609    String comparisonType = new String("protein");
    15601610    Boolean modificationsIncluded = null;
    1561     for (int i=0; i < externalIdList.size(); i++)
     1611    for (int i = 0; i < externalIdList.size(); i++)
    15621612    {
    15631613      String externalId = externalIdList.get(i);
    1564       //log.debug("externalIdList: externalId = \"" + externalId + "\"");
    1565       // Collect hits with current external id 
     1614      // log.debug("externalIdList: externalId = \"" + externalId + "\"");
     1615      // Collect hits with current external id
    15661616      List<Hit> hitList = new ArrayList<Hit>();
    1567       for (Hit hit: hitSelection1HitList)
    1568       {
    1569         String hitExternalId = fetchCompareString(hit, gelBasedComparison, comparisonType, modificationsIncluded);
     1617      for (Hit hit : hitSelection1HitList)
     1618      {
     1619        String hitExternalId = fetchCompareString(hit,
     1620          gelBasedComparison, comparisonType, modificationsIncluded);
    15701621        if (hitExternalId.equals(externalId))
    15711622        {
    1572           //log.debug("      hitSelection1HitList: externalId = \"" + externalId + "\" hitExternalId = \"" + hitExternalId + "\"");
     1623          // log.debug("      hitSelection1HitList: externalId = \"" +
     1624          // externalId + "\" hitExternalId = \"" + hitExternalId +
     1625          // "\"");
    15731626          if (!hitList.contains(hit))
    15741627          {
     
    15771630        }
    15781631      }
    1579       for (Hit hit: hitSelection2HitList)
    1580       {
    1581         String hitExternalId = fetchCompareString(hit, gelBasedComparison, comparisonType, modificationsIncluded);
     1632      for (Hit hit : hitSelection2HitList)
     1633      {
     1634        String hitExternalId = fetchCompareString(hit,
     1635          gelBasedComparison, comparisonType, modificationsIncluded);
    15821636        if (hitExternalId.equals(externalId))
    15831637        {
    1584           //log.debug("      hitSelection2HitList: externalId = \"" + externalId + "\" hitExternalId = \"" + hitExternalId + "\"");
     1638          // log.debug("      hitSelection2HitList: externalId = \"" +
     1639          // externalId + "\" hitExternalId = \"" + hitExternalId +
     1640          // "\"");
    15851641          if (!hitList.contains(hit))
    15861642          {
     
    15971653        boolean isHitSequenceUnique = true;
    15981654        String tmpSequence = null;
    1599         for (Hit hit: hitList)
     1655        for (Hit hit : hitList)
    16001656        {
    16011657          if (hit.getDescription() != null)
     
    16201676        boolean isHitChargeUnique = true;
    16211677        Integer tmpCharge = null;
    1622         for (Hit hit: hitList)
     1678        for (Hit hit : hitList)
    16231679        {
    16241680          if (hit.getCharge() != null)
     
    16431699      // Print one table row
    16441700      printQuantitativeReportTableRow(writer, hitList,
    1645         hitSelection1HitList,
    1646         hitSelection2HitList,
    1647         sequence, charge, externalId,
    1648         quantityVariable, quantityEntry,
    1649         hitSelection1LocalSampleIdList,
    1650         hitSelection2LocalSampleIdList);
    1651     }
    1652   }
    1653 
    1654 
    1655   private void printQuantitativeReportTableRow(
    1656       PrintWriter writer, List<Hit> hitList,
    1657       List<Hit> hitSelection1HitList,
    1658       List<Hit> hitSelection2HitList,
    1659       String sequence, Integer charge, String externalId,
    1660       String quantityVariable, String quantityEntry,
     1701        hitSelection1HitList, hitSelection2HitList, sequence, charge,
     1702        externalId, quantityVariable, quantityEntry,
     1703        hitSelection1LocalSampleIdList, hitSelection2LocalSampleIdList);
     1704    }
     1705  }
     1706
     1707
     1708  private void printQuantitativeReportTableRow(PrintWriter writer,
     1709      List<Hit> hitList, List<Hit> hitSelection1HitList,
     1710      List<Hit> hitSelection2HitList, String sequence, Integer charge,
     1711      String externalId, String quantityVariable, String quantityEntry,
    16611712      List<String> hitSelection1LocalSampleIdList,
    16621713      List<String> hitSelection2LocalSampleIdList)
     
    16821733    }
    16831734    sb.append(sequenceStr);
    1684     //log.debug("         sequence = " + sequence);
     1735    // log.debug("         sequence = " + sequence);
    16851736    //
    16861737    // Charge
     
    16921743    sb.append("\t");
    16931744    sb.append(chargeStr);
    1694     //log.debug("         charge = " + charge);
     1745    // log.debug("         charge = " + charge);
    16951746    //
    16961747    // External Id
     
    17021753    sb.append("\t");
    17031754    sb.append(externalIdStr);
    1704     //log.debug("         hit.getExternalID() = " + hit.getExternalId());
     1755    // log.debug("         hit.getExternalID() = " + hit.getExternalId());
    17051756    //
    17061757    // Hit selection 1 local sample id values
    1707     for (int j=0; j < hitSelection1LocalSampleIdList.size(); j++)
     1758    for (int j = 0; j < hitSelection1LocalSampleIdList.size(); j++)
    17081759    {
    17091760      String localSampleId = hitSelection1LocalSampleIdList.get(j);
    1710       //log.debug("         hitSelection1: hitSelection1LocalSampleIdList.get(" + j + ") = \"" + hitSelection1LocalSampleIdList.get(j));
     1761      // log.debug("         hitSelection1: hitSelection1LocalSampleIdList.get("
     1762      // + j + ") = \"" + hitSelection1LocalSampleIdList.get(j));
    17111763      Double columnValue = null;
    17121764      int columnEntries = 0;
    1713       for (Hit hit: hitList)
    1714       {
    1715         if (hit.getLocalSampleId().equals(localSampleId)
    1716             && hitSelection1HitList.contains(hit))
    1717         {
    1718           Double newValue = fetchHitQuantityValue(hit, quantityVariable);
     1765      for (Hit hit : hitList)
     1766      {
     1767        if (hit.getLocalSampleId().equals(localSampleId) && hitSelection1HitList
     1768          .contains(hit))
     1769        {
     1770          Double newValue = fetchHitQuantityValue(hit,
     1771            quantityVariable);
    17191772          // Check if new value is valid
    17201773          if (newValue != null)
    17211774          {
    17221775            columnEntries++;
    1723             columnValue = updateColumnValue(columnValue, newValue, quantityEntry);
     1776            columnValue = updateColumnValue(columnValue, newValue,
     1777              quantityEntry);
    17241778          }
    17251779        }
     
    17291783      if (columnValue != null)
    17301784      {
    1731         columnValueStr =  new String("" + columnValue);
     1785        columnValueStr = new String("" + columnValue);
    17321786        ssa.addValue(columnValue);
    17331787      }
     
    17421796    //
    17431797    // Hit selection 2 local sample id values
    1744     for (int j=0; j < hitSelection2LocalSampleIdList.size(); j++)
     1798    for (int j = 0; j < hitSelection2LocalSampleIdList.size(); j++)
    17451799    {
    17461800      String localSampleId = hitSelection2LocalSampleIdList.get(j);
    1747       //log.debug("         hitSelection2: hitSelection2LocalSampleIdList.get(" + j + ") = \"" + hitSelection2LocalSampleIdList.get(j));
     1801      // log.debug("         hitSelection2: hitSelection2LocalSampleIdList.get("
     1802      // + j + ") = \"" + hitSelection2LocalSampleIdList.get(j));
    17481803      Double columnValue = null;
    17491804      int columnEntries = 0;
    1750       for (Hit hit: hitList)
    1751       {
    1752         if (hit.getLocalSampleId().equals(localSampleId)
    1753             && hitSelection2HitList.contains(hit))
    1754         {
    1755           Double newValue = fetchHitQuantityValue(hit, quantityVariable);
     1805      for (Hit hit : hitList)
     1806      {
     1807        if (hit.getLocalSampleId().equals(localSampleId) && hitSelection2HitList
     1808          .contains(hit))
     1809        {
     1810          Double newValue = fetchHitQuantityValue(hit,
     1811            quantityVariable);
    17561812          // Check if new value is valid
    17571813          if (newValue != null)
    17581814          {
    17591815            columnEntries++;
    1760             columnValue = updateColumnValue(columnValue, newValue, quantityEntry);
     1816            columnValue = updateColumnValue(columnValue, newValue,
     1817              quantityEntry);
    17611818          }
    17621819        }
     
    17661823      if (columnValue != null)
    17671824      {
    1768         columnValueStr =  new String("" + columnValue);
     1825        columnValueStr = new String("" + columnValue);
    17691826        ssb.addValue(columnValue);
    17701827      }
     
    17861843      if (ssb.getN() > 0 && ssb.getMean() != 0)
    17871844      {
    1788         ratio = ssa.getMean()/ssb.getMean();
     1845        ratio = ssa.getMean() / ssb.getMean();
    17891846        ratioStr = new String("" + ratio);
    17901847      }
     
    17941851      ratioStr = new String("-");
    17951852    }
    1796     //log.debug("ssa.getN() = " + ssa.getN() + " ssa.getMean() = " + ssa.getMean());
    1797     //log.debug("ssb.getN() = " + ssb.getN() + " ssb.getMean() = " + ssb.getMean());
    1798     //log.debug("         ratio = " + ratio + " ratioStr = \"" + ratioStr + "\"");
     1853    // log.debug("ssa.getN() = " + ssa.getN() + " ssa.getMean() = " +
     1854    // ssa.getMean());
     1855    // log.debug("ssb.getN() = " + ssb.getN() + " ssb.getMean() = " +
     1856    // ssb.getMean());
     1857    // log.debug("         ratio = " + ratio + " ratioStr = \"" + ratioStr +
     1858    // "\"");
    17991859    sb.append("\t");
    18001860    sb.append(ratioStr);
     
    18501910    else
    18511911    {
    1852       log.error("quantityVariable value unknown = \"" + quantityVariable + "\"");
     1912      log
     1913        .error("quantityVariable value unknown = \"" + quantityVariable + "\"");
    18531914    }
    18541915    // Return quantity value for hit
     
    18581919
    18591920  /**
    1860    * Updates a column value with a new entry,
    1861    * if the new value differs from null.
     1921   * Updates a column value with a new entry, if the new value differs from
     1922   * null.
    18621923   *
    18631924   * @param columnValue Double Current column value to be updated.
    18641925   * @param newValue Double The new value to add, if a valid entry.
    1865    * @param quantityEntry String Specification of how the update the column value.
     1926   * @param quantityEntry String Specification of how the update the column
     1927   *        value.
    18661928   * @return Double The possibly updated column value.
    18671929   */
    1868   private Double updateColumnValue(Double columnValue,
    1869       Double newValue, String quantityEntry)
     1930  private Double updateColumnValue(Double columnValue, Double newValue,
     1931      String quantityEntry)
    18701932  {
    18711933    // Update current column value with new data value
     
    19001962      else
    19011963      {
    1902         log.error("quantityEntry value unknown = \"" + quantityEntry + "\"");
     1964        log
     1965          .error("quantityEntry value unknown = \"" + quantityEntry + "\"");
    19031966      }
    19041967    }
     
    21402203   * @param comparisonType String A string indicating protein/peptide
    21412204   *        comparison type.
    2142    * @param modificationsIncluded Flag indicating that modifications
    2143    *        should be included for peptide comparison type.
     2205   * @param modificationsIncluded Flag indicating that modifications should be
     2206   *        included for peptide comparison type.
    21442207   */
    21452208  private String fetchCompareString(Hit hit, boolean gelBasedComparison,
     
    21642227        hitCompareStr = hit.getDescription();
    21652228      }
    2166       hitCompareStr = pruneCompareString(hitCompareStr, comparisonType, modificationsIncluded);
     2229      hitCompareStr = pruneCompareString(hitCompareStr, comparisonType,
     2230        modificationsIncluded);
    21672231    }
    21682232    return hitCompareStr;
     
    21762240   * @param comparisonType String A string indicating protein/peptide
    21772241   *        comparison type.
    2178    * @param modificationsIncluded Flag indicating that modifications
    2179    *        should be included for peptide comparison type.
     2242   * @param modificationsIncluded Flag indicating that modifications should be
     2243   *        included for peptide comparison type.
    21802244   */
    2181   private String pruneCompareString(String compareStr,
    2182       String comparisonType, Boolean modificationsIncluded)
     2245  private String pruneCompareString(String compareStr, String comparisonType,
     2246      Boolean modificationsIncluded)
    21832247  {
    21842248    if (comparisonType != null && comparisonType.equals("peptide"))
     
    22202284   *
    22212285   * @param comparisonType String Comparison type used (protein or peptide).
    2222    * @param hitSelection1LocalSampleIdList List<String> Hit selection 1 local sample id list.
    2223    * @param hitSelection2LocalSampleIdList List<String> Hit selection 2 local sample id list.
    2224    * @return String The tab-delimited hit table header string for quantitative report.
     2286   * @param hitSelection1LocalSampleIdList List<String> Hit selection 1 local
     2287   *        sample id list.
     2288   * @param hitSelection2LocalSampleIdList List<String> Hit selection 2 local
     2289   *        sample id list.
     2290   * @return String The tab-delimited hit table header string for quantitative
     2291   *         report.
    22252292   */
    22262293  private String fetchTabDelimitedHitTableHeaderForQuantitativeReport(
    2227       String comparisonType,
    2228       List<String> hitSelection1LocalSampleIdList, List<String> hitSelection2LocalSampleIdList)
     2294      String comparisonType, List<String> hitSelection1LocalSampleIdList,
     2295      List<String> hitSelection2LocalSampleIdList)
    22292296  {
    22302297    StringBuilder sb = new StringBuilder();
     
    22502317    //
    22512318    // Hit selection 1 local sample id values
    2252     for (int i=0; i < hitSelection1LocalSampleIdList.size(); i++)
     2319    for (int i = 0; i < hitSelection1LocalSampleIdList.size(); i++)
    22532320    {
    22542321      String localSampleId = hitSelection1LocalSampleIdList.get(i);
     
    22642331    //
    22652332    // Hit selection 2 local sample id values
    2266     for (int i=0; i < hitSelection2LocalSampleIdList.size(); i++)
     2333    for (int i = 0; i < hitSelection2LocalSampleIdList.size(); i++)
    22672334    {
    22682335      String localSampleId = hitSelection2LocalSampleIdList.get(i);
     
    23002367   * @return String Constructed timestamp string.
    23012368   */
    2302   public String fetchTimestamp(Calendar inputCal, int secondsToAdd)
     2369  public static String fetchTimestamp(Calendar inputCal, int secondsToAdd)
    23032370  {
    23042371    String timestamp = fetchTimestamp(inputCal, secondsToAdd, null, null,
     
    23302397   * @return String Constructed timestamp string.
    23312398   */
    2332   public String fetchTimestamp(Calendar inputCal, int secondsToAdd,
     2399  public static String fetchTimestamp(Calendar inputCal, int secondsToAdd,
    23332400      Boolean includeDatePart, Boolean includeTimePart,
    23342401      Boolean includeSeconds, String dateElementSeparator,
     
    24292496   *         'minChars' characters.
    24302497   */
    2431   private String leftPaddedString(String inStr, int minChars, char padChar)
     2498  private static String leftPaddedString(String inStr, int minChars,
     2499      char padChar)
    24322500  {
    24332501    String startStr = null;
Note: See TracChangeset for help on using the changeset viewer.