Changeset 4539
- Timestamp:
- Dec 20, 2013, 10:14:06 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/servlet/src/locale/en/dictionary
r4535 r4539 298 298 IdentificationResultFile=Search results file 299 299 Id=ID 300 IdentifiedOnly=Identified Only 300 301 ImportedPeakLists=Imported Peak Lists 301 302 ImportedSearches=Imported Searches … … 455 456 MimeType=MIME Type 456 457 MinPep=Minimum peptides 458 MinSamples=Minimum samples 457 459 MissingFile=Missing File 458 460 Model=Model -
trunk/client/servlet/src/org/proteios/action/feature/CreateFeatureComparisonJob.java
r4281 r4539 30 30 import org.proteios.action.ProteiosAction; 31 31 import org.proteios.action.job.ListJobs; 32 import org.proteios.core.BooleanParameterType; 32 33 import org.proteios.core.DbControl; 34 import org.proteios.core.IntegerParameterType; 33 35 import org.proteios.core.ItemFactory; 34 36 import org.proteios.core.ItemParameterType; … … 40 42 import se.lu.thep.waf.ActionException; 41 43 import se.lu.thep.waf.constraints.InvalidParameterValue; 44 import se.lu.thep.waf.constraints.VBoolean; 45 import se.lu.thep.waf.constraints.VInteger; 42 46 import se.lu.thep.waf.constraints.VString; 43 47 … … 50 54 51 55 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); 52 58 53 59 /* … … 67 73 ItemFactory factory = getItemFactory(dc); 68 74 String filename = getValidString(VFILENAME); 75 Integer minSamplesWithValues = getValidInteger(VMINSAMPLESWITHVALUES); 76 Boolean isIdentifiedOnly = getValidBoolean(VIDENTIFIEDONLY); 77 if (isIdentifiedOnly == null) 78 isIdentifiedOnly = new Boolean(false); 69 79 /*********************************************************************** 70 80 * Create jobs … … 95 105 // File parameters 96 106 job.setParameterValue("filename", new StringParameterType(), filename); 107 job.setParameterValue("minSamplesWithValues", new IntegerParameterType(), minSamplesWithValues); 108 job.setParameterValue("identifiedOnly", new BooleanParameterType(),isIdentifiedOnly); 97 109 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); 99 111 dc.saveItem(job); 100 112 dc.commit(); -
trunk/client/servlet/src/org/proteios/action/feature/FeatureComparisonForm.java
r4329 r4539 10 10 import org.proteios.gui.Title; 11 11 import org.proteios.gui.Toolbar; 12 import org.proteios.gui.form.Checkbox; 12 13 import org.proteios.gui.form.Fieldset; 13 14 import org.proteios.gui.form.Form; … … 17 18 import se.lu.thep.waf.ActionException; 18 19 import se.lu.thep.waf.constraints.InvalidParameterValue; 20 import se.lu.thep.waf.constraints.VBoolean; 19 21 20 22 import java.util.ArrayList; … … 44 46 nameF.setLabel("OutputFileName"); 45 47 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 46 62 Toolbar tb = new Toolbar(); 47 63 form.setToolbar(tb); -
trunk/plugin/src/org/proteios/plugins/FeatureComparison.java
r4427 r4539 65 65 66 66 /** 67 * This analysis plugin will create a hits comparisonreport.67 * This plugin will create a feature report. 68 68 * 69 69 * @author olle … … 79 79 80 80 private Map<String, FeatureRow> valueMap = new TreeMap<String, FeatureRow>(); 81 81 private Integer minSamples = 1; 82 private Boolean identifiedOnly = false; 82 83 83 84 public MainType getMainType() … … 90 91 { 91 92 return new AboutImpl("Feature Comparison Report", 92 "Generate table with feature comparison", "0. 2",93 "Generate table with feature comparison", "0.3", 93 94 "2012-2103, Immunotechnology, Lund University", null, null, 94 95 "http://www.proteios.org "); … … 118 119 String filenamePrefix = (String) job.getValue("filename"); 119 120 log.debug("filenamePrefix = \"" + filenamePrefix + "\""); 121 minSamples = (Integer) job.getValue("minSamplesWithValues"); 122 identifiedOnly = ((Boolean) job.getValue("identifiedOnly")).booleanValue(); 120 123 ItemFactory factory = new ItemFactory(dc); 121 124 File outCoreFile = factory.create(File.class); … … 131 134 // Write report header 132 135 writer.println("Feature Comparison Report"); 133 writer.println(" ");136 writer.println("Minimum samples with values:"+minSamples+". Only writing features with assigned identitites:"+identifiedOnly); 134 137 writer 135 138 .println("File generated by Proteios SE " + proteiosVersion + " build " + proteiosBuildNumber + " (" + timestamp + ")"); … … 207 210 if (!feature.getClusterId().equals(currentCluster)) 208 211 { 209 if (nEntries > 1)212 if (nEntries >= 1) 210 213 { 211 214 treatRow(writer, values, currentCluster, currentSequence, … … 274 277 275 278 } 276 treatRow(writer, values, currentCluster, currentSequence, currentAcc,279 if (nEntries >= 1) treatRow(writer, values, currentCluster, currentSequence, currentAcc, 277 280 currentCharge, rtSum, nValues, conflict); 278 281 for (String key : valueMap.keySet()) … … 344 347 int currentCharge, float rtSum, float nValues, boolean conflict) 345 348 { 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 } 360 370 } 361 371
Note: See TracChangeset
for help on using the changeset viewer.