Changeset 5697
- Timestamp:
- Aug 15, 2011, 8:52:47 AM (12 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/core/DataFileType.java
r5689 r5697 24 24 import java.util.Set; 25 25 26 import net.sf.basedb.core.Transactional.Action;27 26 import net.sf.basedb.core.data.DataFileTypeData; 28 27 import net.sf.basedb.core.query.Expressions; … … 143 142 */ 144 143 public static final String BAM = "assembly.bam"; 145 144 145 /** 146 The external ID for the file type representing 147 scanned microarray image. 148 @since 3.0 149 */ 150 public static final String MICROARRAY_IMAGE = "microarray.image"; 151 146 152 /** 147 153 The maximum length of the file extension that can be stored in the database. -
trunk/src/core/net/sf/basedb/core/DerivedBioAssay.java
r5696 r5697 23 23 24 24 import java.util.Collection; 25 import java.util.Collections; 25 26 import java.util.Date; 26 27 import java.util.HashSet; … … 389 390 public Collection<FileSet> getParentFileSets() 390 391 { 392 DerivedBioAssay parent = getParent(); 391 393 Collection<FileSet> parents = null; 392 // TODO - part of #1153 394 if (parent != null && parent.hasFileSet()) 395 { 396 parents = Collections.singleton(parent.getFileSet()); 397 } 393 398 return parents; 394 399 } -
trunk/src/core/net/sf/basedb/core/Install.java
r5696 r5697 684 684 if (progress != null) progress.display((int)(progressStep*progress_factor), "--Creating clients..."); 685 685 createClient(rootUser, "net.sf.basedb.clients.test", "Test programs", "This client is used by test programs", keyEveryoneUse); 686 createClient(rootUser, "net.sf.basedb.clients.migration", "Migration tool", "This client is used to migrate BASE 1.2.x data to BASE 2", null);687 686 createClient(rootUser, "net.sf.basedb.clients.jobagent", "Job agent client", "This client is used by all job agents", keyJobAgentUse); 688 687 createClient(rootUser, "net.sf.basedb.clients.internal", "Internal", … … 857 856 Item.DERIVEDBIOASSAY, "bam", alignedType 858 857 ); 858 DataFileTypeData scanImageFile = createDataFileType( 859 DataFileType.MICROARRAY_IMAGE, "Microarray image", 860 "Scanned image from a microarray slide.", 861 Item.DERIVEDBIOASSAY, "tif", imageType 862 ); 859 863 860 864 // Platforms and variants -
trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/ScanImporter.java
r5689 r5697 22 22 package net.sf.basedb.plugins.batchimport; 23 23 24 import net.sf.basedb.core.DataFileType; 24 25 import net.sf.basedb.core.DbControl; 25 26 import net.sf.basedb.core.DerivedBioAssay; … … 92 93 ); 93 94 94 protected static final PluginParameter<String> imageNameColumnMapping = new PluginParameter<String>(95 "imageColumnMapping",96 "Image name",97 "Mapping that picks the name the image from the data columns. " +98 "Example: \\Image\\",99 optionalColumnMapping100 );101 102 protected static final PluginParameter<String> imageFormatColumnMapping = new PluginParameter<String>(103 "imageFormatColumnMapping",104 "Image format",105 "Mapping that picks the format of the given image from the data columns. " +106 "The plug-in tries to parse the given format into one of the supported in BASE. " +107 "The image will get format 'unknown' if this isn't specified or has null-value." +108 "The column can either be empty or has one of the values 'TIFF', 'JPEG' or 'Unknown'."+109 "Example: \\Image format\\",110 optionalColumnMapping111 );112 113 protected static final PluginParameter<String> imagePreviewColumnMapping = new PluginParameter<String>(114 "imagePreviewColumnMapping",115 "Image preview",116 "Mapping that picks the preview flag of the given image from the data columns. " +117 "Example: \\Image preview\\",118 optionalColumnMapping119 );120 121 protected static final PluginParameter<String> imageDescriptionColumnMapping = new PluginParameter<String>(122 "imageDescriptionColumnMapping",123 "Image description",124 "Mapping that picks the description of the given image from the data columns. " +125 "Example: \\Image description\\",126 optionalColumnMapping127 );128 129 130 95 public ScanImporter() 131 96 {} … … 153 118 private Mapper hybridizationMapper; 154 119 private Mapper imageFileMapper; 155 private Mapper imageNameMapper;156 private Mapper imageFormatMapper;157 private Mapper imagePreviewMapper;158 private Mapper imageDescriptionMapper;159 120 private String imagesDirectory; 160 121 … … 189 150 parameters.add(hardwareColumnMapping); 190 151 parameters.add(imageFileColumnMapping); 191 parameters.add(imageNameColumnMapping);192 parameters.add(imageFormatColumnMapping);193 parameters.add(imagePreviewColumnMapping);194 parameters.add(imageDescriptionColumnMapping);195 152 parameters.add(permissionTemplateColumnMapping); 196 153 } … … 241 198 hybridizationMapper = getMapper(ffp, (String)job.getValue("hybridizationColumnMapping"), null, null); 242 199 imageFileMapper = getMapper(ffp, (String)job.getValue("imageFileColumnMapping"), null, null); 243 imageNameMapper = getMapper(ffp, (String)job.getValue("imageColumnMapping"), null, null);244 imageFormatMapper = getMapper(ffp, (String)job.getValue("imageFormatColumnMapping"), null, null);245 imagePreviewMapper = getMapper(ffp, (String)job.getValue("imagePreviewColumnMapping"), null, null);246 imageDescriptionMapper = getMapper(ffp, (String)job.getValue("imageDescriptionColumnMapping"), null, null);247 200 imagesDirectory = (String)job.getValue("imagesDirectory"); 248 201 if (imagesDirectory != null && !imagesDirectory.startsWith("/")) … … 291 244 protected void updateMultiLineItem(DbControl dc, DerivedBioAssay scan, FlatFileParser.Data data, int multiLineNum) 292 245 { 293 // TODO (#1153) 294 // Image image = null; 295 File imageFile = null; 296 String imageName = null; 246 297 247 // Get the imagefile 298 if (imageFileMapper != null && imageFileMapper.getValue(data) != null)248 if (imageFileMapper != null) 299 249 { 300 250 String filePath = imageFileMapper.getValue(data); … … 303 253 filePath = imagesDirectory + filePath; 304 254 } 305 imageFile = File.getByPath(dc, new Path(filePath, Path.Type.FILE), false); 306 // image = findImage(dc, scan, imageFile); 307 } 308 if (imageNameMapper != null) 309 { 310 imageName = imageNameMapper.getValue(data); 311 } 312 /* 313 TODO (#1153) 314 else if (image != null) 315 { 316 imageName = image.getName(); 317 } 318 if (image != null) 319 { 320 image.setName(imageName != null ? imageName : scan.getName() + "." + imageFile.getName()); 321 if (imageDescriptionMapper != null) image.setDescription(imageDescriptionMapper.getValue(data)); 322 if (imageFormatMapper != null && imageFormatMapper.getValue(data) != null) image.setFormat(Image.Format.valueOf(imageFormatMapper.getValue(data))); 323 if (imagePreviewMapper != null) image.setPreview(Boolean.getBoolean(imagePreviewMapper.getValue(data))); 324 } 325 */ 255 File imageFile = File.getByPath(dc, new Path(filePath, Path.Type.FILE), false); 256 DataFileType imageType = DataFileType.getByExternalId(dc, DataFileType.MICROARRAY_IMAGE); 257 if (imageFile != null) 258 { 259 scan.getFileSet().setMember(imageFile, imageType); 260 } 261 else 262 { 263 scan.getFileSet().removeMember(imageType); 264 } 265 } 326 266 } 327 267 // ------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.