Changeset 4092
- Timestamp:
- Jan 18, 2008, 2:34:10 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plugins/core/net/sf/basedb/plugins/IlluminaRawDataImporter.java
r4091 r4092 38 38 39 39 40 import net.sf.basedb.core.ArrayDesign; 40 41 import net.sf.basedb.core.BaseException; 41 42 import net.sf.basedb.core.BasicItem; … … 93 94 to an experiment. 94 95 <p> 95 Since the data files doesn't have any coordinate information, the plug-in create 96 fake coordinates like this: block=1, column=1, row=linenumber in file. 97 The linenmbers start with 1 at the first data line, ie. header lines are not counted. 96 Since the data files doesn't have any coordinate information the importer will 97 use one of the following methods. 98 99 <ul> 100 <li> 101 If no array design has been selected or if the array design is using the 102 {@link FeatureIdentificationMethod#COORDINATES} method for identifying features: 103 The plug-in create fake coordinates like this: block=1, column=1, row=linenumber in file. 104 The linenmbers start with 1 at the first data line, ie. header lines are not counted. 105 106 <li> 107 If the array design uses the {@link FeatureIdentificationMethod#POSITION} 108 method for identiyfing features: The plug-in sets the position=line number in file. 109 The linenmbers start with 1 at the first data line, ie. header lines are not counted. 110 111 <li> 112 If the array design uses the {@link FeatureIdentificationMethod#FEATURE_ID} 113 method for identifying features. The plug-in assumes that the feature ID is the 114 same as the reporter ID. 115 </ul> 116 117 <p> 118 NOTE! Since the methods are not conflicting with each other, there will not 119 be an actual check which method to use by this plug-in. We will simple set all 120 values as specified above and let the BASE core handle the identification. 98 121 99 122 @author nicklas … … 129 152 )); 130 153 154 private static final PluginParameter<String> featureIdentificationParameter = 155 new PluginParameter<String>( 156 "featureIdentification", 157 "Identify features by", 158 "Choose which method to use for identifying features. If no value " + 159 "is selected the identification method used on the array design is used: \n\n" + 160 "* COORDINATES: Use auto-generated coordinates (block = 1, column = 1, row = line number in file)\n" + 161 "* POSITION: Use auto-generated position = line number in file\n" + 162 "* FEATURE_ID: Use TargetID (requires that each Target ID only appears once in the file)\n\n" + 163 "NOTE! This parameter has no meaning unless an array design is selected", 164 new StringParameterType(255, null, false, 1, 0, 0, 165 Arrays.asList(new String[] {"COORDINATE", "POSITION", "FEATURE_ID" } )) 166 ); 167 168 131 169 132 170 private static final PluginParameter<String> invalidColumnsErrorParameter = new PluginParameter<String>( … … 257 295 // Associations 258 296 storeValue(job, request, ri.getParameter("experiment")); 297 storeValue(job, request, ri.getParameter("arrayDesign")); 298 storeValue(job, request, featureIdentificationParameter); 259 299 storeValue(job, request, ri.getParameter("scan")); 260 300 storeValue(job, request, ri.getParameter("protocol")); … … 286 326 private DbControl dc; 287 327 private Experiment experiment; 328 private ArrayDesign design; 288 329 private Scan scan; 289 330 private Software software; 290 331 private Protocol protocol; 332 private FeatureIdentificationMethod fiMethod; 291 333 private List<RawBioAssay> rawBioAssays; 292 334 private List<BatchAndMapHolder> holders; … … 371 413 this.headerLines = new LinkedList<Line>(); 372 414 this.experiment = (Experiment)job.getValue("experiment"); 415 this.design = (ArrayDesign)job.getValue("arrayDesign"); 373 416 this.scan = (Scan)job.getValue("scan"); 374 417 this.protocol = (Protocol)job.getValue("protocol"); 375 418 this.software = (Software)job.getValue("software"); 376 419 420 // Feature identification 421 try 422 { 423 String fiTemp = (String)job.getValue("featureIdentification"); 424 fiMethod = FeatureIdentificationMethod.valueOf(fiTemp); 425 } 426 catch (Exception ex) 427 { 428 fiMethod = null; 429 } 377 430 // Setup error handling 378 431 this.nullIfException = "null".equals(getErrorOption("numberFormatError")); … … 431 484 // Need to reload raw bioassay with current DbControl 432 485 rba = RawBioAssay.getById(dc, rba.getId()); 433 RawDataBatcher batcher = rba.getRawDataBatcher( );486 RawDataBatcher batcher = rba.getRawDataBatcher(fiMethod); 434 487 batcher.useNullIfReporterNotFound(nullIfMissingReporter); 435 488 holders.add(new BatchAndMapHolder(batcher, illumina, ffp)); … … 566 619 RawBioAssay rba = RawBioAssay.getNew(dc, generic, illumina); 567 620 rba.setName(arrayName); 621 if (design != null) rba.setArrayDesign(design); 568 622 if (scan != null) rba.setScan(scan); 569 623 if (protocol != null) rba.setProtocol(protocol); … … 619 673 parameters.add(getDecimalSeparatorParameter(null, null, (String)job.getValue(DECIMAL_SEPARATOR))); 620 674 621 // parameters for scan, protocol and software675 // parameters for scan, protocol, software and array design 622 676 dc = sc.newDbControl(); 623 677 List<Scan> scans = getItems(dc, Scan.getQuery()); … … 634 688 ) 635 689 ); 690 List<ArrayDesign> designs = getItems(dc, ArrayDesign.getQuery(), 691 Restrictions.gt( 692 Hql.property("numDbFeatures"), 693 Expressions.integer(0) 694 ) 695 ); 636 696 637 697 boolean hasAssociations = 638 698 context.getItem() == Item.EXPERIMENT || scans.size() > 0 || 639 protocols.size() > 0 || software.size() > 0 ;699 protocols.size() > 0 || software.size() > 0 || designs.size() > 0; 640 700 641 701 if (hasAssociations) … … 651 711 new ItemParameterType<Experiment>(Experiment.class, null, true, 1, null) 652 712 )); 713 } 714 if (!designs.isEmpty()) 715 { 716 parameters.add(new PluginParameter<ArrayDesign>( 717 "arrayDesign", 718 "Array design", 719 "The imported raw bioassays will be linked to the selected array design.", 720 new ItemParameterType<ArrayDesign>(ArrayDesign.class, null, false, 1, designs) 721 )); 722 parameters.add(featureIdentificationParameter); 653 723 } 654 724 if (!scans.isEmpty())
Note: See TracChangeset
for help on using the changeset viewer.