Changeset 4539


Ignore:
Timestamp:
Dec 20, 2013, 10:14:06 AM (9 years ago)
Author:
Fredrik Levander
Message:

Refs #821.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/servlet/src/locale/en/dictionary

    r4535 r4539  
    298298IdentificationResultFile=Search results file
    299299Id=ID
     300IdentifiedOnly=Identified Only
    300301ImportedPeakLists=Imported Peak Lists
    301302ImportedSearches=Imported Searches
     
    455456MimeType=MIME Type
    456457MinPep=Minimum peptides
     458MinSamples=Minimum samples
    457459MissingFile=Missing File
    458460Model=Model
  • trunk/client/servlet/src/org/proteios/action/feature/CreateFeatureComparisonJob.java

    r4281 r4539  
    3030import org.proteios.action.ProteiosAction;
    3131import org.proteios.action.job.ListJobs;
     32import org.proteios.core.BooleanParameterType;
    3233import org.proteios.core.DbControl;
     34import org.proteios.core.IntegerParameterType;
    3335import org.proteios.core.ItemFactory;
    3436import org.proteios.core.ItemParameterType;
     
    4042import se.lu.thep.waf.ActionException;
    4143import se.lu.thep.waf.constraints.InvalidParameterValue;
     44import se.lu.thep.waf.constraints.VBoolean;
     45import se.lu.thep.waf.constraints.VInteger;
    4246import se.lu.thep.waf.constraints.VString;
    4347
     
    5054
    5155  public static final VString VFILENAME = new VString("name", 1, 100, true);
     56  public static final VInteger VMINSAMPLESWITHVALUES = new VInteger("minSamples", 0, 10000, true);
     57  public static final VBoolean VIDENTIFIEDONLY = new VBoolean("isIdentifiedOnly", false);
    5258 
    5359  /*
     
    6773    ItemFactory factory = getItemFactory(dc);
    6874    String filename = getValidString(VFILENAME);
     75    Integer minSamplesWithValues = getValidInteger(VMINSAMPLESWITHVALUES);
     76    Boolean isIdentifiedOnly = getValidBoolean(VIDENTIFIEDONLY);
     77    if (isIdentifiedOnly == null)
     78      isIdentifiedOnly = new Boolean(false);
    6979    /***********************************************************************
    7080     * Create jobs
     
    95105    // File parameters
    96106    job.setParameterValue("filename", new StringParameterType(), filename);
     107    job.setParameterValue("minSamplesWithValues", new IntegerParameterType(), minSamplesWithValues);
     108    job.setParameterValue("identifiedOnly", new BooleanParameterType(),isIdentifiedOnly);
    97109    job.setName("Compare features");
    98     job.setDescription("Project:" + project+ ", outfile:"+filename);
     110    job.setDescription("Project:" + project+ ", outfile:"+filename+", identified only:"+isIdentifiedOnly+", min samples with values:"+minSamplesWithValues);
    99111    dc.saveItem(job);
    100112    dc.commit();
  • trunk/client/servlet/src/org/proteios/action/feature/FeatureComparisonForm.java

    r4329 r4539  
    1010import org.proteios.gui.Title;
    1111import org.proteios.gui.Toolbar;
     12import org.proteios.gui.form.Checkbox;
    1213import org.proteios.gui.form.Fieldset;
    1314import org.proteios.gui.form.Form;
     
    1718import se.lu.thep.waf.ActionException;
    1819import se.lu.thep.waf.constraints.InvalidParameterValue;
     20import se.lu.thep.waf.constraints.VBoolean;
    1921
    2022import java.util.ArrayList;
     
    4446    nameF.setLabel("OutputFileName");
    4547    properties.add(nameF);
     48    TextField<Integer> minF = new TextField<Integer>(
     49        CreateFeatureComparisonJob.VMINSAMPLESWITHVALUES);
     50    minF.setValue(new Integer(1));
     51    minF.setLabel("MinSamples");
     52    minF.setHelp("Only report feature with values in at least this number of samples");
     53    properties.add(minF);
     54    Checkbox<VBoolean> isIdentifiedOnly = new Checkbox<VBoolean>(
     55        CreateFeatureComparisonJob.VIDENTIFIEDONLY);
     56    isIdentifiedOnly.setLabel("IdentifiedOnly");
     57    isIdentifiedOnly.setValue("true");
     58    isIdentifiedOnly
     59        .setHelp("Check to only report features with assigned peptides sequence.");
     60    properties.add(isIdentifiedOnly);
     61
    4662    Toolbar tb = new Toolbar();
    4763    form.setToolbar(tb);
  • trunk/plugin/src/org/proteios/plugins/FeatureComparison.java

    r4427 r4539  
    6565
    6666/**
    67  * This analysis plugin will create a hits comparison report.
     67 * This plugin will create a feature report.
    6868 *
    6969 * @author olle
     
    7979
    8080  private Map<String, FeatureRow> valueMap = new TreeMap<String, FeatureRow>();
    81 
     81    private Integer minSamples = 1;
     82    private Boolean identifiedOnly = false;
    8283
    8384  public MainType getMainType()
     
    9091  {
    9192    return new AboutImpl("Feature Comparison Report",
    92       "Generate table with feature comparison", "0.2",
     93      "Generate table with feature comparison", "0.3",
    9394      "2012-2103, Immunotechnology, Lund University", null, null,
    9495      "http://www.proteios.org  ");
     
    118119      String filenamePrefix = (String) job.getValue("filename");
    119120      log.debug("filenamePrefix = \"" + filenamePrefix + "\"");
     121      minSamples = (Integer) job.getValue("minSamplesWithValues");
     122      identifiedOnly = ((Boolean) job.getValue("identifiedOnly")).booleanValue();
    120123      ItemFactory factory = new ItemFactory(dc);
    121124      File outCoreFile = factory.create(File.class);
     
    131134      // Write report header
    132135      writer.println("Feature Comparison Report");
    133       writer.println("");
     136      writer.println("Minimum samples with values:"+minSamples+". Only writing features with assigned identitites:"+identifiedOnly);
    134137      writer
    135138        .println("File generated by Proteios SE " + proteiosVersion + " build " + proteiosBuildNumber + " (" + timestamp + ")");
     
    207210      if (!feature.getClusterId().equals(currentCluster))
    208211      {
    209         if (nEntries > 1)
     212        if (nEntries >= 1)
    210213        {
    211214          treatRow(writer, values, currentCluster, currentSequence,
     
    274277
    275278    }
    276     treatRow(writer, values, currentCluster, currentSequence, currentAcc,
     279    if (nEntries >= 1) treatRow(writer, values, currentCluster, currentSequence, currentAcc,
    277280      currentCharge, rtSum, nValues, conflict);
    278281    for (String key : valueMap.keySet())
     
    344347      int currentCharge, float rtSum, float nValues, boolean conflict)
    345348  {
    346     if (values != null)
    347     {
    348       writer.print(currentCluster + "\t" + currentSequence);
    349       if (conflict)
    350         writer.print(",+");
    351       writer
    352         .print("\t" + currentAcc + "\t" + currentCharge + "\t" + (rtSum / nValues));
    353       for (Float value : values)
    354       {
    355         writer.print("\t" + value);
    356       }
    357       writer.println();
    358     }
    359 
     349    if (values != null && (!currentSequence.equals("") || !identifiedOnly))
     350    {
     351      int count=0;
     352      for (Float v:values)
     353      {
     354        if (v!=null) count++;
     355      }
     356      if (count>=minSamples)
     357      {
     358        writer.print(currentCluster + "\t" + currentSequence);
     359        if (conflict)
     360          writer.print(",+");
     361        writer
     362          .print("\t" + currentAcc + "\t" + currentCharge + "\t" + (rtSum / nValues));
     363        for (Float value : values)
     364        {
     365          writer.print("\t" + value);
     366        }
     367        writer.println();
     368      }
     369    }
    360370  }
    361371
Note: See TracChangeset for help on using the changeset viewer.