Changeset 4274


Ignore:
Timestamp:
Jan 4, 2012, 1:38:40 PM (11 years ago)
Author:
Fredrik Levander
Message:

Refs #772. Updated protein assembly for optional per replicate assembly.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/servlet/src/org/proteios/action/hit/CreateProteinAssemblyJob.java

    r4258 r4274  
    5656{
    5757  public static final VBoolean VFILEWISE = new VBoolean("isFileWise", false);
     58  public static final VBoolean VREPLICATEWISE = new VBoolean("isReplicateWise", false);
    5859  public static final VBoolean VOCCAMS = new VBoolean("isOccamsRazor", false);
    5960  public static final VBoolean VUNIQUE = new VBoolean("isUnique", false);
     
    106107    if (isFileWise == null)
    107108      isFileWise = new Boolean(false);
     109    Boolean isReplicateWise = getValidBoolean(VREPLICATEWISE);
     110    if (isReplicateWise == null)
     111      isReplicateWise = new Boolean(false);
    108112    Boolean isOccamsRazor = getValidBoolean(VOCCAMS);
    109113    if (isOccamsRazor == null)
     
    164168    job.setParameterValue("fileWise", new BooleanParameterType(),
    165169      isFileWise);
     170    job.setParameterValue("replicateWise", new BooleanParameterType(),
     171      isReplicateWise);
    166172    job.setParameterValue("occamsRazor", new BooleanParameterType(),
    167173      isOccamsRazor);
  • trunk/client/servlet/src/org/proteios/action/hit/ProteinAssembly1.java

    r4258 r4274  
    8080    isProteinCB.setLabel("FileWise");
    8181    isProteinCB.setValue("true");
    82     isProteinCB.setHelp("Per peaklist file report");
     82    isProteinCB.setHelp("Per peaklist file protein grouping");
    8383    properties.add(isProteinCB);
     84    Checkbox<VBoolean> isReplicateCB = new Checkbox<VBoolean>(
     85      CreateProteinAssemblyJob.VREPLICATEWISE);
     86    isReplicateCB.setLabel("ReplicateWise");
     87    isReplicateCB.setValue("true");
     88    isReplicateCB.setHelp("Per replicate protein grouping");
     89    properties.add(isReplicateCB);
    8490    Checkbox<VBoolean> isOccamCB = new Checkbox<VBoolean>(
    8591      CreateProteinAssemblyJob.VOCCAMS);
     
    186192    instruction += " If the search results combination has been performed, the peptide combined FDR can be used as cutoff, otherwise max E-value can be used.";
    187193    instruction += " The report can be filtered based on protein FDR if decoy peptides are present (search in target-decoy database and decoys kept in combined hits report are the requirements).";
    188     instruction += " Select whether to find proteins globally or per file or per sample. Also select whether peptide sequences should be counted once per unique";
     194    instruction += " Select whether to assemble proteins globally per sample, or per replicate or per file. Also select whether peptide sequences should be counted once per unique";
    189195    instruction += " Set the minimum nuber of peptides to the required number of significant peptides per protein.";
    190196    instruction += " sequence. If the generate proteins checkbox is checked, new hits will be generated with score type Proteios Protein.";
  • trunk/plugin/src/org/proteios/plugins/ProteiosProteinAssembly.java

    r4267 r4274  
    113113  private boolean quantifyUsingUnique = false;
    114114  private boolean peptideReport = false;
     115  private boolean separateReplicates = false;
    115116  private Integer minPep = 1;
    116117  private int refIdx = 0;
     
    181182      "Protein Assembly from Peptides",
    182183      "Generate protein entries for Hits which pass a certain score limit. The Proteins are added to the hits report",
    183       "1.9", "2008-2011, Fredrik Levander", null, null,
     184      "1.10", "2008-2012, Fredrik Levander", null, null,
    184185      "http://www.proteios.org  ");
    185186  }
     
    225226          .booleanValue();
    226227        fileWise = ((Boolean) job.getValue("fileWise")).booleanValue();
     228        separateReplicates = ((Boolean) job.getValue("replicateWise"))
     229          .booleanValue();
    227230        fdr = ((Boolean) job.getValue("fdr")).booleanValue();
    228231        uniqueSequences = ((Boolean) job.getValue("unique"))
     
    525528      Integer currentSpotId = null;
    526529      String currentLocalSampleId = null;
     530      String currentReplicateId = null;
    527531      // First group peptides, if protein combination is not supposed to
    528532      // be
     
    541545          addFraction(peptideFraction, peptideFractions,
    542546            currentSpotId, currentLocalSampleId,
    543             currentPeakListFile, currentHit);
     547            currentReplicateId, currentPeakListFile, currentHit);
    544548          peptideFraction = new ArrayList<Hit>();
    545549        }
     
    547551        currentPeakListFile = currentHit.getPeakListFile();
    548552        currentLocalSampleId = currentHit.getLocalSampleId();
     553        currentReplicateId = currentHit.getReplicateId();
    549554        peptideFraction.add(currentHit);
    550555        if (!hitit.hasNext())
     
    552557          addFraction(peptideFraction, peptideFractions,
    553558            currentSpotId, currentLocalSampleId,
    554             currentPeakListFile, currentHit);
     559            currentReplicateId, currentPeakListFile, currentHit);
    555560        }
    556561      }
     
    672677                .getLocalSampleId() + "\n");
    673678          }
     679          if (separateReplicates && proteinHits.size() > 0)
     680          {
     681            output.write("Replicate id:" + proteinHits.get(0).hit
     682              .getReplicateId() + "\n");
     683          }
    674684          if (fileWise && proteinHits.size() > 0)
    675685          {
     
    747757            output.write("Spot ID\t");
    748758          }
    749           else if (localSampleId == null)
     759          else if (localSampleId != null)
    750760          {
    751761            output.write("Sample\t");
     762            if (separateReplicates)
     763            {
     764              output.write("Replicate\t");
     765            }
    752766          }
    753767          output
     
    762776            }
    763777          }
    764           if (localSampleId != null && localSampleId.equals("all"))
    765           {
    766             output.write("\tSample");
     778          if (localSampleId != null)
     779          {
     780            if (localSampleId.equals("all"))
     781              output.write("\tSample");
     782            if (separateReplicates)
     783            {
     784              output.write("\tReplicate");
     785            }
    767786          }
    768787          output.write("\tLocal FDR\tTotal Intensity\n");
     
    781800                output.write("" + p.getSpotId() + "\t");
    782801              }
    783               else if (localSampleId == null)
     802              else if (localSampleId != null)
    784803              {
    785804                output.write("" + p.getLocalSampleId() + "\t");
     805                if (separateReplicates)
     806                {
     807                  output
     808                    .write("" + p.getReplicateId() + "\t");
     809                }
    786810              }
    787811              output.write("" + p.getMatchedPeaks());
     
    865889                  }
    866890                }
    867                 if (localSampleId != null && localSampleId
    868                   .equals("all"))
     891                if (localSampleId != null)
    869892                {
    870                   output.write("\t" + p.getLocalSampleId());
     893                  if (localSampleId.equals("all"))
     894                  {
     895                    output.write("\t" + p
     896                      .getLocalSampleId());
     897                  }
     898                  if (separateReplicates)
     899                    output.write("\t" + p.getReplicateId());
    871900                }
    872901                output
     
    957986  private void addFraction(List<Hit> peptideFraction,
    958987      List<List<Hit>> peptideFractions, Integer currentSpotId,
    959       String currentLocalSampleId, File currentPeakListFile,
    960       Hit currentHit)
     988      String currentLocalSampleId, String currentReplicateId,
     989      File currentPeakListFile, Hit currentHit)
    961990  {
    962991    if (label_index > 0)
     
    9931022    }
    9941023    /*
    995      * Start to collect new fraction if at new sample
     1024     * Start to collect new fraction if at new sample or new replicate
    9961025     */
    997     if (localSampleId != null && localSampleId.equals("all") && (!currentLocalSampleId
    998       .equals(currentHit.getLocalSampleId())))
    999     {
    1000       peptideFractions.add(new ArrayList<Hit>());
     1026    if (localSampleId != null)
     1027    {
     1028      if (localSampleId.equals("all") && (!currentLocalSampleId
     1029        .equals(currentHit.getLocalSampleId())))
     1030      {
     1031        peptideFractions.add(new ArrayList<Hit>());
     1032      }
     1033      else if (separateReplicates && currentReplicateId != null && (!currentReplicateId
     1034        .equals(currentHit.getReplicateId())))
     1035      {
     1036        peptideFractions.add(new ArrayList<Hit>());
     1037      }
    10011038    }
    10021039
     
    13711408    newHit.setMatchedPeaks(1);
    13721409    newHit.setLocalSampleId(currentHit.getLocalSampleId());
     1410    newHit.setReplicateId(currentHit.getReplicateId());
    13731411    // Set this to keep link to search settings
    13741412    newHit.setIdentificationResultFile(currentHit
Note: See TracChangeset for help on using the changeset viewer.