Changeset 4461
- Timestamp:
- Mar 21, 2013, 12:42:01 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/servlet/src/locale/en/dictionary
r4458 r4461 294 294 ImportedPeakLists=Imported Peak Lists 295 295 ImportedSearches=Imported Searches 296 ImportHitsNonGelWizardRegexPattern=Regex pattern: 296 ImportHitsNonGelWizardRegexPatternFractionId=Regex pattern: 297 ImportHitsNonGelWizardRegexPatternReplicateId=Regex pattern: 297 298 ImportHitsNonGelWizardStep1AdditionalParametersDescription=Step 1. Additional Parameters Description 298 299 ImportHitsNonGelWizardStep1FormLegend=Step 1. Register peaklist files for local sample ID … … 302 303 ImportHitsNonGelWizardStep1FormLegendStep1a=Step 1a. Register peaklist files for local sample ID 303 304 ImportHitsNonGelWizardStep2FormLegend=Step 2. Import protein identification results 304 ImportHitsNonGelWizardUseRegexPattern=Use regex pattern to parse fraction ID from filename 305 ImportHitsNonGelWizardUseRegexPatternFractionId=Use regex pattern to parse fraction ID from filename 306 ImportHitsNonGelWizardUseRegexPatternReplicateId=Use regex pattern to parse replicate ID from filename 305 307 ImportHitsWizardStep1FormLegend=Step 1. Add spots and mapping to plates 306 308 ImportHitsWizardStep2FormLegend=Step 2. Register peaklist files … … 836 838 SelectProject=Select project 837 839 SelectProtocolFile=Select Protocol File 840 SelectReplicateIdEntryMode=Replicate ID input: 838 841 SelectSpectrumFile=Select Spectrum File 839 842 SelectVisibleColumns=Select Visible Columns -
trunk/client/servlet/src/org/proteios/action/hit/ImportHitsNonGelWizardStep1a.java
r4126 r4461 64 64 String selectedLocalSampleId = getString(LocalSampleSelect.VPARAM); 65 65 String fractionIdEntryMode = getString(FractionIdEntryModeMenu.VPARAM); 66 String regexPattern = getValidString(RegexField.VPARAM); 66 String fractionIdRegexPattern = getValidString(RegexField.VPARAM); 67 String replicateIdEntryMode = getString(ReplicateIdEntryModeMenu.VPARAM); 68 String replicateIdRegexPattern = getValidString(ReplicateIdRegexField.VPARAM); 67 69 log.debug("localSampleIdEntryMode = \"" + localSampleIdEntryMode + "\""); 68 70 log.debug("enteredLocalSampleId = \"" + enteredLocalSampleId + "\""); 69 71 log.debug("selectedLocalSampleId = \"" + selectedLocalSampleId + "\""); 70 72 log.debug("fractionIdEntryMode = \"" + fractionIdEntryMode + "\""); 71 log.debug("regexPattern = \"" + regexPattern + "\""); 73 log.debug("fractionIdRegexPattern = \"" + fractionIdRegexPattern + "\""); 74 log.debug("replicateIdEntryMode = \"" + replicateIdEntryMode + "\""); 75 log.debug("replicateIdRegexPattern = \"" + replicateIdRegexPattern + "\""); 72 76 if (localSampleIdEntryMode.equals(LocalSampleIdEntryModeMenu.ENTER_EXPLICIT_LOCAL_SAMPLE_ID)) 73 77 { … … 93 97 saveToSession(FractionIdEntryModeMenu.VPARAM); 94 98 saveToSession(RegexField.VPARAM); 99 saveToSession(ReplicateIdEntryModeMenu.VPARAM); 100 saveToSession(ReplicateIdRegexField.VPARAM); 95 101 saveToSession(ForwardField.VPARAM); 96 102 saveToSession(PluginIdField.VPARAM); -
trunk/client/servlet/src/org/proteios/action/hit/ImportHitsNonGelWizardStep1b.java
r4155 r4461 74 74 List<Integer> fileIds = getValidIntegerList(ItemIdField.VPARAM); 75 75 String fractionIdEntryMode = getSessionAttribute(FractionIdEntryModeMenu.VPARAM); 76 String regexPattern = getSessionAttribute(RegexField.VPARAM); 76 String fractionIdRegexPattern = getSessionAttribute(RegexField.VPARAM); 77 String replicateIdEntryMode = getSessionAttribute(ReplicateIdEntryModeMenu.VPARAM); 78 String replicateIdRegexPattern = getSessionAttribute(ReplicateIdRegexField.VPARAM); 77 79 // Set default value of local sample id entry mode to explicit entry 78 80 log.debug("localSampleIdEntryMode from request = \"" + localSampleIdEntryMode + "\""); … … 93 95 } 94 96 log.debug("fractionIdEntryMode = \"" + fractionIdEntryMode + "\""); 95 log.debug("regexPattern = \"" + regexPattern + "\""); 97 log.debug("fractionIdRegexPattern = \"" + fractionIdRegexPattern + "\""); 98 // Set default value of replicate id entry mode 99 log.debug("replicateIdEntryMode from request = \"" + replicateIdEntryMode + "\""); 100 if (replicateIdEntryMode == null) 101 { 102 replicateIdEntryMode = new String(ReplicateIdEntryModeMenu.GET_REPLICATE_ID_FROM_PEAKLIST_FILE_ANNOTATION); 103 } 104 log.debug("replicateIdEntryMode = \"" + replicateIdEntryMode + "\""); 105 log.debug("replicateIdRegexPattern = \"" + replicateIdRegexPattern + "\""); 106 // 96 107 log.debug("fileIds = " + fileIds); 97 108 if (fileIds == null || fileIds.size() == 0) … … 126 137 { 127 138 Job job = createJob(factory, plugin, file, 128 localSampleIdEntryMode, fractionIdEntryMode, 129 localSampleId, project, regexPattern);139 localSampleIdEntryMode, fractionIdEntryMode, replicateIdEntryMode, 140 localSampleId, project, fractionIdRegexPattern, replicateIdRegexPattern); 130 141 // 131 142 dc.saveItem(job); … … 173 184 * @param localSampleIdEntryMode String Local sample id entry mode. 174 185 * @param fractionIdEntryMode String Fraction id entry mode. 186 * @param replicateIdEntryMode String Replicate id entry mode. 175 187 * @param localSampleId String Local sample id. 176 188 * @param project Project The project. 177 * @param regexPattern String Optional regular expression pattern to parse fraction id from name of peaklist file. 189 * @param fractionIdRegexPattern String Optional regular expression pattern to parse fraction id from name of peaklist file. 190 * @param replicateIdRegexPattern String Optional regular expression pattern to parse replicate id from name of peaklist file. 178 191 * @return job Job The created non gel-based import job. 179 192 */ 180 193 private Job createJob(ItemFactory factory, PluginDefinition plugin, 181 194 File file, 182 String localSampleIdEntryMode, String fractionIdEntryMode, 183 String localSampleId, Project project, String regexPattern)195 String localSampleIdEntryMode, String fractionIdEntryMode, String replicateIdEntryMode, 196 String localSampleId, Project project, String fractionIdRegexPattern, String replicateIdRegexPattern) 184 197 { 185 198 Job job = factory.createJob(plugin, null); … … 205 218 job.setParameterValue("fractionIdEntryMode", fractionIdEntryModeParam, fractionIdEntryMode); 206 219 // 207 StringParameterType regexPatternParam = new StringParameterType(); 208 job.setParameterValue("regexPattern", regexPatternParam, regexPattern); 220 StringParameterType fractionIdRegexPatternParam = new StringParameterType(); 221 job.setParameterValue("fractionIdRegexPattern", fractionIdRegexPatternParam, fractionIdRegexPattern); 222 // 223 StringParameterType replicateIdEntryModeParam = new StringParameterType(); 224 job.setParameterValue("replicateIdEntryMode", replicateIdEntryModeParam, replicateIdEntryMode); 225 // 226 StringParameterType replicateIdRegexPatternParam = new StringParameterType(); 227 job.setParameterValue("replicateIdRegexPattern", replicateIdRegexPatternParam, replicateIdRegexPattern); 209 228 // 210 229 return job; -
trunk/client/servlet/src/org/proteios/gui/form/ImportHitsNonGelWizardStep1Form.java
r4126 r4461 48 48 public final Select<VString> fractionIdEntryModeMenu; 49 49 public final TextField<String> regexPatternF; 50 public final Select<VString> replicateIdEntryModeMenu; 51 public final TextField<String> regexPatternR; 50 52 51 53 … … 114 116 // Optional regex pattern entry field 115 117 regexPatternF = new RegexField(); 116 regexPatternF.setLabel("ImportHitsNonGelWizardRegexPattern ");118 regexPatternF.setLabel("ImportHitsNonGelWizardRegexPatternFractionId"); 117 119 regexPatternF.setValue(".+\\_(.+)\\..+"); 118 120 properties.add(regexPatternF); 121 // Replicate id entry mode menu 122 String replicateIdEntryModeDefault = new String(ReplicateIdEntryModeMenu.GET_REPLICATE_ID_FROM_PEAKLIST_FILE_ANNOTATION); 123 replicateIdEntryModeMenu = new ReplicateIdEntryModeMenu(replicateIdEntryModeDefault); 124 replicateIdEntryModeMenu.setLabel("SelectReplicateIdEntryMode"); 125 properties.add(replicateIdEntryModeMenu); 126 // Optional regex pattern entry field 127 regexPatternR = new ReplicateIdRegexField(); 128 regexPatternR.setLabel("ImportHitsNonGelWizardRegexPatternReplicateId"); 129 regexPatternR.setValue(".+\\_(.+)\\..+"); 130 properties.add(regexPatternR); 119 131 /* 120 132 * Hidden text fields with data -
trunk/plugin/src/org/proteios/plugins/PeakListToHitNonGelPlugin.java
r4416 r4461 82 82 public static final String GET_FRACTION_ID_FROM_PEAKLIST_FILE_NAME = "getFractionIdFromPeaklistFileName"; 83 83 public static final String NO_FRACTION_ID = "noFractionId"; 84 public static final String GET_REPLICATE_ID_FROM_PEAKLIST_FILE_ANNOTATION = "getReplicateIdFromPeaklistFileAnnotation"; 85 public static final String GET_REPLICATE_ID_FROM_PEAKLIST_FILE_NAME = "getReplicateIdFromPeaklistFileName"; 84 86 85 87 @Override … … 112 114 .getValue("fractionIdEntryMode"); 113 115 log.debug("fractionIdEntryMode = \"" + fractionIdEntryMode + "\""); 114 String regexPattern = (String) job.getValue("regexPattern"); 115 log.debug("regexPattern = \"" + regexPattern + "\""); 116 String fractionIdRegexPattern = (String) job.getValue("fractionIdRegexPattern"); 117 log.debug("fractionIdRegexPattern = \"" + fractionIdRegexPattern + "\""); 118 String replicateIdEntryMode = (String) job 119 .getValue("replicateIdEntryMode"); 120 log.debug("replicateIdEntryMode = \"" + replicateIdEntryMode + "\""); 121 String replicateIdRegexPattern = (String) job.getValue("replicateIdRegexPattern"); 122 log.debug("replicateIdRegexPattern = \"" + replicateIdRegexPattern + "\""); 116 123 // 117 124 FilenameParseUtil fpu = new FilenameParseUtil(); … … 171 178 // } 172 179 if (ft != null && (fts.contains(ft))) { 173 // Retrieve replicate ID174 String replicate = fetchReplicateIdFromFileAnnotation(dc, f);175 180 // Attempt to obtain fraction ID from file annotation "fraction". 176 181 String fractionIdFromAnnotation = fetchFractionIdFromFileAnnotation( … … 178 183 // Use regex pattern to parse fraction ID from filename 179 184 String fractionIdFromFilename = null; 180 if ( regexPattern != null && !regexPattern.equals("")) {185 if (fractionIdRegexPattern != null && !fractionIdRegexPattern.equals("")) { 181 186 // Use regex pattern to parse fraction ID from filename 182 187 fractionIdFromFilename = fpu.fetchRegexResult(f.getName(), 183 regexPattern);188 fractionIdRegexPattern); 184 189 } 185 190 log.debug("fraction id from file annotation = \"" … … 235 240 return; 236 241 } 242 // Attempt to obtain replicate ID from file annotation "replicate". 243 String replicateIdFromAnnotation = fetchReplicateIdFromFileAnnotation( 244 dc, f); 245 // Use regex pattern to parse replicate ID from filename 246 String replicateIdFromFilename = null; 247 if (replicateIdRegexPattern != null && !replicateIdRegexPattern.equals("")) { 248 // Use regex pattern to parse replicate ID from filename 249 replicateIdFromFilename = fpu.fetchRegexResult(f.getName(), 250 replicateIdRegexPattern); 251 } 252 log.debug("replicate id from file annotation = \"" 253 + replicateIdFromAnnotation + "\""); 254 log.debug("replicate id from file name = \"" 255 + replicateIdFromFilename + "\""); 256 // Get replicate id, if any 257 String replicate = new String(""); 258 if (replicateIdEntryMode 259 .equals(GET_REPLICATE_ID_FROM_PEAKLIST_FILE_ANNOTATION)) { 260 if (replicateIdFromAnnotation != null) { 261 replicate = replicateIdFromAnnotation; 262 } 263 } else if (replicateIdEntryMode 264 .equals(GET_REPLICATE_ID_FROM_PEAKLIST_FILE_NAME)) { 265 if (replicateIdFromFilename != null) { 266 replicate = replicateIdFromFilename; 267 } 268 } 269 log.info("peak list, replicate id: \"" + replicate 270 + "\" localsample Id: \"" + localSampleId + "\""); 271 // Check that length of replicate ID is not too long 272 if (replicate != null 273 && replicate.length() > Hit.MAX_REPLICATE_ID_LENGTH) { 274 log.debug("Replicate ID = \"" + replicate + "\" is too long (" 275 + replicate.length() + " characters, " 276 + Hit.MAX_REPLICATE_ID_LENGTH + " allowed)."); 277 err.add(new BaseException("Replicate ID = \"" + replicate 278 + "\" is too long (" + replicate.length() 279 + " characters, " + Hit.MAX_REPLICATE_ID_LENGTH 280 + " allowed).")); 281 response.setError("Nothing imported", err); 282 return; 283 } 237 284 // Check if peaklist file already registered for local sample id 238 285 boolean peaklistFileAlreadyRegistered = false; … … 306 353 * @param File file The file to get the annotation for. 307 354 * 308 * @return String The found fractionid, or null if none found.355 * @return String The found replicate id, or null if none found. 309 356 */ 310 357 private String fetchReplicateIdFromFileAnnotation(DbControl dc, File file) {
Note: See TracChangeset
for help on using the changeset viewer.