Changeset 5652
- Timestamp:
- Jun 10, 2011, 3:31:58 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 10 deleted
- 56 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/config/dist/ehcache.xml
r5642 r5652 287 287 /> 288 288 <cache 289 name="net.sf.basedb.core.data.ScanData"290 maxElementsInMemory="100"291 eternal="false"292 timeToIdleSeconds="3600"293 timeToLiveSeconds="3600"294 overflowToDisk="false"295 />296 <cache297 289 name="net.sf.basedb.core.data.TagData" 298 290 maxElementsInMemory="100" -
trunk/config/dist/hibernate.cfg.xml
r5642 r5652 175 175 /> 176 176 <class-cache 177 class="net.sf.basedb.core.data.ScanData"178 usage="nonstrict-read-write"179 />180 <class-cache181 177 class="net.sf.basedb.core.data.TagData" 182 178 usage="nonstrict-read-write" -
trunk/src/clients/web/net/sf/basedb/clients/web/PermissionUtil.java
r5642 r5652 161 161 Item.PLATEEVENT, Item.PLATEEVENTTYPE, Item.WELL, 162 162 Item.ARRAYDESIGNBLOCK, Item.FEATURE, Item.ARRAYDESIGNPLATE, 163 Item. IMAGE, Item.SPOTIMAGES, Item.RAWDATA,163 Item.SPOTIMAGES, Item.RAWDATA, 164 164 Item.BIOASSAYSET, Item.BIOASSAY, Item.TRANSFORMATION, Item.EXTRAVALUE, 165 165 Item.VIRTUALDB, Item.DATACUBE, Item.DATACUBELAYER, Item.DATACUBECOLUMN, Item.DATACUBEFILTER, … … 198 198 Item.BIOSOURCE, Item.SAMPLE, Item.EXTRACT, Item.TAG, 199 199 Item.BIOMATERIALLIST, Item.BIOPLATE, Item.BIOPLATETYPE, Item.BIOPLATEEVENT, Item.BIOPLATEEVENTTYPE, 200 Item.PHYSICALBIOASSAY, Item. SCAN, Item.RAWBIOASSAY, Item.EXPERIMENT, Item.FORMULA200 Item.PHYSICALBIOASSAY, Item.DERIVEDBIOASSAYSET, Item.RAWBIOASSAY, Item.EXPERIMENT, Item.FORMULA 201 201 }) 202 202 ); -
trunk/src/clients/web/net/sf/basedb/clients/web/extensions/edit/EditUtil.java
r5642 r5652 63 63 Item.PLATEGEOMETRY, Item.PLATEMAPPING, 64 64 Item.DIRECTORY, Item.FILE, Item.FILESERVER, Item.PROJECT, Item.PERMISSIONTEMPLATE, 65 Item.PHYSICALBIOASSAY, Item. SCAN, Item.IMAGE, Item.RAWBIOASSAY,65 Item.PHYSICALBIOASSAY, Item.DERIVEDBIOASSAYSET, Item.RAWBIOASSAY, 66 66 Item.FORMULA, Item.REPORTER, Item.REPORTERLIST, 67 67 Item.EXPERIMENT, Item.TRANSFORMATION, Item.BIOASSAYSET, Item.BIOASSAY, -
trunk/src/clients/web/net/sf/basedb/clients/web/extensions/toolbar/ToolbarUtil.java
r5642 r5652 60 60 Item.RAWBIOASSAY, Item.RAWDATA, Item.FORMULA, 61 61 Item.REPORTER, Item.REPORTERLIST, Item.REPORTERSCORE, 62 Item. SCAN, Item.IMAGE, Item.PHYSICALBIOASSAY,62 Item.DERIVEDBIOASSAYSET, Item.PHYSICALBIOASSAY, 63 63 Item.BIOSOURCE, Item.SAMPLE, Item.EXTRACT, 64 64 Item.TAG, Item.BIOMATERIALEVENT, -
trunk/src/clients/web/net/sf/basedb/clients/web/resources/common.properties
r5642 r5652 84 84 item.physicalbioassay Physical bioassay 85 85 item.physicalbioassay+ Physical bioassays 86 item. scan Scan87 item. scan+ Scans88 item. image Image89 item. image+ Images86 item.derivedbioassayset Derived bioassay set 87 item.derivedbioassayset+ Derived bioassay sets 88 item.derivedbioassay Derived bioassay 89 item.derivedbioassay+ Derived bioassays 90 90 item.rawbioassay Raw bioassay 91 91 item.rawbioassay+ Raw bioassays -
trunk/src/clients/web/net/sf/basedb/clients/web/resources/menu.properties
r5642 r5652 87 87 physicalbioassays.tooltip.1 Manage physical bioassays 88 88 physicalbioassays.tooltip.0 You do not have permission to manage physical bioassays 89 scans.tooltip.1 Manage scans90 scans.tooltip.0 You do not have permission to manage scans91 89 rawbioassays.tooltip.1 Manage raw bioassays 92 90 rawbioassays.tooltip.0 You do not have permission to manage raw bioassays -
trunk/src/core/common-queries.xml
r5642 r5652 855 855 </query> 856 856 857 <query id="GET_ SCANS_FOR_PROTOCOL" type="HQL">858 <sql> 859 SELECT {1} 860 FROM ScanData sc861 WHERE sc.protocol = :protocol862 </sql> 863 <description> 864 A Hibernate query that gets scans857 <query id="GET_DERIVEDBIOASSAYSET_FOR_PROTOCOL" type="HQL"> 858 <sql> 859 SELECT {1} 860 FROM DerivedBioAssaySetData dbas 861 WHERE dbas.protocol = :protocol 862 </sql> 863 <description> 864 A Hibernate query that gets derived bioassay sets 865 865 using a protocol. 866 866 </description> … … 917 917 </query> 918 918 919 <query id="GET_ SCANS_FOR_SCANNER" type="HQL">920 <sql> 921 SELECT {1}922 FROM ScanData scn923 WHERE scn.scanner = :scanner924 </sql> 925 <description> 926 A Hibernate query that gets scans which927 uses a given scanner (hardware).919 <query id="GET_DERIVEDBIOASSAYSETS_FOR_HARDWARE" type="HQL"> 920 <sql> 921 SELECT {1} 922 FROM DerivedBioAssaySetData dbas 923 WHERE dbas.hardware = :hardware 924 </sql> 925 <description> 926 A Hibernate query that gets derived bioassays which 927 uses a given hardware. 928 928 </description> 929 929 </query> … … 999 999 </description> 1000 1000 </query> 1001 1002 <query id="GET_DERIVEDBIOASSAYSETS_FOR_SOFTWARE" type="HQL"> 1003 <sql> 1004 SELECT {1} 1005 FROM DerivedBioAssaySetData dbas 1006 WHERE dbas.software = :software 1007 </sql> 1008 <description> 1009 A Hibernate query that gets the derived bioassay sets 1010 using a given software. 1011 </description> 1012 </query> 1013 1001 1014 1002 1015 <query id="GET_ANNOTATIONS_FOR_ANNOTATIONTYPE" type="HQL"> … … 1356 1369 </query> 1357 1370 1358 <query id="GET_SCANS_FOR_HYBRIDIZATION" type="HQL"> 1359 <sql> 1360 SELECT {1} 1361 FROM ScanData scn 1362 WHERE scn.hybridization = :hybridization 1363 </sql> 1364 <description> 1365 A Hibernate query that gets scans 1366 that uses a specific hybridization. 1371 <query id="GET_ROOT_DERIVEDBIOASSAYSETS_FOR_PHYSICALBIOASSAY" type="HQL"> 1372 <sql> 1373 SELECT {1} 1374 FROM DerivedBioAssaySetData dbs 1375 WHERE dbs.physicalBioAssay = :bioAssay 1376 AND dbs.parent is null 1377 </sql> 1378 <description> 1379 A Hibernate query that gets root derived bioassay sets 1380 created for a specific physical bioassay. 1367 1381 </description> 1368 1382 </query> -
trunk/src/core/net/sf/basedb/core/DataFileType.java
r5630 r5652 129 129 */ 130 130 public static final String MEV_TDMS = "mev.tdms"; 131 132 /** 133 The external ID for the file type representing 134 a SAM (Sequence Alignment/Map) file. 135 @since 3.0 136 */ 137 public static final String SAM = "assembly.sam"; 138 139 /** 140 The external ID for the file type representing 141 a BAM (Binary Sequence Alignment/Map) file. 142 @since 3.0 143 */ 144 public static final String BAM = "assembly.bam"; 131 145 132 146 /** -
trunk/src/core/net/sf/basedb/core/File.java
r5630 r5652 164 164 */ 165 165 public static final String EXTRAVALUE_DATA = "net.sf.basedb.core.FileType.EXTRAVALUE_DATA"; 166 167 /** 168 The id for the <code>FileType</code> item representing a 169 file containing aligned sequence data. 170 @since 3.0 171 */ 172 public static final String ALIGNED_SEQUENCE = "net.sf.basedb.core.FileType.ALIGNED_SEQUENCE"; 166 173 167 174 -
trunk/src/core/net/sf/basedb/core/Hardware.java
r5651 r5652 114 114 defaultId = PRINT_ROBOT; 115 115 } 116 else if (itemType == Item.SCAN)117 {118 defaultId = SCANNER;119 }120 116 return defaultId; 121 117 } … … 231 227 Check if: 232 228 <ul> 233 <li>a {@link Scan} is linked to this hardware229 <li>a {@link DerivedBioAssaySet} is linked to this hardware 234 230 <li>an {@link ArrayBatch} is linked to this hardware 235 231 <li>a {@link BioMaterialEvent} is linked to this hardware … … 249 245 { 250 246 org.hibernate.Query q = HibernateUtil.getPredefinedQuery(session, 251 "GET_ SCANS_FOR_SCANNER", "count(*)");252 /* 253 SELECT {1} 254 FROM ScanData sc255 WHERE sc.scanner = :scanner256 */ 257 q.setEntity(" scanner", this.getData());247 "GET_DERIVEDBIOASSAYSETS_FOR_HARDWARE", "count(*)"); 248 /* 249 SELECT {1} 250 FROM DerivedBioAssaySetData dbas 251 WHERE dbas.hardware = :hardware 252 */ 253 q.setEntity("hardware", this.getData()); 258 254 used = HibernateUtil.loadData(Long.class, q) > 0; 259 255 } … … 299 295 Get all: 300 296 <ul> 301 <li>{@link Scan}:s with this hardware297 <li>{@link DerivedBioAssaySet}:s with this hardware 302 298 <li>{@link ArrayBatch}:s with this hardware 303 299 <li>{@link BioMaterial}:s and {@link PhysicalBioAssay}:s with this hardware … … 312 308 org.hibernate.Session session = getDbControl().getHibernateSession(); 313 309 314 // Scans310 // Derived bioassay sets 315 311 org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session, 316 "GET_ SCANS_FOR_SCANNER", "scn.id");317 /* 318 SELECT {1} 319 FROM ScanData scn320 WHERE sc.scanner = :scanner321 */ 322 query.setEntity(" scanner", this.getData());323 addUsingItems(using, Item. SCAN, query);312 "GET_DERIVEDBIOASSAYSETS_FOR_HARDWARE", "dbas.id"); 313 /* 314 SELECT {1} 315 FROM DerivedBioAssaySetData dbas 316 WHERE dbas.hardware = :hardware 317 */ 318 query.setEntity("hardware", this.getData()); 319 addUsingItems(using, Item.DERIVEDBIOASSAYSET, query); 324 320 325 321 // Array batches -
trunk/src/core/net/sf/basedb/core/Install.java
r5645 r5652 368 368 // Hybridization, raw data and experiments 369 369 createRoleKey(Item.PHYSICALBIOASSAY, "Physical bioassays", "Gives access to physical bioassays", users_create); 370 createRoleKey(Item. SCAN, "Scans", "Gives access to scan", users_create);370 createRoleKey(Item.DERIVEDBIOASSAYSET, "Derived bioassay sets", "Gives access to derived bioassay sets", users_create); 371 371 createRoleKey(Item.RAWBIOASSAY, "Raw bioassays", "Gives access to raw bioassays", users_create); 372 372 createRoleKey(Item.EXPERIMENT, "Experiments", "Gives access to experiments", users_create); … … 436 436 ItemSubtypeData spotDataType = createItemSubtype(Item.FILE, File.SPOT_DATA, "Spot data", "Analysed bioassay set data"); 437 437 ItemSubtypeData extraValueType = createItemSubtype(Item.FILE, File.EXTRAVALUE_DATA, "Extra value data", "Analysed extra values"); 438 ItemSubtypeData alignedType = createItemSubtype(Item.FILE, File.ALIGNED_SEQUENCE, "Aligned sequence data", "Files containsing sequenced data aligned against a reference data set."); 438 439 439 440 // Protocol subtypes … … 450 451 "Sequencing", "Protocol used while sequencing", protocolFileType); 451 452 createItemSubtype(Item.PROTOCOL, Protocol.PRINTING, "Printing", "Protocols used for printing a batch of array slides.", protocolFileType); 452 createItemSubtype(Item.PROTOCOL, Protocol.SCANNING, "Scanning", "Protocols used for scanning microarray images.", protocolFileType); 453 ItemSubtypeData scanningProtocol = createItemSubtype(Item.PROTOCOL, Protocol.SCANNING, 454 "Scanning", "Protocols used for scanning microarray images.", protocolFileType); 453 455 createItemSubtype(Item.PROTOCOL, Protocol.FEATURE_EXTRACTION, "Feature extraction", "Protocols used for extracting features from microarray images.", protocolFileType); 454 456 … … 462 464 463 465 // Software subtypes 464 ItemSubtypeData feature = createItemSubtype(Item.SOFTWARE, Software.FEATURE_EXTRACTION, "Feature extraction", "Extracts features from microarray images."); 466 ItemSubtypeData featureExtraction = createItemSubtype(Item.SOFTWARE, Software.FEATURE_EXTRACTION, 467 "Feature extraction", "Extracts expression data from a source such as microarray images or aligned sequences."); 468 ItemSubtypeData alignmentSoftware = createItemSubtype(Item.SOFTWARE, Software.ALIGNMENT, 469 "Alignment", "Aligns sequenced data against a reference sequence database."); 465 470 466 471 // Tag subtypes … … 471 476 472 477 // Biomaterial subtypes 473 ItemSubtypeData labeledExtract = createItemSubtype(Item.EXTRACT, Extract.LABELED, "Labeled extract",474 " A labeled extract is an extract which has been tagged with a label",478 ItemSubtypeData labeledExtract = createItemSubtype(Item.EXTRACT, Extract.LABELED, 479 "Labeled extract", "A labeled extract is an extract which has been tagged with a label", 475 480 labelTag, labelingProtocol); 476 ItemSubtypeData library = createItemSubtype(Item.EXTRACT, Extract.LIBRARY, "Library",477 " An extract that has been prepared with an adaptor sequence before sequencing",481 ItemSubtypeData library = createItemSubtype(Item.EXTRACT, Extract.LIBRARY, 482 "Library", "An extract that has been prepared with an adaptor sequence before sequencing", 478 483 barcodeTag, libraryPreparation); 479 484 480 485 // Physical bioassay subtypes 481 createItemSubtype(Item.PHYSICALBIOASSAY, PhysicalBioAssay.HYBRIDIZATION, "Hybridization", 482 "", hybProtocol, hybStation, labeledExtract); 483 createItemSubtype(Item.PHYSICALBIOASSAY, PhysicalBioAssay.FLOW_CELL, "Flow cell", 484 "", sequencingProtocol, sequencer, library); 486 ItemSubtypeData hybridization = createItemSubtype(Item.PHYSICALBIOASSAY, PhysicalBioAssay.HYBRIDIZATION, 487 "Hybridization", "A bioassay representing a microarray slide with labeled extracts.", 488 hybProtocol, hybStation, labeledExtract); 489 ItemSubtypeData flowCell = createItemSubtype(Item.PHYSICALBIOASSAY, PhysicalBioAssay.FLOW_CELL, 490 "Flow cell", "A bioassay representing a flow cell with extracts.", library); 491 492 // Derived bioassay set subtypes 493 createItemSubtype(Item.DERIVEDBIOASSAYSET, DerivedBioAssaySet.SCAN, 494 "Scan", "A hybridization that has been scanned to produce one or more images.", 495 hybridization, scanner, scanningProtocol); 496 createItemSubtype(Item.DERIVEDBIOASSAYSET, DerivedBioAssaySet.SEQUENCED, 497 "Sequenced", "A flow cell that has been sequenced.", 498 flowCell, sequencer, sequencingProtocol); 499 createItemSubtype(Item.DERIVEDBIOASSAYSET, DerivedBioAssaySet.ASSEMBLY, 500 "Assembly", "A data set of sequences that has been aligned against a reference database", 501 alignmentSoftware); 485 502 486 503 // Hardware … … 503 520 progressStep++; 504 521 if (progress != null) progress.display((int)(progressStep*progress_factor), "--Creating software..."); 505 createSoftware("BZScan", null, null, feature, rootUser, keyEveryoneUse); 506 createSoftware("AIDA", null, null, feature, rootUser, keyEveryoneUse); 507 createSoftware("GenePix Pro", "6.0", null, feature, rootUser, keyEveryoneUse); 508 createSoftware("ImaGene", null, null, feature, rootUser, keyEveryoneUse); 509 createSoftware("TIGR Spotfinder", null, null, feature, rootUser, keyEveryoneUse); 510 createSoftware("Agilent Feature Extraction Software", "8.5", null, feature, rootUser, keyEveryoneUse); 511 createSoftware("ChipSkipper", null, null, feature, rootUser, keyEveryoneUse); 512 createSoftware("GeneTAC", null, null, feature, rootUser, keyEveryoneUse); 513 createSoftware("ScanArray", null, null, feature, rootUser, keyEveryoneUse); 514 createSoftware("Affymetrix GeneChip Software", "1.2", null, feature, rootUser, keyEveryoneUse); 515 createSoftware("Illumina BeadStudio", null, null, feature, rootUser, keyEveryoneUse); 522 // Feature extraction 523 createSoftware("BZScan", null, null, featureExtraction, rootUser, keyEveryoneUse); 524 createSoftware("AIDA", null, null, featureExtraction, rootUser, keyEveryoneUse); 525 createSoftware("GenePix Pro", "6.0", null, featureExtraction, rootUser, keyEveryoneUse); 526 createSoftware("ImaGene", null, null, featureExtraction, rootUser, keyEveryoneUse); 527 createSoftware("TIGR Spotfinder", null, null, featureExtraction, rootUser, keyEveryoneUse); 528 createSoftware("Agilent Feature Extraction Software", "8.5", null, featureExtraction, rootUser, keyEveryoneUse); 529 createSoftware("ChipSkipper", null, null, featureExtraction, rootUser, keyEveryoneUse); 530 createSoftware("GeneTAC", null, null, featureExtraction, rootUser, keyEveryoneUse); 531 createSoftware("ScanArray", null, null, featureExtraction, rootUser, keyEveryoneUse); 532 createSoftware("Affymetrix GeneChip Software", "1.2", null, featureExtraction, rootUser, keyEveryoneUse); 533 createSoftware("Illumina BeadStudio", null, null, featureExtraction, rootUser, keyEveryoneUse); 534 createSoftware("Cufflinks", null, null, featureExtraction, rootUser, keyEveryoneUse); 535 // Alignment 536 createSoftware("Bowtie", null, null, alignmentSoftware, rootUser, keyEveryoneUse); 537 createSoftware("TopHat", null, null, alignmentSoftware, rootUser, keyEveryoneUse); 516 538 517 539 // Item subtypes … … 585 607 createMimeType("text/plain", "Biorobotics TAM format", "tam", printMapType, true); 586 608 createMimeType("text/plain", "Molecularware MWBR format", "mvbr", printMapType, true); 609 createMimeType("text/plain", "Sequence Alignment/Map", "sam", null, true); 610 createMimeType("application/octet-stream", "Binary Sequence Alignment/Map", "bam", null, false); 587 611 588 612 // Plate geometries … … 830 854 "A MeV Tab-Delimited Multiple Sample file", 831 855 Item.BIOASSAYSET, null, spotDataType); 856 DataFileTypeData samFile = createDataFileType( 857 DataFileType.SAM, "Sequence Alignment/Map", 858 "SAM format is a generic format for storing large nucleotide sequence alignments.", 859 Item.DERIVEDBIOASSAY, "sam", alignedType 860 ); 861 DataFileTypeData bamFile = createDataFileType( 862 DataFileType.BAM, "Compressed Sequence Alignment/Map", 863 "BAM format is a BGZF-compressed SAM file.", 864 Item.DERIVEDBIOASSAY, "bam", alignedType 865 ); 832 866 833 867 // Platforms and variants -
trunk/src/core/net/sf/basedb/core/Item.java
r5642 r5652 426 426 PHYSICALBIOASSAY(261, "Physical bioassay", "pba", PhysicalBioAssay.class, PhysicalBioAssayData.class, DefinedPermissions.shareable, 427 427 350), 428 /** 429 The item is a {@link Scan}. 430 */ 431 SCAN(262, "Scan", "scn", Scan.class, ScanData.class, DefinedPermissions.shareable, 428 429 /** 430 The item is a {@link DerivedBioAssaySet}. 431 */ 432 DERIVEDBIOASSAYSET(267, "Derived bioassay set", "dbs", DerivedBioAssaySet.class, DerivedBioAssaySetData.class, DefinedPermissions.shareable, 432 433 330), 433 /** 434 The item is an {@link Image}. 435 */ 436 IMAGE(263, "Image", "img", Image.class, ImageData.class, null, 437 340), 434 435 /** 436 The item is a {@link DerivedBioAssay}. 437 */ 438 DERIVEDBIOASSAY(268, "Derived bioassay", "dby", DerivedBioAssay.class, DerivedBioAssayData.class, null, 439 330), 440 438 441 /** 439 442 The item is a {@link RawBioAssay}. -
trunk/src/core/net/sf/basedb/core/PhysicalBioAssay.java
r5642 r5652 94 94 { 95 95 PhysicalBioAssay h = dc.newItem(PhysicalBioAssay.class); 96 h.setName("New hybridization");96 h.setName("New physical bioassay"); 97 97 h.setSize(1); 98 98 h.setBioPlateEventParticipant(master); … … 130 130 } 131 131 132 133 132 private BioMaterialEvent creationEvent; 134 133 private BioPlateEventParticipant bioPlateEventParticipant; … … 259 258 Check that: 260 259 <ul> 261 <li>No {@link Scan}:s use the hybridization260 <li>No {@link DerivedBioAssaySet}:s use the physical bioassay 262 261 </ul> 263 262 */ … … 265 264 throws BaseException 266 265 { 267 return count Scans() > 0 || super.isUsed();266 return countRootDerivedBioAssaySets() > 0 || super.isUsed(); 268 267 } 269 268 /** 270 269 Get all: 271 270 <ul> 272 <li> {@link Scan}:s created from this hybridization271 <li>(root) {@link DerivedBioAssaySet}:s created from this physical bioassay 273 272 <ul> 274 273 @since 2.2 … … 280 279 org.hibernate.Session session = getDbControl().getHibernateSession(); 281 280 org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session, 282 "GET_ SCANS_FOR_HYBRIDIZATION", "scn.id");281 "GET_ROOT_DERIVEDBIOASSAYSETS_FOR_PHYSICALBIOASSAY", "dbs.id"); 283 282 /* 284 283 SELECT {1} 285 FROM ScanData scn 286 WHERE scn.hybridization = :hybridization 284 FROM DerivedBioAssaySetData dbs 285 WHERE dbs.physicalBioAssay = :bioAssay 286 AND dbs.creationEvent.parent is null 287 287 */ 288 query.setEntity(" hybridization", this.getData());289 addUsingItems(using, Item. SCAN, query);288 query.setEntity("bioAssay", this.getData()); 289 addUsingItems(using, Item.DERIVEDBIOASSAYSET, query); 290 290 return using; 291 291 } … … 457 457 458 458 /** 459 Create a new {@link Scan} from this hybridization. 460 461 @return The new <code>Scan</code> item 462 @throws PermissionDeniedException If the logged in user doesn't have 463 use permission for the hybridzation 464 @throws BaseException If there is another error 465 */ 466 public Scan newScan() 467 throws PermissionDeniedException, BaseException 468 { 469 Scan scn = Scan.getNew(getDbControl(), this); 470 return scn; 471 } 472 473 /** 474 Get a query that returns all scans created from this 475 hybridization. 459 Get a query that returns all root derived bioassay sets created from this 460 physical bioassay. 476 461 @return An {@link ItemQuery} object 477 462 */ 478 public ItemQuery< Scan> getScans()479 { 480 ItemQuery< Scan> query = Scan.getQuery();463 public ItemQuery<DerivedBioAssaySet> getRootDerivedBioAssaySets() 464 { 465 ItemQuery<DerivedBioAssaySet> query = DerivedBioAssaySet.getQuery(); 481 466 query.restrictPermanent( 482 467 Restrictions.eq( 483 Hql.property(" hybridization"),468 Hql.property("physicalBioAssay"), 484 469 Hql.entity(this) 485 470 ) 486 471 ); 472 query.restrictPermanent(Restrictions.eq(Hql.property("parent"), null)); 487 473 return query; 488 474 } 489 475 490 476 /** 491 Counts all scans that have been created from this hybridization. The count492 includes scans that the logged in user doesn't have access to.493 @return The number of scans494 @throws BaseException If the scans could not be counted.477 Counts all root derived bioassay sets that have been created from this physical bioassay. 478 The count includes bioassay sets that the logged in user doesn't have access to. 479 @return The number of root bioassay sets 480 @throws BaseException If the bioassay sets could not be counted. 495 481 */ 496 public long count Scans()482 public long countRootDerivedBioAssaySets() 497 483 throws BaseException 498 484 { 499 485 org.hibernate.Session session = getDbControl().getHibernateSession(); 500 486 org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session, 501 "GET_ SCANS_FOR_HYBRIDIZATION", "count(*)");487 "GET_ROOT_DERIVEDBIOASSAYSETS_FOR_PHYSICALBIOASSAY", "count(*)"); 502 488 /* 503 489 SELECT {1} 504 FROM ScanData scn 505 WHERE scn.hybridization = :hybridization 490 FROM DerivedBioAssaySetData dbs 491 WHERE dbs.physicalBioAssay = :bioAssay 492 AND dbs.parent is null 506 493 */ 507 query.setEntity(" hybridization", this.getData());494 query.setEntity("bioAssay", this.getData()); 508 495 return HibernateUtil.loadData(Long.class, query); 509 496 } -
trunk/src/core/net/sf/basedb/core/Project.java
r5650 r5652 771 771 } 772 772 773 BasicData findDefaultRelatedData(DbControl dc, Subtypable item, Item relatedItemType, boolean strict) 774 { 775 ItemSubtype relatedSubtype = ItemSubtype.getRelatedSubtype(dc, item, relatedItemType); 776 if (relatedSubtype == null) return null; 777 778 return findDefaultData(relatedItemType, relatedSubtype.getData(), strict); 779 } 780 773 781 BasicData findDefaultData(DbControl dc, String subtypeId, boolean strict) 774 782 { … … 781 789 Find a default item in this project of the given item type (required) 782 790 and subtype (optional). If a subtype is given, this method first try to 783 match exactly. If no item is found, and strict is false, a second attempt is made 784 to match against items without subtype. If more than one 785 item matches the critera, the first one found is returned. 791 match exactly. If no item is found, and strict is false, a second attempt 792 is made to match against items WITHOUT subtype (items with a different 793 subtype are never matched). If more than one item matches the critera, 794 the first one found is returned. 786 795 787 796 @param itemType The main item type of the item we are looking for 788 797 @param subtype The subtype of the item we are looking for (optional) 789 @param strict 798 @param strict TRUE if the subtype must match 790 799 @since 3.0 791 800 */ -
trunk/src/core/net/sf/basedb/core/Protocol.java
r5651 r5652 156 156 { 157 157 defaultId = PRINTING; 158 }159 else if (itemType == Item.SCAN)160 {161 defaultId = SCANNING;162 158 } 163 159 else if (itemType == Item.RAWBIOASSAY) … … 312 308 <li>a {@link PlateEvent} 313 309 <li>an {@link ArrayBatch} 314 <li>a {@link Scan}310 <li>a {@link DerivedBioAssay} 315 311 <li>a {@link RawBioAssay} 316 312 </ul> … … 361 357 { 362 358 org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session, 363 "GET_ SCANS_FOR_PROTOCOL", "count(*)");364 /* 365 SELECT {1} 366 FROM ScanData sc367 WHERE sc.protocol = :protocol359 "GET_DERIVEDBIOASSAYSET_FOR_PROTOCOL", "count(*)"); 360 /* 361 SELECT {1} 362 FROM DerivedBioAssaySetData dbas 363 WHERE dbas.protocol = :protocol 368 364 */ 369 365 query.setEntity("protocol", this.getData()); … … 390 386 <li>a {@link Plate}:s using this protocol 391 387 <li>an {@link ArrayBatch}:s using this protocol 392 <li>a {@link Scan}:s using this protocol388 <li>a {@link DerivedBioAssaySet}:s using this protocol 393 389 <li>a {@link RawBioAssay}:s using this protocol 394 390 <ul> … … 447 443 // Scans 448 444 query = HibernateUtil.getPredefinedQuery(session, 449 "GET_ SCANS_FOR_PROTOCOL", "sc.id");450 /* 451 SELECT {1} 452 FROM ScanData sc453 WHERE sc.protocol = :protocol445 "GET_DERIVEDBIOASSAYSET_FOR_PROTOCOL", "dbas.id"); 446 /* 447 SELECT {1} 448 FROM DerivedBioAssaySetData dbas 449 WHERE dbas.protocol = :protocol 454 450 */ 455 451 query.setEntity("protocol", this.getData()); 456 addUsingItems(using, Item. SCAN, query);452 addUsingItems(using, Item.DERIVEDBIOASSAYSET, query); 457 453 458 454 // Raw bioassays -
trunk/src/core/net/sf/basedb/core/RawBioAssay.java
r5650 r5652 56 56 /** 57 57 A rawbioassay represents the raw data generated from a single 58 {@link Scan}. A raw bioassay must have a {@link RawDataType}58 {@link DerivedBioAssay}. A raw bioassay must have a {@link RawDataType} 59 59 which specifies the data columns generated by the {@link Software}. 60 60 <p> … … 237 237 try 238 238 { 239 if (getData().get Scan() != null) annotatable.add(getScan());239 if (getData().getParent() != null) annotatable.add(getParent()); 240 240 } 241 241 catch (PermissionDeniedException ex) … … 612 612 } 613 613 /** 614 Set the hybridization array number this raw bioassay is linked to. The value should be615 between 1 and the number of arrays specified by the hybridization,616 {@link PhysicalBioAssay#get NumArrays()}.614 Set the array number on the physical bioassay this raw bioassay is linked to. 615 The value should be between 1 and the size specified by the physical bioassay 616 {@link PhysicalBioAssay#getSize()}. 617 617 @param arrayNum A value > 0 618 618 @throws NumberOutOfRangeException If the value is <=0 … … 627 627 628 628 /** 629 Get the {@link Scan} this raw bioassay is created from.630 631 @return The <code> Scan</code> item or null if not known629 Get the {@link DerivedBioAssay} this raw bioassay is created from. 630 631 @return The <code>DerivedBioAssay</code> item or null if not known 632 632 @throws PermissionDeniedException If the logged in user doesn't have 633 633 read permission for the scanner 634 634 @throws BaseException If there is another error. 635 */ 636 public Scan getScan() 635 @since 3.0 636 */ 637 public DerivedBioAssay getParent() 637 638 throws PermissionDeniedException, BaseException 638 639 { 639 return getDbControl().getItem( Scan.class, getData().getScan());640 } 641 642 /** 643 Set the {@link Scan} this raw bioassay is created from.644 645 @param scan The scanor null if not known640 return getDbControl().getItem(DerivedBioAssay.class, getData().getParent()); 641 } 642 643 /** 644 Set the {@link DerivedBioAssay} this raw bioassay is created from. 645 646 @param parent The parent bioassay or null if not known 646 647 @throws PermissionDeniedException If the logged in user doesn't have 647 648 write permission for the raw bioassay use permission for the scan 648 649 @throws BaseException If there is another error 649 */ 650 public void setScan(Scan scan) 650 @since 3.0 651 */ 652 public void setParent(DerivedBioAssay parent) 651 653 throws PermissionDeniedException 652 654 { 653 655 checkPermission(Permission.WRITE); 654 if ( scan != null) scan.checkPermission(Permission.USE);655 getData().set Scan(scan == null ? null : scan.getData());656 if (parent != null) parent.checkPermission(Permission.USE); 657 getData().setParent(parent == null ? null : parent.getData()); 656 658 } 657 659 -
trunk/src/core/net/sf/basedb/core/Software.java
r5651 r5652 57 57 public static final String FEATURE_EXTRACTION = "net.sf.basedb.core.SoftwareType.FEATURE_EXTRACTION"; 58 58 59 /** 60 The id for the <code>SoftwareType</code> item representing software 61 used for aligning sequenced data against a known reference database. 62 @since 3.0 63 */ 64 public static final String ALIGNMENT = "net.sf.basedb.core.SoftwareType.ALIGNMENT"; 65 59 66 60 67 /** … … 196 203 <ul> 197 204 <li>a RawBioAssay was created with this software 205 <li>a DerivedBioassaySet was created with this software 198 206 </ul> 199 207 */ … … 203 211 { 204 212 org.hibernate.Session session = getDbControl().getHibernateSession(); 205 org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session, 206 "GET_RAWBIOASSAYS_FOR_SOFTWARE", "count(*)"); 207 /* 208 SELECT {1} 209 FROM RawBioAssay rba 210 WHERE rba.software = :software 211 */ 212 query.setEntity("software", this.getData()); 213 return HibernateUtil.loadData(Long.class, query) > 0 || super.isUsed(); 213 boolean used = false; 214 if (!used) 215 { 216 org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session, 217 "GET_DERIVEDBIOASSAYSETS_FOR_SOFTWARE", "count(*)"); 218 /* 219 SELECT {1} 220 FROM DerivedBioAssaySetData dbas 221 WHERE dbas.software = :software 222 */ 223 query.setEntity("software", this.getData()); 224 used = HibernateUtil.loadData(Long.class, query) > 0; 225 } 226 if (!used) 227 { 228 org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session, 229 "GET_RAWBIOASSAYS_FOR_SOFTWARE", "count(*)"); 230 /* 231 SELECT {1} 232 FROM RawBioAssay rba 233 WHERE rba.software = :software 234 */ 235 query.setEntity("software", this.getData()); 236 used = HibernateUtil.loadData(Long.class, query) > 0; 237 } 238 return used || super.isUsed(); 214 239 } 215 240 /** … … 217 242 <ul> 218 243 <li>{@link RawBioAssay}:s created with this software 244 <li>{@link DerivedBioAssaySet}: created with this software 219 245 <ul> 220 246 @since 2.2 … … 234 260 query.setEntity("software", this.getData()); 235 261 addUsingItems(using, Item.RAWBIOASSAY, query); 262 263 // Derived bioassay sets 264 query = HibernateUtil.getPredefinedQuery(session, 265 "GET_DERIVEDBIOASSAYSETS_FOR_SOFTWARE", "dbas.id"); 266 /* 267 SELECT {1} 268 FROM DerivedBioAssaySetData dbas 269 WHERE dbas.software = :software 270 */ 271 query.setEntity("software", this.getData()); 272 addUsingItems(using, Item.DERIVEDBIOASSAYSET, query); 236 273 return using; 237 274 } -
trunk/src/core/net/sf/basedb/core/data/PhysicalBioAssayData.java
r5642 r5652 119 119 } 120 120 121 private Set<ScanData> scans; 121 private Set<DerivedBioAssaySetData> rootDerivedBioAssaySets; 122 /** 123 This is the inverse end with an extra restriction 124 @see DerivedBioAssaySetData#getPhysicalBioAssay() 125 @hibernate.set lazy="true" inverse="true" where="`parent_id` is null" 126 @hibernate.collection-key column="`bioassay_id`" 127 @hibernate.collection-one-to-many class="net.sf.basedb.core.data.DerivedBioAssaySetData" 128 */ 129 Set<DerivedBioAssaySetData> getRootDerivedBioAssaySets() 130 { 131 return rootDerivedBioAssaySets; 132 } 133 void setRootDerivedBioAssaySets(Set<DerivedBioAssaySetData> rootDerivedBioAssaySets) 134 { 135 this.rootDerivedBioAssaySets = rootDerivedBioAssaySets; 136 } 137 138 private Set<DerivedBioAssaySetData> derivedBioAssaySets; 122 139 /** 123 140 This is the inverse end. 124 @see ScanData#getHybridization()125 @hibernate.set lazy="true" inverse="true" 126 @hibernate.collection-key column="` hybridization_id`"127 @hibernate.collection-one-to-many class="net.sf.basedb.core.data. ScanData"141 @see DerivedBioAssaySetData#getPhysicalBioAssay() 142 @hibernate.set lazy="true" inverse="true" 143 @hibernate.collection-key column="`bioassay_id`" 144 @hibernate.collection-one-to-many class="net.sf.basedb.core.data.DerivedBioAssaySetData" 128 145 */ 129 Set< ScanData> getScans()146 Set<DerivedBioAssaySetData> getDerivedBioAssaySets() 130 147 { 131 return scans;148 return derivedBioAssaySets; 132 149 } 133 void set Scans(Set<ScanData> scans)150 void setDerivedBioAssaySets(Set<DerivedBioAssaySetData> derivedBioAssaySets) 134 151 { 135 this. scans = scans;152 this.derivedBioAssaySets = derivedBioAssaySets; 136 153 } 137 154 138 155 139 156 } -
trunk/src/core/net/sf/basedb/core/data/RawBioAssayData.java
r4889 r5652 158 158 } 159 159 160 private ScanData scan;161 /**162 Get the scan.163 @hibernate.many-to-one column="`scan_id`" not-null="false" outer-join="false"164 */165 public ScanData getScan()166 {167 return scan;168 }169 public void setScan(ScanData scan)170 {171 this.scan = scan;172 }173 174 160 private SoftwareData software; 175 161 /** … … 229 215 } 230 216 217 private DerivedBioAssayData bioAssay; 218 /** 219 Get the derived bioassay that this raw bioassay has been created from. 220 @hibernate.many-to-one column="`bioassay_id`" not-null="false" outer-join="false" 221 */ 222 public DerivedBioAssayData getParent() 223 { 224 return bioAssay; 225 } 226 public void setParent(DerivedBioAssayData bioAssay) 227 { 228 this.bioAssay = bioAssay; 229 } 230 231 231 private String rawDataType; 232 232 /** -
trunk/src/core/net/sf/basedb/core/log/db/DbLogManagerFactory.java
r5068 r5652 31 31 import net.sf.basedb.core.data.BioMaterialEventData; 32 32 import net.sf.basedb.core.data.FileSetMemberData; 33 import net.sf.basedb.core.data.ImageData;34 33 import net.sf.basedb.core.data.LoggableData; 35 34 import net.sf.basedb.core.data.PlateEventData; … … 64 63 setSpecialLogger(FileSetMemberData.class, new FileSetMemberLogger()); 65 64 setSpecialLogger(PlateEventData.class, new PlateEventLogger(detailedProperties)); 66 setSpecialLogger(ImageData.class, new ImageLogger(detailedProperties));67 65 setSpecialLogger(AnnotationSetData.class, new AnnotationSetLogger(detailedProperties)); 68 66 } -
trunk/src/core/net/sf/basedb/util/AnnotationUtil.java
r5642 r5652 31 31 import net.sf.basedb.core.BaseException; 32 32 import net.sf.basedb.core.DbControl; 33 import net.sf.basedb.core.DerivedBioAssaySet; 33 34 import net.sf.basedb.core.PhysicalBioAssay; 34 35 import net.sf.basedb.core.RawBioAssay; 35 import net.sf.basedb.core.Scan;36 36 import net.sf.basedb.util.filter.Filter; 37 37 … … 96 96 This wrapper class is needed because we need to keep 97 97 track of the {@link RawBioAssay#getArrayNum()} property 98 until we have loaded the Labeled Extracts of a Hybridization.98 until we have loaded the Extracts of a Physical Bioassay. 99 99 <p> 100 100 The 'normal' value of arrayNum is 0, which means that it is ignored. 101 101 When we reach a {@link RawBioAssay} item, we use the arrayNum on 102 that. The array num is kept as we move up to Scan and Hybridization.103 When the Hybridizationis reached we use the arrayNum to call102 that. The array num is kept as we move up to DerivedBioAssaySet and PhysicalBioAssay. 103 When the PhysicalBioAssay is reached we use the arrayNum to call 104 104 {@link PhysicalBioAssay#getAnnotatableParents(int)} so that we only 105 get labeledextracts that are linked with the correct array num.105 get extracts that are linked with the correct array num. 106 106 */ 107 107 static class AnnotatableWrapper … … 112 112 <ul> 113 113 <li>{@link RawBioAssay#getArrayNum()} if the item is a raw bioassay 114 <li>'arrayNum' if the items is a Scan or Hybridization114 <li>'arrayNum' if the items is a DerivedBioAssaySet or PhysicalBioAssay 115 115 <li>0 in all other cases. 116 116 */ … … 121 121 return ((RawBioAssay)item).getArrayNum(); 122 122 } 123 else if (item instanceof Scan|| item instanceof PhysicalBioAssay)123 else if (item instanceof DerivedBioAssaySet || item instanceof PhysicalBioAssay) 124 124 { 125 125 return arrayNum; -
trunk/src/core/net/sf/basedb/util/overview/OverviewUtil.java
r5651 r5652 35 35 import net.sf.basedb.core.BasicItem; 36 36 import net.sf.basedb.core.DbControl; 37 import net.sf.basedb.core.DerivedBioAssaySet; 37 38 import net.sf.basedb.core.Presets; 38 39 import net.sf.basedb.core.PhysicalBioAssay; … … 43 44 import net.sf.basedb.core.SessionControl; 44 45 import net.sf.basedb.core.RawBioAssay; 45 import net.sf.basedb.core.Scan;46 46 import net.sf.basedb.core.Type; 47 47 import net.sf.basedb.core.query.Expressions; … … 347 347 String cacheKey = "annotatable.parent." + item.getType().name() + "." + item.getId(); 348 348 349 PhysicalBioAssay hyb= null;349 PhysicalBioAssay pba = null; 350 350 int arrayNum = 1; 351 351 // Special case when starting with a raw bioassay since we only … … 356 356 RawBioAssay rba = (RawBioAssay)root; 357 357 arrayNum = rba.getArrayNum(); 358 if (item instanceof Scan)358 if (item instanceof DerivedBioAssaySet) 359 359 { 360 360 cacheKey += "#" + arrayNum; … … 362 362 else if (item instanceof PhysicalBioAssay) 363 363 { 364 hyb= (PhysicalBioAssay)item;364 pba = (PhysicalBioAssay)item; 365 365 cacheKey += "#" + arrayNum; 366 366 } … … 372 372 parents = new HashSet<Annotatable>(); 373 373 context.setCachedObject(cacheKey, parents); 374 Set<Annotatable> temp = hyb!= null ?375 hyb.getAnnotatableParents(arrayNum) : item.getAnnotatableParents();374 Set<Annotatable> temp = pba != null ? 375 pba.getAnnotatableParents(arrayNum) : item.getAnnotatableParents(); 376 376 if (temp != null) 377 377 { -
trunk/src/core/net/sf/basedb/util/overview/loader/BasicItemNodeLoaderFactory.java
r5651 r5652 222 222 registerCheckedNodeLoader(Item.ARRAYSLIDE, ArraySlideLoader.class); 223 223 registerCheckedNodeLoader(Item.PHYSICALBIOASSAY, PhysicalBioAssayLoader.class); 224 registerCheckedNodeLoader(Item.SCAN, ScanLoader.class); 224 registerCheckedNodeLoader(Item.DERIVEDBIOASSAYSET, DerivedBioAssaySetLoader.class); 225 registerCheckedNodeLoader(Item.DERIVEDBIOASSAY, DerivedBioAssayLoader.class); 225 226 registerCheckedNodeLoader(Item.RAWBIOASSAY, RawBioAssayLoader.class); 226 227 registerCheckedNodeLoader(Item.EXPERIMENT, ExperimentLoader.class); … … 233 234 registerCheckedNodeLoader(Item.SOFTWARE, SoftwareLoader.class); 234 235 registerCheckedNodeLoader(Item.HARDWARE, HardwareLoader.class); 235 registerCheckedNodeLoader(Item.IMAGE, ImageLoader.class);236 236 registerCheckedNodeLoader(Item.ANNOTATION, AnnotationLoader.class); 237 237 registerCheckedNodeLoader(Item.PLATFORM, PlatformLoader.class); -
trunk/src/core/net/sf/basedb/util/overview/loader/HardwareLoader.java
r5651 r5652 25 25 import net.sf.basedb.core.BasicItem; 26 26 import net.sf.basedb.core.DbControl; 27 import net.sf.basedb.core.DerivedBioAssaySet; 27 28 import net.sf.basedb.core.Hardware; 28 29 import net.sf.basedb.core.MeasuredBioMaterial; … … 30 31 import net.sf.basedb.core.Item; 31 32 import net.sf.basedb.core.PermissionDeniedException; 32 import net.sf.basedb.core.Scan;33 33 import net.sf.basedb.util.overview.Node; 34 34 import net.sf.basedb.util.overview.OverviewContext; … … 77 77 { 78 78 BasicItem parentItem = (BasicItem)parentNode.getItem(dc); 79 if (parentItem instanceof Scan)79 if (parentItem instanceof DerivedBioAssaySet) 80 80 { 81 hardware = (( Scan)parentItem).getScanner();81 hardware = ((DerivedBioAssaySet)parentItem).getHardware(); 82 82 } 83 83 else if (parentItem instanceof PhysicalBioAssay) -
trunk/src/core/net/sf/basedb/util/overview/loader/PhysicalBioAssayLoader.java
r5651 r5652 24 24 import net.sf.basedb.core.ArraySlide; 25 25 import net.sf.basedb.core.DbControl; 26 import net.sf.basedb.core.DerivedBioAssaySet; 26 27 import net.sf.basedb.core.Extract; 27 28 import net.sf.basedb.core.PhysicalBioAssay; … … 31 32 import net.sf.basedb.core.PermissionDeniedException; 32 33 import net.sf.basedb.core.RawBioAssay; 33 import net.sf.basedb.core.Scan;34 34 import net.sf.basedb.util.overview.Node; 35 35 import net.sf.basedb.util.overview.OverviewContext; … … 45 45 <ol> 46 46 <li>{@link Extract}:s -> {@link PhysicalBioAssay}:s -> 47 {@link Scan}:s.47 {@link DerivedBioAssaySet}:s. 48 48 <li>{@link ArraySlide}:s -> {@link PhysicalBioAssay}:s -> 49 {@link Scan}:s49 {@link DerivedBioAssaySet}:s 50 50 </ol> 51 51 52 The reverse-loading direction starts with a scanand moves to both52 The reverse-loading direction starts with a derived bioassay set and moves to both 53 53 extracts and array slide. 54 54 … … 71 71 */ 72 72 /** 73 Create forward-loading hybridizationnodes from either an extract or73 Create forward-loading physical bioassay nodes from either an extract or 74 74 an array slide node. The returned node is either folder-type node containing 75 75 nodes for each bioassay that has been created from the extract … … 94 94 95 95 /** 96 Create a reverse-loading bioassay node from the scan node. 97 @return A bioassay node, or null if the scan doesn't have a 98 hybridization 99 */ 100 @Override 101 public Node createReverseNode(DbControl dc, OverviewContext context, Node scanNode) 96 Create a reverse-loading bioassay node from the derived bioassay set node. 97 @return A bioassay node 98 */ 99 @Override 100 public Node createReverseNode(DbControl dc, OverviewContext context, Node derivedBioAssaySetNode) 102 101 { 103 102 NodeFactory<PhysicalBioAssay> nf = getNodeFactory(dc, context); … … 107 106 try 108 107 { 109 Scan scan = (Scan)scanNode.getItem(dc);110 bioAssay = scan.getHybridization();111 Node rbaNode = scanNode.getFirstParent(new ItemTypeFilter(Item.RAWBIOASSAY));108 DerivedBioAssaySet bas = (DerivedBioAssaySet)derivedBioAssaySetNode.getItem(dc); 109 bioAssay = bas.getPhysicalBioAssay(); 110 Node rbaNode = derivedBioAssaySetNode.getFirstParent(new ItemTypeFilter(Item.RAWBIOASSAY)); 112 111 if (rbaNode != null) 113 112 { … … 121 120 } 122 121 Object cacheKey = new IndexedCacheKey(bioAssay, arrayNum); 123 Node bioAssayNode = createItemNode(nf, bioAssay, cacheKey, denied, scanNode, ChildNodeDirection.REVERSE);122 Node bioAssayNode = createItemNode(nf, bioAssay, cacheKey, denied, derivedBioAssaySetNode, ChildNodeDirection.REVERSE); 124 123 return bioAssayNode; 125 124 } … … 149 148 Load forward-loading child nodes: 150 149 <ul> 151 <li> Scans: {@link ScanLoader#createForwardNode(DbControl, OverviewContext, Node)}150 <li>Derived bioassay sets (root): {@link DerivedBioAssaySetLoader#createForwardNode(DbControl, OverviewContext, Node)} 152 151 <li>Array slide in reverse direction (if the parent node is an extract): 153 152 {@link ArraySlideLoader#createReverseNode(DbControl, OverviewContext, Node)} … … 159 158 protected void loadForwardChildNodes(DbControl dc, OverviewContext context, Node bioAssayNode) 160 159 { 161 getNodeLoader(context, Item. SCAN).createForwardNode(dc, context, bioAssayNode);160 getNodeLoader(context, Item.DERIVEDBIOASSAYSET).createForwardNode(dc, context, bioAssayNode); 162 161 Node parent = bioAssayNode.getParent(); 163 162 if (parent != null && parent.getNodeType() == Node.Type.FOLDER) … … 184 183 */ 185 184 @Override 186 protected void loadReverseChildNodes(DbControl dc, OverviewContext context, Node hybNode)187 { 188 getNodeLoader(context, Item.EXTRACT).createReverseNode(dc, context, hybNode);189 getNodeLoader(context, Item.ARRAYSLIDE).createReverseNode(dc, context, hybNode);185 protected void loadReverseChildNodes(DbControl dc, OverviewContext context, Node bioAssayNode) 186 { 187 getNodeLoader(context, Item.EXTRACT).createReverseNode(dc, context, bioAssayNode); 188 getNodeLoader(context, Item.ARRAYSLIDE).createReverseNode(dc, context, bioAssayNode); 190 189 } 191 190 // -------------------------------------- -
trunk/src/core/net/sf/basedb/util/overview/loader/RawBioAssayLoader.java
r5642 r5652 24 24 25 25 import net.sf.basedb.core.DbControl; 26 import net.sf.basedb.core.DerivedBioAssay; 26 27 import net.sf.basedb.core.Experiment; 27 28 import net.sf.basedb.core.Extract; … … 31 32 import net.sf.basedb.core.ItemResultIterator; 32 33 import net.sf.basedb.core.RawBioAssay; 33 import net.sf.basedb.core.Scan;34 34 import net.sf.basedb.core.query.Expressions; 35 35 import net.sf.basedb.core.query.Hql; … … 44 44 /** 45 45 Node loader implementation for raw bioassays. The forward-loading 46 direction goes from {@link Scan}:s -> {@link RawBioAssay}:s ->46 direction goes from {@link DerivedBioAssay}:s -> {@link RawBioAssay}:s -> 47 47 {@link Experiment}:s. The reverse-loading direction is the opposite 48 48 direction. … … 66 66 */ 67 67 /** 68 Create forward-loading raw bioassay nodes from a given scannode.68 Create forward-loading raw bioassay nodes from a given derived bioassay node. 69 69 The returned node is a folder-type node containing item nodes for 70 70 each raw bioassay that has been created from the scan. … … 72 72 */ 73 73 @Override 74 public Node createForwardNode(DbControl dc, OverviewContext context, Node scanNode)74 public Node createForwardNode(DbControl dc, OverviewContext context, Node bioAssayNode) 75 75 { 76 76 NodeFactory<RawBioAssay> nf = getNodeFactory(dc, context); 77 77 Node folderNode = null; 78 Scan scan = (Scan)scanNode.getItem(dc);79 ItemQuery<RawBioAssay> query = context.initQuery( scan.getRawBioAssays(), "name");78 DerivedBioAssay ba = (DerivedBioAssay)bioAssayNode.getItem(dc); 79 ItemQuery<RawBioAssay> query = context.initQuery(ba.getRawBioAssays(), "name"); 80 80 81 81 // If we have a extract as parent we need to know the array number … … 83 83 // may have other raw bioassays that are NOT related to the same extract 84 84 int arrayNum = 0; 85 PhysicalBioAssay hyb= null;86 Node assayNode = scanNode.getFirstParent(new ItemTypeFilter(Item.PHYSICALBIOASSAY));87 if ( assayNode != null)85 PhysicalBioAssay pba = null; 86 Node physicalBioAssayNode = bioAssayNode.getFirstParent(new ItemTypeFilter(Item.PHYSICALBIOASSAY)); 87 if (physicalBioAssayNode != null) 88 88 { 89 Node extractNode = assayNode.getFirstParent(new ItemTypeFilter(Item.EXTRACT));89 Node extractNode = physicalBioAssayNode.getFirstParent(new ItemTypeFilter(Item.EXTRACT)); 90 90 if (extractNode != null) 91 91 { 92 hyb = (PhysicalBioAssay)assayNode.getItem(dc);92 pba = (PhysicalBioAssay)physicalBioAssayNode.getItem(dc); 93 93 Extract extract = (Extract)extractNode.getItem(); 94 arrayNum = hyb.getCreationEvent().getSourceGroup(extract);94 arrayNum = pba.getCreationEvent().getSourceGroup(extract); 95 95 } 96 96 } … … 106 106 if (folderNode == null) 107 107 { 108 folderNode = new Node("rawbioassays", "Raw bioassays", scanNode, ChildNodeDirection.FORWARD);108 folderNode = new Node("rawbioassays", "Raw bioassays", bioAssayNode, ChildNodeDirection.FORWARD); 109 109 } 110 110 createItemNode(nf, rba, rba, false, folderNode, ChildNodeDirection.FORWARD); 111 111 } 112 postValidateFolder(nf, folderNode, scanNode, false);112 postValidateFolder(nf, folderNode, bioAssayNode, false); 113 113 return folderNode; 114 114 } … … 161 161 { 162 162 getNodeLoader(context, Item.ANNOTATION).createPropertyNode(dc, context, rawBioAssayNode); 163 getNodeLoader(context, Item.FILESETMEMBER).createPropertyNode(dc, context, rawBioAssayNode); 163 164 getNodeLoader(context, Item.PLATFORM).createPropertyNode(dc, context, rawBioAssayNode); 164 getNodeLoader(context, Item.FILESETMEMBER).createPropertyNode(dc, context, rawBioAssayNode);165 165 getNodeLoader(context, Item.ARRAYDESIGN).createPropertyNode(dc, context, rawBioAssayNode); 166 166 getNodeLoader(context, Item.PROTOCOL).createPropertyNode(dc, context, rawBioAssayNode); … … 178 178 } 179 179 /** 180 Loads the scannode that this raw bioassay is created from.181 @see ScanLoader#createReverseNode(DbControl, OverviewContext, Node)180 Loads the derived bioassay node that this raw bioassay is created from. 181 @see DerivedBioAssayLoader#createReverseNode(DbControl, OverviewContext, Node) 182 182 */ 183 183 @Override 184 184 protected void loadReverseChildNodes(DbControl dc, OverviewContext context, Node rawBioAssayNode) 185 185 { 186 getNodeLoader(context, Item. SCAN).createReverseNode(dc, context, rawBioAssayNode);186 getNodeLoader(context, Item.DERIVEDBIOASSAY).createReverseNode(dc, context, rawBioAssayNode); 187 187 } 188 188 // -------------------------------- -
trunk/src/core/net/sf/basedb/util/overview/loader/SoftwareLoader.java
r4740 r5652 24 24 import net.sf.basedb.core.BasicItem; 25 25 import net.sf.basedb.core.DbControl; 26 import net.sf.basedb.core.DerivedBioAssaySet; 26 27 import net.sf.basedb.core.Item; 27 28 import net.sf.basedb.core.PermissionDeniedException; … … 70 71 software = ((RawBioAssay)parentItem).getSoftware(); 71 72 } 73 else if (parentItem instanceof DerivedBioAssaySet) 74 { 75 software = ((DerivedBioAssaySet)parentItem).getSoftware(); 76 } 77 72 78 // If there are other items with a software 73 79 // we should add more cases here -
trunk/src/core/net/sf/basedb/util/overview/validator/ArrayDesignValidator.java
r5651 r5652 33 33 import net.sf.basedb.core.Project; 34 34 import net.sf.basedb.core.RawBioAssay; 35 import net.sf.basedb.core.Scan;36 35 import net.sf.basedb.util.overview.Fix; 37 36 import net.sf.basedb.util.overview.OverviewContext; … … 73 72 Project project = context.getProject(); 74 73 ArrayDesign design = (ArrayDesign)node.getItem(); 75 if ( !project.isDefaultItem(design))74 if (project != null) 76 75 { 77 context.createFailure(Validator.NONDEFAULT_ARRAYDESIGN, node, null, 78 new Fix("Change default array design for project", project) 79 ); 76 if (!project.isDefaultItem(design)) 77 { 78 context.createFailure(Validator.NONDEFAULT_ARRAYDESIGN, node, null, 79 new Fix("Change default array design for project", project) 80 ); 81 } 80 82 } 81 83 … … 87 89 try 88 90 { 91 /* 89 92 Scan scan = rba.getScan(); 90 93 if (scan != null) … … 96 99 } 97 100 } 101 */ 98 102 } 99 103 catch (PermissionDeniedException ex) -
trunk/src/core/net/sf/basedb/util/overview/validator/BasicItemNodeValidatorFactory.java
r5651 r5652 198 198 registerCheckedNodeValidator(Item.ARRAYSLIDE, ArraySlideValidator.class); 199 199 registerCheckedNodeValidator(Item.PHYSICALBIOASSAY, PhysicalBioAssayValidator.class); 200 registerCheckedNodeValidator(Item.SCAN, ScanValidator.class); 200 // registerCheckedNodeValidator(Item.DERIVEDBIOASSAYSET, DerivedBioAssaySetValidator.class); 201 // registerCheckedNodeValidator(Item.DERIVEDBIOASSAY, DerivedBioAssayValidator.class); 201 202 registerCheckedNodeValidator(Item.RAWBIOASSAY, RawBioAssayValidator.class); 202 203 registerCheckedNodeValidator(Item.EXPERIMENT, ExperimentValidator.class); -
trunk/src/core/net/sf/basedb/util/overview/validator/HardwareValidator.java
r5651 r5652 112 112 // Check if using project default hardware 113 113 Project project = context.getProject(); 114 if ( !project.isDefaultItem(hardware))114 if (project != null) 115 115 { 116 context.createFailure(Validator.NONDEFAULT_HARDWARE, parentNode, null, 117 new Fix("Change hardware of '" + parentNode.getTitle() + "'", parentItem), 118 new Fix("Add '" + hardware.getName() + "' as default hardware to project", project) 119 ); 116 if (!project.isDefaultItem(hardware)) 117 { 118 context.createFailure(Validator.NONDEFAULT_HARDWARE, parentNode, null, 119 new Fix("Change hardware of '" + parentNode.getTitle() + "'", parentItem), 120 new Fix("Add '" + hardware.getName() + "' as default hardware to project", project) 121 ); 122 } 120 123 } 121 124 } -
trunk/src/core/net/sf/basedb/util/overview/validator/PhysicalBioAssayValidator.java
r5651 r5652 74 74 } 75 75 } 76 77 76 } 78 77 79 78 /** 80 @return Suggested fix is to add a scan to the parent raw bioassay.79 @return Always null (since it can never be missing) 81 80 */ 82 81 @Override 83 82 protected Fix getMissingItemFix(DbControl dc, Node parentNode) 84 83 { 85 Fix fix = null; 86 if (parentNode.getItemType() == Item.SCAN) 87 { 88 fix = new Fix("Add bioassay to scan", parentNode.getItem()); 89 } 90 return fix; 84 return null; 91 85 } 92 86 // ---------------------------- -
trunk/src/core/net/sf/basedb/util/overview/validator/PlatformValidator.java
r5651 r5652 67 67 { 68 68 super.postValidate(dc, context, node, parentNode); 69 Project project = context.getProject();70 69 Platform platform = (Platform)node.getItem(); 71 70 PlatformVariant variant = null; … … 89 88 } 90 89 91 if (!project.isDefaultItem(platform) || 92 (variant != null && !project.isDefaultItem(variant) && !failedVariant)) 90 91 Project project = context.getProject(); 92 if (project != null) 93 93 { 94 context.createFailure(Validator.NONDEFAULT_PLATFORM, parentNode, null, 95 canChangePlatform ? new Fix("Change platform of " + parentTypeName, parentItem) : null, 96 new Fix("Change default platform of project", project) 97 ); 94 if (!project.isDefaultItem(platform) || 95 (variant != null && !project.isDefaultItem(variant) && !failedVariant)) 96 { 97 context.createFailure(Validator.NONDEFAULT_PLATFORM, parentNode, null, 98 canChangePlatform ? new Fix("Change platform of " + parentTypeName, parentItem) : null, 99 new Fix("Change default platform of project", project) 100 ); 101 } 98 102 } 99 103 } -
trunk/src/core/net/sf/basedb/util/overview/validator/ProtocolValidator.java
r5651 r5652 113 113 // Check if using project default protocol 114 114 Project project = context.getProject(); 115 if ( !project.isDefaultItem(protocol))115 if (project != null) 116 116 { 117 context.createFailure(Validator.NONDEFAULT_PROTOCOL, parentNode, null, 118 new Fix("Change protocol of '" + parentNode.getTitle() + "'", parentItem), 119 new Fix("Add '" + protocol.getName() + "' as default protocol to project", project) 120 ); 117 if (!project.isDefaultItem(protocol)) 118 { 119 context.createFailure(Validator.NONDEFAULT_PROTOCOL, parentNode, null, 120 new Fix("Change protocol of '" + parentNode.getTitle() + "'", parentItem), 121 new Fix("Add '" + protocol.getName() + "' as default protocol to project", project) 122 ); 123 } 121 124 } 122 125 } -
trunk/src/core/net/sf/basedb/util/overview/validator/RawBioAssayValidator.java
r5651 r5652 27 27 import net.sf.basedb.core.ArrayDesign; 28 28 import net.sf.basedb.core.DbControl; 29 import net.sf.basedb.core.DerivedBioAssay; 29 30 import net.sf.basedb.core.PhysicalBioAssay; 30 31 import net.sf.basedb.core.Project; 31 32 import net.sf.basedb.core.RawBioAssay; 32 33 import net.sf.basedb.core.RawDataType; 33 import net.sf.basedb.core.Scan;34 34 import net.sf.basedb.util.Values; 35 35 import net.sf.basedb.util.overview.Fix; … … 89 89 90 90 // 1. Check if we have seen other raw bioassays with the same 91 // array index that are from the same scan92 // 2. Check array index is within the bounds set by hybridization91 // array index that are from the same parent bioassay set 92 // 2. Check array index is within the bounds set by physical bioassay 93 93 try 94 94 { 95 95 int arrayIndex = rba.getArrayNum(); 96 Scan scan = rba.getScan();96 DerivedBioAssay parent = rba.getParent(); 97 97 Map<String, Node> used = (Map<String, Node>)context.getCachedObject("USED.ARRAYINDEX"); 98 98 if (used == null) … … 102 102 } 103 103 104 String key = scan.getId() + ":" + arrayIndex;104 String key = parent.getId() + ":" + arrayIndex; 105 105 if (used.containsKey(key)) 106 106 { … … 120 120 } 121 121 122 PhysicalBioAssay hyb = scan.getHybridization();123 if (arrayIndex > hyb.getSize() || arrayIndex < 1)122 PhysicalBioAssay pba = parent.getBioAssaySet().getPhysicalBioAssay(); 123 if (arrayIndex > pba.getSize() || arrayIndex < 1) 124 124 { 125 125 context.createFailure(Validator.INCORRECT_ARRAY_NUM, node, 126 126 "Incorrect sub-array index: " + arrayIndex + 127 " (expected 1.." + hyb.getSize() + ")",127 " (expected 1.." + pba.getSize() + ")", 128 128 new Fix("Change array index on raw bioassay", rba), 129 new Fix("Increase arrays on hybridization", hyb));129 new Fix("Increase size on physical bioassay", pba)); 130 130 } 131 131 } -
trunk/src/core/net/sf/basedb/util/overview/validator/SoftwareValidator.java
r5651 r5652 94 94 // Check if using project default software 95 95 Project project = context.getProject(); 96 if ( !project.isDefaultItem(software))96 if (project != null) 97 97 { 98 context.createFailure(Validator.NONDEFAULT_SOFTWARE, parentNode, null, 99 new Fix("Change software of '" + parentNode.getTitle() + "'", parentItem), 100 new Fix("Add '" + software.getName() + "' as default software to project", project) 101 ); 98 if (!project.isDefaultItem(software)) 99 { 100 context.createFailure(Validator.NONDEFAULT_SOFTWARE, parentNode, null, 101 new Fix("Change software of '" + parentNode.getTitle() + "'", parentItem), 102 new Fix("Add '" + software.getName() + "' as default software to project", project) 103 ); 104 } 102 105 } 103 106 } -
trunk/src/plugins/core/net/sf/basedb/plugins/IlluminaRawDataImporter.java
r5630 r5652 61 61 import net.sf.basedb.core.RawDataTypes; 62 62 import net.sf.basedb.core.RequestInformation; 63 import net.sf.basedb.core.Scan;64 63 import net.sf.basedb.core.Software; 65 64 import net.sf.basedb.core.StringParameterType; … … 337 336 private Experiment experiment; 338 337 private ArrayDesign design; 339 private Scan scan;340 338 private Software software; 341 339 private Protocol protocol; … … 425 423 this.experiment = (Experiment)job.getValue("experiment"); 426 424 this.design = (ArrayDesign)job.getValue("arrayDesign"); 427 this.scan = (Scan)job.getValue("scan");428 425 this.protocol = (Protocol)job.getValue("protocol"); 429 426 this.software = (Software)job.getValue("software"); … … 676 673 rba.setArrayNum(arrayNum); 677 674 if (design != null) rba.setArrayDesign(design); 678 if (scan != null) rba.setScan(scan);679 675 if (protocol != null) rba.setProtocol(protocol); 680 676 if (software != null) rba.setSoftware(software); … … 732 728 // parameters for scan, protocol, software and array design 733 729 dc = sc.newDbControl(); 734 List<Scan> scans = getItems(dc, Scan.getQuery());735 730 List<Protocol> protocols = getItems(dc, Protocol.getQuery(), 736 731 Restrictions.eq( … … 753 748 754 749 boolean hasAssociations = 755 context.getItem() == Item.EXPERIMENT || scans.size() > 0 ||750 context.getItem() == Item.EXPERIMENT || 756 751 protocols.size() > 0 || software.size() > 0 || designs.size() > 0; 757 752 … … 779 774 parameters.add(featureIdentificationParameter); 780 775 } 781 if (!scans.isEmpty())782 {783 parameters.add(new PluginParameter<Scan>(784 "scan",785 "Scan",786 "The imported raw bioassays will be linked to the selected scan.",787 new ItemParameterType<Scan>(Scan.class, null, false, 1, scans)788 ));789 }790 776 if (!protocols.isEmpty()) 791 777 { -
trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/AbstractItemImporter.java
r5650 r5652 50 50 import net.sf.basedb.core.ItemParameterType; 51 51 import net.sf.basedb.core.PhysicalBioAssay; 52 import net.sf.basedb.core.Image;53 52 import net.sf.basedb.core.Include; 54 53 import net.sf.basedb.core.IntegerUtil; … … 77 76 import net.sf.basedb.core.RequestInformation; 78 77 import net.sf.basedb.core.Sample; 79 import net.sf.basedb.core.Scan;80 78 import net.sf.basedb.core.Shareable; 81 79 import net.sf.basedb.core.ShareableUtil; … … 1652 1650 } 1653 1651 1654 private ItemQuery<Scan> scanQuery;1655 /**1656 Find a scan with a given identifier. This is a utility method that1657 subclasses can use when creating or updating items.1658 <p>1659 NOTE! The first time this method is called a query object is initialised1660 using the {@link IdMethod#prepareQuery(DbControl, ItemQuery)} method.1661 Subsequent calls uses the same query. Thus, this method should always be1662 called with the same id method object, otherwise the result is undefined.1663 1664 @param dc The DbControl to use for database access1665 @param identifier The identifier protocol1666 @return A scan, or null if no item could be found1667 */1668 protected Scan findScan(DbControl dc, IdMethod idMethod, String identifier)1669 {1670 if (identifier == null) return null;1671 if (scanQuery == null)1672 {1673 scanQuery = initReferenceQuery(dc, idMethod, Scan.getQuery(), false);1674 }1675 return findReferencedItem(dc, idMethod, scanQuery, identifier, 0, false);1676 }1677 1678 /**1679 Find an image with given scan and file. This is a utility method that1680 subclasses can use when creating or updating items.1681 New image will be created if given scan hasn't been saved to the database or1682 if no image could be found for the given file.1683 Null-value is returned if more then one image were found and1684 {@link #failIfMultipleFoundReferences} is set to FALSE.1685 1686 @param dc The DbControl to use for database access1687 @param scan The Scan for which the image should belong to.1688 @param imageFile The File, which the image is connected to.1689 @return An image, or null.1690 @since 2.121691 */1692 protected Image findImage(DbControl dc, Scan scan, File imageFile)1693 {1694 if (imageFile == null) return null;1695 Image image = null;1696 if (scan.isInDatabase())1697 {1698 ItemQuery<Image> imageQuery = scan.getImages();1699 imageQuery.include(Include.MINE, Include.IN_PROJECT, Include.SHARED, Include.OTHERS);1700 imageQuery.restrict(Restrictions.eq(Hql.property("file"), Hql.entity(imageFile)));1701 List<Image> images = imageQuery.list(dc);1702 if (images.size() == 1)1703 {1704 image = images.get(0);1705 }1706 else if (images.size() > 1)1707 {1708 // Several images with given file were found1709 if (failIfMultipleFoundReferences)1710 {1711 throw new BaseException("Found " + images.size() + " " + Item.IMAGE + " [ File =" + imageFile.getPath() + "]");1712 }1713 }1714 else if (images.size() == 0)1715 {1716 // Create new image if no one could be found with the given file.1717 image = scan.newImage();1718 dc.saveItemIf(scan, image, false);1719 image.setFile(imageFile);1720 }1721 }1722 else1723 {1724 // Create new image based on the given file if the scan hasn't been saved to the database.1725 image = scan.newImage();1726 dc.saveItemIf(scan, image, false);1727 image.setFile(imageFile);1728 }1729 return image;1730 }1731 1732 1652 private ItemQuery<ArrayDesign> designQuery; 1733 1653 /** -
trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/RawBioAssayImporter.java
r5630 r5652 35 35 import net.sf.basedb.core.Path; 36 36 import net.sf.basedb.core.PathParameterType; 37 import net.sf.basedb.core.PermissionDeniedException;38 37 import net.sf.basedb.core.Platform; 39 38 import net.sf.basedb.core.PlatformVariant; … … 42 41 import net.sf.basedb.core.RawBioAssay; 43 42 import net.sf.basedb.core.RawDataType; 44 import net.sf.basedb.core.Scan;45 43 import net.sf.basedb.core.Software; 46 44 import net.sf.basedb.core.SystemItems; … … 334 332 } 335 333 ArrayDesign designFromScan = null; 334 /* 336 335 if (scanMapper != null) 337 336 { … … 349 348 } 350 349 } 350 */ 351 351 if (!rba.hasData()) 352 352 { -
trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/ScanImporter.java
r5642 r5652 23 23 24 24 import net.sf.basedb.core.DbControl; 25 import net.sf.basedb.core.DerivedBioAssaySet; 25 26 import net.sf.basedb.core.File; 26 27 import net.sf.basedb.core.Hardware; 27 28 import net.sf.basedb.core.PhysicalBioAssay; 28 import net.sf.basedb.core.Image;29 29 import net.sf.basedb.core.Item; 30 30 import net.sf.basedb.core.ItemQuery; … … 34 34 import net.sf.basedb.core.PluginParameter; 35 35 import net.sf.basedb.core.Protocol; 36 import net.sf.basedb.core.Scan;37 36 import net.sf.basedb.core.SystemItems; 38 37 import net.sf.basedb.core.plugin.GuiContext; … … 53 52 */ 54 53 public class ScanImporter 55 extends AbstractItemImporter< Scan>54 extends AbstractItemImporter<DerivedBioAssaySet> 56 55 { 57 56 58 57 private static final Set<GuiContext> guiContexts = 59 Collections.singleton(new GuiContext(Item. SCAN, GuiContext.Type.LIST));58 Collections.singleton(new GuiContext(Item.DERIVEDBIOASSAYSET, GuiContext.Type.LIST)); 60 59 61 60 protected static final PluginParameter<String> hardwareColumnMapping = new PluginParameter<String>( … … 212 211 213 212 /** 214 Calls {@link Scan#getQuery()}.215 */ 216 @Override 217 protected ItemQuery< Scan> createItemQuery()218 { 219 return Scan.getQuery();213 Calls {@link DerivedBioAssaySet#getQuery()}. 214 */ 215 @Override 216 protected ItemQuery<DerivedBioAssaySet> createItemQuery() 217 { 218 return DerivedBioAssaySet.getQuery(); 220 219 } 221 220 … … 224 223 { 225 224 nameMapper = getMapper(ffp, (String)job.getValue("nameColumnMapping"), 226 cropStrings ? Scan.MAX_NAME_LENGTH : null, null);225 cropStrings ? DerivedBioAssaySet.MAX_NAME_LENGTH : null, null); 227 226 descriptionMapper = getMapper(ffp, (String)job.getValue("descriptionColumnMapping"), 228 cropStrings ? Scan.MAX_DESCRIPTION_LENGTH : null, null);227 cropStrings ? DerivedBioAssaySet.MAX_DESCRIPTION_LENGTH : null, null); 229 228 protocolMapper = getMapper(ffp, (String)job.getValue("protocolColumnMapping"), null, null); 230 229 hardwareMapper = getMapper(ffp, (String)job.getValue("hardwareColumnMapping"), null, null); … … 243 242 244 243 @Override 245 protected ScancreateItem(DbControl dc, FlatFileParser.Data data)244 protected DerivedBioAssaySet createItem(DbControl dc, FlatFileParser.Data data) 246 245 { 247 246 PhysicalBioAssay hyb = null; … … 251 250 } 252 251 253 Scan scan = Scan.getNew(dc, hyb);252 DerivedBioAssaySet scan = DerivedBioAssaySet.getNew(dc, hyb); 254 253 updateItem(dc, scan, data); 255 254 return scan; … … 257 256 258 257 @Override 259 protected void updateItem(DbControl dc, Scanscan, FlatFileParser.Data data)258 protected void updateItem(DbControl dc, DerivedBioAssaySet scan, FlatFileParser.Data data) 260 259 { 261 260 if (nameMapper != null) scan.setName(nameMapper.getValue(data)); 262 261 if (descriptionMapper != null) scan.setDescription(descriptionMapper.getValue(data)); 262 /* 263 263 if (hybridizationMapper != null && scan.isInDatabase()) 264 264 { … … 270 270 } 271 271 } 272 */ 272 273 if (protocolMapper != null) 273 274 { … … 282 283 ItemSubtype type = ItemSubtype.getById(dc, SystemItems.getId(Hardware.SCANNER)); 283 284 Hardware scanner = findHardware(dc, FallbackIdMethod.NAME_OR_ID, nameOrId, type); 284 if (nameOrId == null || scanner != null) scan.set Scanner(scanner);285 if (nameOrId == null || scanner != null) scan.setHardware(scanner); 285 286 } 286 287 … … 289 290 290 291 @Override 291 protected void updateMultiLineItem(DbControl dc, Scanscan, FlatFileParser.Data data, int multiLineNum)292 { 293 Image image = null;292 protected void updateMultiLineItem(DbControl dc, DerivedBioAssaySet scan, FlatFileParser.Data data, int multiLineNum) 293 { 294 // Image image = null; 294 295 File imageFile = null; 295 296 String imageName = null; … … 303 304 } 304 305 imageFile = File.getByPath(dc, new Path(filePath, Path.Type.FILE), false); 305 image = findImage(dc, scan, imageFile);306 // image = findImage(dc, scan, imageFile); 306 307 } 307 308 if (imageNameMapper != null) … … 309 310 imageName = imageNameMapper.getValue(data); 310 311 } 312 /* 311 313 else if (image != null) 312 314 { 313 315 imageName = image.getName(); 314 316 } 315 317 */ 318 /* 316 319 if (image != null) 317 320 { … … 321 324 if (imagePreviewMapper != null) image.setPreview(Boolean.getBoolean(imagePreviewMapper.getValue(data))); 322 325 } 326 */ 323 327 } 324 328 // ------------------------------------ -
trunk/src/test/TestAll.java
r5642 r5652 115 115 // Physical bioassays and raw data 116 116 results.put("TestPhysicalBioAssay", TestPhysicalBioAssay.test_all()); 117 results.put("Test Scan", TestScan.test_all());117 results.put("TestDerivedBioAssaySet", TestDerivedBioAssaySet.test_all()); 118 118 results.put("TestRawBioAssay", TestRawBioAssay.test_all()); 119 119 results.put("TestSpotImages", TestSpotImages.test_all()); -
trunk/src/test/TestDataFileType.java
r5630 r5652 27 27 import net.sf.basedb.core.DataFileType; 28 28 import net.sf.basedb.core.File; 29 import net.sf.basedb.core.FileSetMember; 30 import net.sf.basedb.core.FileStoreEnabled; 29 31 import net.sf.basedb.core.Item; 30 32 import net.sf.basedb.core.ItemProxy; … … 194 196 } 195 197 198 static void write_item(int i, FileSetMember member) 199 throws BaseException 200 { 201 if (!TestUtil.getSilent()) 202 { 203 System.out.println(i+":\t"+member.getId()+"\t"+member.getFile().getName()+"\t"+ 204 member.getDataFileType().getName()); 205 } 206 } 207 208 196 209 static void write_item(int i, PlatformVariant v) 197 210 throws BaseException … … 234 247 } 235 248 249 static void test_set_file(Item itemType, int itemId, String fileType, int fileId) 250 { 251 if (itemId == 0 || fileId == 0) return; 252 DbControl dc = null; 253 try 254 { 255 dc = TestUtil.getDbControl(); 256 FileStoreEnabled item = (FileStoreEnabled)itemType.getById(dc, itemId); 257 DataFileType type = DataFileType.getByExternalId(dc, fileType); 258 File file = File.getById(dc, fileId); 259 item.getFileSet().setMember(file, type); 260 dc.commit(); 261 write("--Set file OK ("+fileType+")"); 262 } 263 catch (Throwable ex) 264 { 265 write("--Set file FAILED ("+fileType+")"); 266 ex.printStackTrace(); 267 ok = false; 268 } 269 finally 270 { 271 if (dc != null) dc.close(); 272 } 273 } 274 275 static void test_list_files(Item itemType, int itemId, int expectedResults) 276 { 277 if (itemId == 0) return; 278 DbControl dc = null; 279 try 280 { 281 dc = TestUtil.getDbControl(); 282 FileStoreEnabled item = (FileStoreEnabled)itemType.getById(dc, itemId); 283 ItemResultList<FileSetMember> l = item.getFileSet().getMembers().list(dc); 284 for (int i = 0; i<l.size(); i++) 285 { 286 write_item(i, l.get(i)); 287 } 288 if (expectedResults >= 0 && expectedResults != l.size()) 289 { 290 throw new BaseException("Expected "+expectedResults+" results, not "+l.size()); 291 } 292 write("--List files OK ("+l.size()+")"); 293 } 294 catch (Throwable ex) 295 { 296 write("--List files FAILED"); 297 ex.printStackTrace(); 298 ok = false; 299 } 300 finally 301 { 302 if (dc != null) dc.close(); 303 } 304 } 305 306 static void test_list_file_types(Item itemType, int itemId, int expectedResults) 307 { 308 if (itemId == 0) return; 309 DbControl dc = null; 310 try 311 { 312 dc = TestUtil.getDbControl(); 313 FileStoreEnabled item = (FileStoreEnabled)itemType.getById(dc, itemId); 314 ItemResultList<DataFileType> l = item.getFileSet().getMemberTypes().list(dc); 315 for (int i = 0; i<l.size(); i++) 316 { 317 write_item(i, l.get(i)); 318 } 319 if (expectedResults >= 0 && expectedResults != l.size()) 320 { 321 throw new BaseException("Expected "+expectedResults+" results, not "+l.size()); 322 } 323 write("--List file types OK ("+l.size()+")"); 324 } 325 catch (Throwable ex) 326 { 327 write("--List file types FAILED"); 328 ex.printStackTrace(); 329 ok = false; 330 } 331 finally 332 { 333 if (dc != null) dc.close(); 334 } 335 } 336 337 236 338 } -
trunk/src/test/TestGenericOverview.java
r5642 r5652 25 25 import net.sf.basedb.core.DataFileType; 26 26 import net.sf.basedb.core.DbControl; 27 import net.sf.basedb.core.DerivedBioAssaySet; 27 28 import net.sf.basedb.core.Extract; 28 29 import net.sf.basedb.core.Hardware; … … 65 66 int scanningProtocol = TestProtocol.test_create( 66 67 SystemItems.getId(Protocol.SCANNING), "Scan protocol", false); 68 int sequencingProtocol = TestProtocol.test_create( 69 SystemItems.getId(Protocol.SEQUENCING), "Sequencing protocol", false); 67 70 int featureProtocol = TestProtocol.test_create( 68 71 SystemItems.getId(Protocol.FEATURE_EXTRACTION), "Feature protocol", false); … … 70 73 int milliWatt = TestUnit.test_load_by_symbol(power, "mW"); 71 74 int scanPower = TestAnnotationType.test_create("Power", Type.FLOAT, milliWatt, 72 null, null, Item. SCAN, 1, null, false);75 null, null, Item.DERIVEDBIOASSAYSET, 1, null, false); 73 76 TestProtocol.test_set_protocol_parameter(scanningProtocol, scanPower); 74 77 75 78 // Hardware and software 76 79 int scanner = TestHardware.test_create( 77 SystemItems.getId(Hardware.SCANNER), "Overview scanner", false); 80 SystemItems.getId(Hardware.SCANNER), "Scanner GO", false); 81 int sequencer = TestHardware.test_create( 82 SystemItems.getId(Hardware.SEQUENCER), "Sequencer GO", false); 78 83 int software = TestSoftware.test_create( 79 SystemItems.getId(Software.FEATURE_EXTRACTION), "Overview software", false); 84 SystemItems.getId(Software.FEATURE_EXTRACTION), "Feature extraction GO", false); 85 int alignmentSoftware = TestSoftware.test_create( 86 SystemItems.getId(Software.ALIGNMENT), "Alignment GO", false); 80 87 81 88 // Data files … … 83 90 int celFile = TestFile.test_create("data/test.affymetrix.cel", false, false); 84 91 int reporterMap = TestFile.test_create("data/test", false, false); 92 int samFile = TestFile.test_create("data/test.assembly.sam", false, false); 85 93 86 94 // Create main items … … 94 102 int extractPooled = TestExtract.test_create_pooled(extract1, extract2); 95 103 104 // Array design 105 int arrayDesign = TestArrayDesign.test_create(Platform.GENERIC, false); 106 TestArrayDesign.test_set_file(arrayDesign, DataFileType.GENERIC_REPORTER_MAP, reporterMap); 107 108 // Array batch & slide 109 int arrayBatch = TestArrayBatch.test_create(arrayDesign, false); 110 int arraySlide = TestArraySlide.test_create(arrayBatch, false); 111 112 // ******** Microarray part ******* 113 // Labeled extracts 96 114 int cy3 = TestTag.test_load("cy3"); 97 115 int cy5 = TestTag.test_load("cy5"); … … 101 119 int labeledExtract1Ref = TestExtract.test_create(extractPooled, "Labeled GO #1 (cy5)", labeledExtract, cy5, false); 102 120 int labeledExtract2Ref = TestExtract.test_create(extractPooled, "Labeled GO #2 (cy5)", labeledExtract, cy5, false); 103 104 // Array design105 int arrayDesign = TestArrayDesign.test_create(Platform.GENERIC, false);106 TestArrayDesign.test_set_file(arrayDesign, DataFileType.GENERIC_REPORTER_MAP, reporterMap);107 108 // Array batch & slide109 int arrayBatch = TestArrayBatch.test_create(arrayDesign, false);110 int arraySlide = TestArraySlide.test_create(arrayBatch, false);111 121 112 122 // Hybridization 113 123 int hyb = TestPhysicalBioAssay.test_create(arraySlide, SystemItems.getId(PhysicalBioAssay.HYBRIDIZATION), false); 114 TestPhysicalBioAssay.test_add_ labeledextract(hyb, labeledExtract1, 1, null);115 TestPhysicalBioAssay.test_add_ labeledextract(hyb, labeledExtract1Ref, 1, null);116 TestPhysicalBioAssay.test_add_ labeledextract(hyb, labeledExtract2, 2, null);117 TestPhysicalBioAssay.test_add_ labeledextract(hyb, labeledExtract2Ref, 2, null);124 TestPhysicalBioAssay.test_add_extract(hyb, labeledExtract1, 1, null); 125 TestPhysicalBioAssay.test_add_extract(hyb, labeledExtract1Ref, 1, null); 126 TestPhysicalBioAssay.test_add_extract(hyb, labeledExtract2, 2, null); 127 TestPhysicalBioAssay.test_add_extract(hyb, labeledExtract2Ref, 2, null); 118 128 119 129 // Scan 120 int scan = TestScan.test_create(hyb, scanner, scanningProtocol, false); 121 TestAnnotation.test_annotatate(Item.SCAN, scan, scanPower, 0, 15.0f); 122 TestScan.test_add_image(scan); 130 int scan = TestDerivedBioAssaySet.test_create_root("Scanned hyb", hyb, 131 SystemItems.getId(DerivedBioAssaySet.SCAN), scanningProtocol, scanner, 0); 132 TestAnnotation.test_annotatate(Item.DERIVEDBIOASSAYSET, scan, scanPower, 0, 15.0f); 133 int scannedAssayId1 = TestDerivedBioAssaySet.test_add_bioassay(scan, "Scanned GO #1"); 134 int scannedAssayId2 = TestDerivedBioAssaySet.test_add_bioassay(scan, "Scanned GO #2"); 123 135 124 136 // Raw bioassay #1 125 int rawBioAssay1 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "RBA #1", scan , software, featureProtocol, arrayDesign, 1, false);126 Test RawBioAssay.test_set_file(rawBioAssay1, DataFileType.GENERIC_RAW_DATA, genePixFile);127 Test RawBioAssay.test_set_file(rawBioAssay1, DataFileType.AFFYMETRIX_CEL, celFile);137 int rawBioAssay1 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "RBA #1", scannedAssayId1, software, featureProtocol, arrayDesign, 1, false); 138 TestDataFileType.test_set_file(Item.RAWBIOASSAY, rawBioAssay1, DataFileType.GENERIC_RAW_DATA, genePixFile); 139 TestDataFileType.test_set_file(Item.RAWBIOASSAY, rawBioAssay1, DataFileType.AFFYMETRIX_CEL, celFile); 128 140 TestAnnotation.test_annotatate(Item.RAWBIOASSAY, rawBioAssay1, annotationType, 0, "alfa"); 129 141 130 142 // Raw bioassay #2 131 int rawBioAssay2 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "RBA #2", scan, software, scanningProtocol, arrayDesign, 2, false); 132 TestRawBioAssay.test_set_file(rawBioAssay2, DataFileType.GENERIC_RAW_DATA, genePixFile); 133 134 // Experiment 143 int rawBioAssay2 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "RBA #2", scannedAssayId2, software, featureProtocol, arrayDesign, 2, false); 144 TestDataFileType.test_set_file(Item.RAWBIOASSAY, rawBioAssay2, DataFileType.GENERIC_RAW_DATA, genePixFile); 145 146 // **** Sequencing part ******** 147 // Libraries 148 int library = SystemItems.getId(Extract.LIBRARY); 149 int library1 = TestExtract.test_create(extract1, "Library GO #1", library, 0, false); 150 int library2 = TestExtract.test_create(extract2, "Library GO #2", library, 0, false); 151 152 // Flow cell 153 int flowCell = TestPhysicalBioAssay.test_create(0, SystemItems.getId(PhysicalBioAssay.FLOW_CELL), false); 154 TestPhysicalBioAssay.test_add_extract(flowCell, library1, 1, null); 155 TestPhysicalBioAssay.test_add_extract(flowCell, library2, 2, null); 156 157 // Sequencing 158 int sequencing = TestDerivedBioAssaySet.test_create_root("Sequenced GO", flowCell, 159 SystemItems.getId(DerivedBioAssaySet.SEQUENCED), sequencingProtocol, sequencer, 0); 160 int assembly = TestDerivedBioAssaySet.test_create_child("Assembly GO", sequencing, 161 SystemItems.getId(DerivedBioAssaySet.ASSEMBLY), 0, 0, alignmentSoftware); 162 int alignedAssayId1 = TestDerivedBioAssaySet.test_add_bioassay(assembly, "Aligned GO #1"); 163 int alignedAssayId2 = TestDerivedBioAssaySet.test_add_bioassay(assembly, "Aligned GO #2"); 164 TestDataFileType.test_set_file(Item.DERIVEDBIOASSAY, alignedAssayId1, DataFileType.SAM, samFile); 165 TestDataFileType.test_set_file(Item.DERIVEDBIOASSAY, alignedAssayId2, DataFileType.SAM, samFile); 166 167 // Raw bioassays 168 int seqRaw1 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "SeqRBA #1", alignedAssayId1, software, 0, arrayDesign, 1, false); 169 int seqRaw2 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "SeqRBA #2", alignedAssayId2, software, 0, arrayDesign, 2, false); 170 171 // **** Experiment ****** 135 172 int experiment = TestExperiment.test_create("genepix", false); 136 173 TestExperiment.test_add_rawbioassay(experiment, rawBioAssay1, rawBioAssay2); … … 147 184 // Main items 148 185 TestExperiment.test_delete(experiment); 186 187 TestRawBioAssay.test_delete(seqRaw1); 188 TestRawBioAssay.test_delete(seqRaw2); 189 TestDerivedBioAssaySet.test_delete(assembly); 190 TestDerivedBioAssaySet.test_delete(sequencing); 191 TestPhysicalBioAssay.test_delete(flowCell); 192 TestExtract.test_delete(library1); 193 TestExtract.test_delete(library2); 194 149 195 TestRawBioAssay.test_delete(rawBioAssay1); 150 196 TestRawBioAssay.test_delete(rawBioAssay2); 151 Test Scan.test_delete(scan);197 TestDerivedBioAssaySet.test_delete(scan); 152 198 TestPhysicalBioAssay.test_delete(hyb); 153 199 TestArraySlide.test_delete(arraySlide); … … 158 204 TestExtract.test_delete(labeledExtract2); 159 205 TestExtract.test_delete(labeledExtract2Ref); 206 160 207 TestExtract.test_delete(extractPooled); 161 208 TestExtract.test_delete(extract1); … … 167 214 // Support items 168 215 TestSoftware.test_delete(software); 216 TestSoftware.test_delete(alignmentSoftware); 169 217 TestHardware.test_delete(scanner); 218 TestHardware.test_delete(sequencer); 170 219 TestProtocol.test_delete(featureProtocol); 171 220 TestProtocol.test_delete(scanningProtocol); 221 TestProtocol.test_delete(sequencingProtocol); 172 222 TestFile.test_delete(celFile); 173 223 TestFile.test_delete(genePixFile); 174 224 TestFile.test_delete(reporterMap); 225 TestFile.test_delete(samFile); 175 226 TestAnnotationType.test_delete(scanPower); 176 227 TestAnnotationType.test_delete(annotationType); -
trunk/src/test/TestIlluminaImporter.java
r5642 r5652 44 44 int fileId = TestFile.test_create("data/test.illumina.rawdata.txt", false, false); 45 45 int hybId = TestPhysicalBioAssay.test_create(0, 0, false); 46 int scanId = TestScan.test_create(hybId, 0, 0, false); 46 //int scanId = TestScan.test_create(hybId, 0, 0, false); 47 int scanId = 0; 47 48 int protocolId = TestProtocol.test_create(SystemItems.getId(Protocol.FEATURE_EXTRACTION), null, false); 48 49 int softwareId = TestSoftware.test_create(SystemItems.getId(Software.FEATURE_EXTRACTION), null, false); … … 72 73 TestJob.test_delete(jobId); 73 74 74 TestScan.test_delete(scanId);75 //TestScan.test_delete(scanId); 75 76 TestSoftware.test_delete(softwareId); 76 77 TestProtocol.test_delete(protocolId); … … 106 107 request.setParameterValue("experiment", Experiment.getById(dc, experimentId)); 107 108 } 109 /* 108 110 if (scanId != 0) 109 111 { 110 112 request.setParameterValue("scan", Scan.getById(dc, scanId)); 111 113 } 114 */ 112 115 if (protocolId != 0) 113 116 { -
trunk/src/test/TestItemImporter.java
r5649 r5652 142 142 143 143 // Import scans 144 /* 144 145 int scanFileId = TestFile.test_create("data/test.batchimport.scans.txt", false, false); 145 146 int scanImporterId = TestPluginDefinition.test_get("net.sf.basedb.plugins.batchimport.ScanImporter"); … … 147 148 ok &= TestJob.test_execute(scanJobId, false); 148 149 TestScan.test_list(3); 150 */ 149 151 150 152 // Import raw bioassays … … 169 171 170 172 // Delete scans 173 /* 171 174 TestScan.test_delete_all(); 172 175 TestJob.test_delete(scanJobId); 173 176 TestFile.test_delete(scanFileId); 177 */ 174 178 175 179 // Delete hybridizations … … 369 373 request.setParameterValue("arraySlideColumnMapping", "\\Array slide\\"); 370 374 } 375 /* 371 376 if (itemType == Item.SCAN) 372 377 { … … 375 380 request.setParameterValue("hardwareColumnMapping", "\\Scanner\\"); 376 381 } 382 */ 377 383 if (itemType == Item.RAWBIOASSAY) 378 384 { 379 385 request.setParameterValue("dataDirectory", "/"); 380 386 request.setParameterValue("arrayIndexColumnMapping", "\\Array index\\"); 381 request.setParameterValue("scanColumnMapping", "\\Scan\\");387 // request.setParameterValue("scanColumnMapping", "\\Scan\\"); 382 388 request.setParameterValue("protocolColumnMapping", "\\Protocol\\"); 383 389 request.setParameterValue("platformColumnMapping", "\\Platform\\"); -
trunk/src/test/TestMetadata.java
r5642 r5652 27 27 import net.sf.basedb.core.BasicItem; 28 28 import net.sf.basedb.core.DbControl; 29 import net.sf.basedb.core.DerivedBioAssay; 30 import net.sf.basedb.core.DerivedBioAssaySet; 29 31 import net.sf.basedb.core.Extract; 30 32 import net.sf.basedb.core.Formula; … … 34 36 import net.sf.basedb.core.Platform; 35 37 import net.sf.basedb.core.RawBioAssay; 36 import net.sf.basedb.core.Scan;37 38 import net.sf.basedb.core.Metadata.PropertyPath; 38 39 import net.sf.basedb.core.SystemItems; … … 59 60 test_create_property_path(RawBioAssay.class, "name", false); 60 61 // Association + id property 61 PropertyPath<RawBioAssay, Scan> scan =62 test_create_property_path(RawBioAssay.class, " scan.id", false);62 PropertyPath<RawBioAssay, DerivedBioAssaySet> scan = 63 test_create_property_path(RawBioAssay.class, "parent.bioAssaySet.id", false); 63 64 // Null association 64 65 PropertyPath<RawBioAssay, String> protocolName = 65 test_create_property_path(RawBioAssay.class, " scan.protocol.name", false);66 test_create_property_path(RawBioAssay.class, "parent.bioAssaySet.creationEvent.protocol.name", false); 66 67 // Date value 67 68 PropertyPath<RawBioAssay, Date> hybDate = 68 test_create_property_path(RawBioAssay.class, " scan.hybridization.creationEvent.entryDate", false);69 test_create_property_path(RawBioAssay.class, "parent.bioAssaySet.physicalBioAssay.creationEvent.entryDate", false); 69 70 // Long path + case insensitive 70 71 PropertyPath<RawBioAssay, String> design = 71 test_create_property_path(RawBioAssay.class, " Scan.Hybridization.Arrayslide.Arraybatch.Arraydesign", false);72 test_create_property_path(RawBioAssay.class, "Parent.BioAssaySet.PhysicalBioAssay.Arrayslide.Arraybatch.Arraydesign", false); 72 73 // Component 73 74 PropertyPath<Formula, Float> formulaMinValue = … … 80 81 test_create_property_path(RawBioAssay.class, "foo", true); 81 82 test_create_property_path(RawBioAssay.class, "name.foo", true); 82 test_create_property_path(RawBioAssay.class, " scan.foo", true);83 test_create_property_path(RawBioAssay.class, "parent.foo", true); 83 84 84 85 // Collection of entities should fail 85 test_create_property_path( Scan.class, "rawBioAssays", true);86 test_create_property_path(DerivedBioAssaySet.class, "bioAssays", true); 86 87 87 88 int designId = TestArrayDesign.test_create(Platform.GENERIC, true); … … 91 92 int labeledExtractId = TestExtract.test_create(0, "Test extract", SystemItems.getId(Extract.LABELED), labelId, true); 92 93 int hybId = TestPhysicalBioAssay.test_create(slideId, SystemItems.getId(PhysicalBioAssay.HYBRIDIZATION), true, labeledExtractId); 93 int scanId = TestScan.test_create(hybId, 0, 0, true); 94 // int scanId = TestScan.test_create(hybId, 0, 0, true); 95 int scanId = 0; 94 96 int rawId = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "My raw bioassay", 95 97 scanId, 0, 0, designId, 1, true); … … 110 112 TestFormula.test_delete(formulaId); 111 113 TestRawBioAssay.test_delete(rawId); 112 TestScan.test_delete(scanId);114 // TestScan.test_delete(scanId); 113 115 TestPhysicalBioAssay.test_delete(hybId); 114 116 TestExtract.test_delete(labeledExtractId); -
trunk/src/test/TestPhysicalBioAssay.java
r5642 r5652 82 82 } 83 83 84 static int test_create(int arraySlideId, int subtypeId, boolean setAll, int... labeledExtractIds)84 static int test_create(int arraySlideId, int subtypeId, boolean setAll, int... extractIds) 85 85 { 86 86 if (!TestUtil.hasPermission(Permission.CREATE, Item.PHYSICALBIOASSAY)) return 0; … … 105 105 } 106 106 BioMaterialEvent evt = h.getCreationEvent(); 107 for (int labeledExtractId : labeledExtractIds)108 { 109 Extract le = Extract.getById(dc, labeledExtractId);107 for (int extractId : extractIds) 108 { 109 Extract le = Extract.getById(dc, extractId); 110 110 evt.addSource(le, 100.0f); 111 111 } … … 267 267 } 268 268 269 static void test_add_ labeledextract(int hybId, int labeledExtractId, int arrayNum, Float usedQuantity)270 { 271 if (hybId == 0 || labeledExtractId == 0) return;269 static void test_add_extract(int hybId, int extractId, int arrayNum, Float usedQuantity) 270 { 271 if (hybId == 0 || extractId == 0) return; 272 272 DbControl dc = null; 273 273 try … … 275 275 dc = TestUtil.getDbControl(); 276 276 PhysicalBioAssay h = PhysicalBioAssay.getById(dc, hybId); 277 Extract le = Extract.getById(dc, labeledExtractId);277 Extract le = Extract.getById(dc, extractId); 278 278 BioMaterialEvent event = h.getCreationEvent(); 279 279 event.addSource(le, usedQuantity); 280 280 event.setSourceGroup(le, arrayNum); 281 281 dc.commit(); 282 write("--Add labeled extract to hybridizationOK");283 } 284 catch (Throwable ex) 285 { 286 write("--Add labeled extract to hybridizationFAILED");282 write("--Add extract to bioassay OK"); 283 } 284 catch (Throwable ex) 285 { 286 write("--Add extract to bioassay FAILED"); 287 287 ex.printStackTrace(); 288 288 ok = false; -
trunk/src/test/TestRawBioAssay.java
r5642 r5652 55 55 56 56 int hybridizationId = TestPhysicalBioAssay.test_create(0, 0, false); 57 int scanId = TestScan.test_create(hybridizationId, 0, 0, false); 57 int bioAssaySetId = TestDerivedBioAssaySet.test_create_root("Scan", hybridizationId, 58 SystemItems.getId(DerivedBioAssaySet.SCAN), 0, 0, 0); 59 int bioAssayId = TestDerivedBioAssaySet.test_add_bioassay(bioAssaySetId, "Bioassay 1"); 58 60 int arrayDesignId = TestArrayDesign.test_create(Platform.GENERIC, false); 59 61 int arrayDesignId2 = TestArrayDesign.test_create(Platform.GENERIC, false); … … 70 72 71 73 // Standard tests: create, load, list 72 int id = test_create(Platform.GENERIC, "genepix", null, scanId, softwareId, protocolId, arrayDesignId, 1, true);74 int id = test_create(Platform.GENERIC, "genepix", null, bioAssayId, softwareId, protocolId, arrayDesignId, 1, true); 73 75 int id2 = test_create(Platform.GENERIC, "genepix", null, 0, 0, 0, 0, 1, false); 74 76 int id3 = test_create(Platform.AFFYMETRIX, null, null, 0, 0, 0, 0, 1, false); … … 89 91 // Test adding raw data -- stored in files 90 92 int celId = TestFile.test_create("data/test.affymetrix.cel", false, false); 91 test_set_file(id3, "affymetrix.cel", celId); 92 test_list_files(id3, 1); 93 test_list_file_types(id3, 1); 93 TestDataFileType.test_set_file(Item.RAWBIOASSAY, id3, "affymetrix.cel", celId); 94 TestDataFileType.test_list_files(Item.RAWBIOASSAY, id3, 1); 95 TestDataFileType.test_list_file_types(Item.RAWBIOASSAY, id3, 1); 96 ok &= TestDataFileType.ok; 94 97 95 98 if (TestUtil.waitBeforeDelete()) TestUtil.waitForEnter(); … … 102 105 103 106 TestFile.test_delete(celId); 104 Test Scan.test_delete(scanId);107 TestDerivedBioAssaySet.test_delete(bioAssaySetId); 105 108 TestPhysicalBioAssay.test_delete(hybridizationId); 106 109 TestArrayDesign.test_delete(arrayDesignId); … … 113 116 } 114 117 115 static int test_create(String platformId, String rawDataType, String name, int scanId, int softwareId, int protocolId, int arrayDesignId, int arrayNum, boolean setAll)118 static int test_create(String platformId, String rawDataType, String name, int bioAssayId, int softwareId, int protocolId, int arrayDesignId, int arrayNum, boolean setAll) 116 119 { 117 120 if (!TestUtil.hasPermission(Permission.CREATE, Item.RAWBIOASSAY)) return 0; … … 138 141 rba.setProtocol(Protocol.getById(dc, protocolId)); 139 142 } 140 if ( scanId != 0)141 { 142 rba.set Scan(Scan.getById(dc, scanId));143 if (bioAssayId != 0) 144 { 145 rba.setParent(DerivedBioAssay.getById(dc, bioAssayId)); 143 146 } 144 147 if (arrayDesignId != 0) … … 316 319 "\t"+rd.getX()+"\t"+rd.getY()+"\t"+rd.getPosition()+ 317 320 "\t"+rd.getReporter()+"\t"+rd.getFeature()+(writeExtended ? "\t"+rd.getAllExtended() : "")); 318 }319 }320 321 static void write_item(int i, FileSetMember member)322 throws BaseException323 {324 if (!TestUtil.getSilent())325 {326 System.out.println(i+":\t"+member.getId()+"\t"+member.getFile().getName()+"\t"+327 member.getDataFileType().getName());328 321 } 329 322 } … … 579 572 } 580 573 } 581 582 static void test_set_file(int rawBioAssayId, String fileType, int fileId)583 {584 if (rawBioAssayId == 0 || fileId == 0) return;585 DbControl dc = null;586 try587 {588 dc = TestUtil.getDbControl();589 RawBioAssay rba = RawBioAssay.getById(dc, rawBioAssayId);590 DataFileType type = DataFileType.getByExternalId(dc, fileType);591 File file = File.getById(dc, fileId);592 rba.getFileSet().setMember(file, type);593 dc.commit();594 write("--Set file OK ("+fileType+")");595 }596 catch (Throwable ex)597 {598 write("--Set file FAILED ("+fileType+")");599 ex.printStackTrace();600 ok = false;601 }602 finally603 {604 if (dc != null) dc.close();605 }606 }607 608 static void test_list_files(int rawBioAssayId, int expectedResults)609 {610 if (rawBioAssayId == 0) return;611 DbControl dc = null;612 try613 {614 dc = TestUtil.getDbControl();615 RawBioAssay rba = RawBioAssay.getById(dc, rawBioAssayId);616 ItemResultList<FileSetMember> l = rba.getFileSet().getMembers().list(dc);617 for (int i = 0; i<l.size(); i++)618 {619 write_item(i, l.get(i));620 }621 if (expectedResults >= 0 && expectedResults != l.size())622 {623 throw new BaseException("Expected "+expectedResults+" results, not "+l.size());624 }625 write("--List files OK ("+l.size()+")");626 }627 catch (Throwable ex)628 {629 write("--List files FAILED");630 ex.printStackTrace();631 ok = false;632 }633 finally634 {635 if (dc != null) dc.close();636 }637 }638 639 static void test_list_file_types(int rawBioAssayId, int expectedResults)640 {641 if (rawBioAssayId == 0) return;642 DbControl dc = null;643 try644 {645 dc = TestUtil.getDbControl();646 RawBioAssay rba = RawBioAssay.getById(dc, rawBioAssayId);647 ItemResultList<DataFileType> l = rba.getFileSet().getMemberTypes().list(dc);648 for (int i = 0; i<l.size(); i++)649 {650 write_item(i, l.get(i));651 }652 if (expectedResults >= 0 && expectedResults != l.size())653 {654 throw new BaseException("Expected "+expectedResults+" results, not "+l.size());655 }656 write("--List file types OK ("+l.size()+")");657 }658 catch (Throwable ex)659 {660 write("--List file types FAILED");661 ex.printStackTrace();662 ok = false;663 }664 finally665 {666 if (dc != null) dc.close();667 }668 }669 574 670 575 static void test_change_arraydesign(int id, int arrayDesignId) -
trunk/src/test/TestWebservices.java
r5368 r5652 24 24 import net.sf.basedb.core.Config; 25 25 import net.sf.basedb.core.DataFileType; 26 import net.sf.basedb.core.Item; 26 27 import net.sf.basedb.core.Platform; 27 28 import net.sf.basedb.core.Type; … … 112 113 TestArrayDesign.test_set_file(affyDesignId, DataFileType.AFFYMETRIX_CDF, cdfId); 113 114 int affyRaw1 = TestRawBioAssay.test_create(Platform.AFFYMETRIX, null, "Affymetrix.1", 0, 0, 0, affyDesignId, 1, false); 114 Test RawBioAssay.test_set_file(affyRaw1, "affymetrix.cel", celId);115 TestDataFileType.test_set_file(Item.RAWBIOASSAY, affyRaw1, "affymetrix.cel", celId); 115 116 int affyRaw2 = TestRawBioAssay.test_create(Platform.AFFYMETRIX, null, "Affymetrix.2", 0, 0, 0, affyDesignId, 1, false); 116 Test RawBioAssay.test_set_file(affyRaw2, "affymetrix.cel", celId);117 TestDataFileType.test_set_file(Item.RAWBIOASSAY, affyRaw2, "affymetrix.cel", celId); 117 118 118 119 int affyExperimentId = TestExperiment.test_create("platform.affymetrix", true); -
trunk/src/test/net/sf/basedb/test/roles/PowerUserTest.java
r5650 r5652 134 134 Unit volt = potential.getUnit("V"); 135 135 AnnotationType pmtGain = createProtocolParameter(dc, "PMT gain", 136 Type.FLOAT, volt, null, new Item[] { Item. SCAN}136 Type.FLOAT, volt, null, new Item[] { Item.DERIVEDBIOASSAYSET } 137 137 ); 138 138 -
trunk/src/test/net/sf/basedb/test/roles/UserTest.java
r5649 r5652 33 33 import net.sf.basedb.core.DataFileType; 34 34 import net.sf.basedb.core.DbControl; 35 import net.sf.basedb.core.DerivedBioAssaySet; 35 36 import net.sf.basedb.core.Experiment; 36 37 import net.sf.basedb.core.Extract; … … 54 55 import net.sf.basedb.core.RawDataTypes; 55 56 import net.sf.basedb.core.Sample; 56 import net.sf.basedb.core.Scan;57 57 import net.sf.basedb.core.StringParameterType; 58 58 import net.sf.basedb.core.SystemItems; … … 169 169 Sample sRef = null; 170 170 171 Scansc1 = null;172 Scansc2 = null;173 Scansc1DyeSwap = null;174 Scansc2DyeSwap = null;175 ScanaffyScan1 = null;176 ScanaffyScan2 = null;177 ScanaffyScan3 = null;171 DerivedBioAssaySet sc1 = null; 172 DerivedBioAssaySet sc2 = null; 173 DerivedBioAssaySet sc1DyeSwap = null; 174 DerivedBioAssaySet sc2DyeSwap = null; 175 DerivedBioAssaySet affyScan1 = null; 176 DerivedBioAssaySet affyScan2 = null; 177 DerivedBioAssaySet affyScan3 = null; 178 178 179 179 RawBioAssay rba1 = null; … … 278 278 importHybridizations(hybridizationBatchImporter, batchImportFile_Hybridization); 279 279 importScans(scanBatchImporter, batchImportFile_Scan); 280 importAnnotations(annotationImporter, batchImportFile_Scan, Item. SCAN, getScanColumnHeaders(), "\\t");280 importAnnotations(annotationImporter, batchImportFile_Scan, Item.DERIVEDBIOASSAYSET, getScanColumnHeaders(), "\\t"); 281 281 importRawBioAssays(rawBioAssayBatchImporter, batchImportFile_RawBioAssay); 282 282 bioSource = Util.findBioSource(dc, "Biosource A"); … … 459 459 Create a scan. 460 460 */ 461 public static ScancreateScan(DbControl dc, String name, PhysicalBioAssay hyb, Float pmtGain, Unit unit)461 public static DerivedBioAssaySet createScan(DbControl dc, String name, PhysicalBioAssay hyb, Float pmtGain, Unit unit) 462 462 { 463 463 TestUtil.write("--Creating scan: " + name + "\n"); 464 Scan scan = Scan.getNew(dc, hyb); 464 DerivedBioAssaySet scan = DerivedBioAssaySet.getNew(dc, hyb); 465 scan.setItemSubtype(ItemSubtype.getById(dc, SystemItems.getId(DerivedBioAssaySet.SCAN))); 465 466 scan.setName(name); 466 467 scan.setProtocol(Util.findProtocol(dc, "Scanning A")); 467 scan.set Scanner(Util.findHardware(dc, "Scanner A"));468 scan.setHardware(Util.findHardware(dc, "Scanner A")); 468 469 dc.saveItem(scan); 469 470 470 471 if (pmtGain != null) 471 472 { 472 AnnotationType at = Util.findAnnotationType(dc, "PMT gain", Item. SCAN);473 AnnotationType at = Util.findAnnotationType(dc, "PMT gain", Item.DERIVEDBIOASSAYSET); 473 474 Util.setAnnotation(scan, at, pmtGain, unit); 474 475 } … … 481 482 */ 482 483 public static RawBioAssay createRawBioAssay(DbControl dc, Platform platform, 483 RawDataType rawDataType, String name, Scanscan, ArrayDesign design)484 RawDataType rawDataType, String name, DerivedBioAssaySet scan, ArrayDesign design) 484 485 { 485 486 TestUtil.write("--Creating raw bioassay: " + name + "\n"); 486 487 RawBioAssay rba = RawBioAssay.getNew(dc, platform, rawDataType); 487 488 rba.setName(name); 488 rba.setScan(scan);489 //rba.setScan(scan); 489 490 rba.setProtocol(Util.findProtocol(dc, "Feature extraction A")); 490 491 rba.setSoftware(Util.findSoftware(dc, "Software A")); -
trunk/src/test/net/sf/basedb/test/roles/Util.java
r5632 r5652 35 35 import net.sf.basedb.core.BioSource; 36 36 import net.sf.basedb.core.DbControl; 37 import net.sf.basedb.core.DerivedBioAssaySet; 37 38 import net.sf.basedb.core.Experiment; 38 39 import net.sf.basedb.core.Formula; … … 52 53 import net.sf.basedb.core.Role; 53 54 import net.sf.basedb.core.Sample; 54 import net.sf.basedb.core.Scan;55 55 import net.sf.basedb.core.Software; 56 import net.sf.basedb.core.SystemItems; 56 57 import net.sf.basedb.core.Tag; 57 58 import net.sf.basedb.core.Unit; … … 320 321 Returns the first scan that was found with a certain name 321 322 */ 322 public static Scan findScan(DbControl dc, String name) 323 { 324 ItemQuery<Scan> query = Scan.getQuery(); 323 public static DerivedBioAssaySet findScan(DbControl dc, String name) 324 { 325 ItemQuery<DerivedBioAssaySet> query = DerivedBioAssaySet.getQuery(); 326 query.restrict(Restrictions.eq(Hql.property("itemSubtype"), Expressions.integer(SystemItems.getId(DerivedBioAssaySet.SCAN)))); 325 327 query.restrict(Restrictions.eq(Hql.property("name"), Expressions.string(name))); 326 328 return query.list(dc).get(0); -
trunk/www/include/menu.jsp
r5642 r5652 466 466 final boolean hasPhysicalBioAssays = !sc.hasPermission(Permission.DENIED, Item.PHYSICALBIOASSAY); 467 467 468 final boolean hasScans = !sc.hasPermission(Permission.DENIED, Item.SCAN);469 final boolean createScans = sc.hasPermission(Permission.CREATE, Item.SCAN);470 468 final boolean hasRawBioAssays = !sc.hasPermission(Permission.DENIED, Item.RAWBIOASSAY); 471 469 final boolean createRawBioAssays = sc.hasPermission(Permission.CREATE, Item.RAWBIOASSAY); … … 549 547 tooltip="<%=menu.getString("physicalbioassays.tooltip", hasPhysicalBioAssays)%>" 550 548 enabled="<%=hasPhysicalBioAssays%>" 551 />552 <m:menuitem553 title="<%=common.getString("item.scan+")%>"554 onclick="<%="Menu.openUrl('"+root+"views/scans/index.jsp?ID="+ID+"')"%>"555 tooltip="<%=menu.getString("scans.tooltip", hasScans)%>"556 enabled="<%=hasScans%>"557 549 /> 558 550 <m:menuitem -
trunk/www/views/physicalbioassays/index.jsp
r5649 r5652 36 36 import="net.sf.basedb.core.Hardware" 37 37 import="net.sf.basedb.core.ItemSubtype" 38 import="net.sf.basedb.core.DerivedBioAssaySet" 38 39 import="net.sf.basedb.core.ItemQuery" 39 40 import="net.sf.basedb.core.ItemResultIterator" … … 44 45 import="net.sf.basedb.core.PermissionDeniedException" 45 46 import="net.sf.basedb.core.ItemAlreadyExistsException" 46 import="net.sf.basedb.core.Scan"47 47 import="net.sf.basedb.core.query.Hql" 48 48 import="net.sf.basedb.core.query.Orders" … … 76 76 <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> 77 77 <%! 78 private static final ItemContext defaultContext = Base.createDefaultContext("name", "name,itemSubtype,extracts,arraySlide, scans,description");78 private static final ItemContext defaultContext = Base.createDefaultContext("name", "name,itemSubtype,extracts,arraySlide,description"); 79 79 private static final Item itemType = Item.PHYSICALBIOASSAY; 80 80 … … 94 94 extractQuery.order(Orders.asc(Hql.property("name"))); 95 95 cc.setObject("export.dataloader.&creationEvent.sourceBioMaterials(name)", new ItemQueryLoader(extractQuery, bioassayParameter)); 96 97 ItemQuery<Scan> scanQuery = Scan.getQuery(); 98 scanQuery.include(cc.getInclude()); 99 scanQuery.restrict(Restrictions.eq(Hql.property("hybridization"), Expressions.parameter(bioassayParameter))); 100 scanQuery.order(Orders.asc(Hql.property("name"))); 101 cc.setObject("export.dataloader.&scans(name)", new ItemQueryLoader(scanQuery, bioassayParameter)); 96 97 ItemQuery<DerivedBioAssaySet> dbasQuery = DerivedBioAssaySet.getQuery(); 98 dbasQuery.include(cc.getInclude()); 99 dbasQuery.restrict(Restrictions.eq(Hql.property("physicalBioAssay"), Expressions.parameter(bioassayParameter))); 100 dbasQuery.restrict(Restrictions.eq(Hql.property("parent"), null)); 101 dbasQuery.order(Orders.asc(Hql.property("name"))); 102 cc.setObject("export.dataloader.&rootDerivedBioAssaySets(name)", new ItemQueryLoader(dbasQuery, bioassayParameter)); 102 103 } 103 104 %> -
trunk/www/views/physicalbioassays/list_bioassays.jsp
r5649 r5652 31 31 import="net.sf.basedb.core.Extract" 32 32 import="net.sf.basedb.core.Tag" 33 import="net.sf.basedb.core. Scan"33 import="net.sf.basedb.core.DerivedBioAssaySet" 34 34 import="net.sf.basedb.core.BioMaterialEvent" 35 35 import="net.sf.basedb.core.AnnotationType" … … 106 106 extractQuery.order(Orders.asc(Hql.property("name"))); 107 107 108 // Query for scans relatated to the current hybridization 109 final ItemQuery<Scan> scanQuery = Scan.getQuery(); 110 scanQuery.include(cc.getInclude()); 111 scanQuery.restrict(Restrictions.eq(Hql.property("hybridization"), Expressions.parameter("hybridization"))); 112 scanQuery.order(Orders.asc(Hql.property("name"))); 113 final boolean createScanPermission = sc.hasPermission(Permission.CREATE, Item.SCAN); 108 // Query for derived bioassay sets from to the current bioassay 109 final ItemQuery<DerivedBioAssaySet> dbasQuery = DerivedBioAssaySet.getQuery(); 110 dbasQuery.include(cc.getInclude()); 111 dbasQuery.restrict(Restrictions.eq(Hql.property("physicalBioAssay"), Expressions.parameter("bioAssay"))); 112 dbasQuery.restrict(Restrictions.eq(Hql.property("parent"), null)); 113 dbasQuery.order(Orders.asc(Hql.property("name"))); 114 final boolean createDerivedBioAssaySetPermission = sc.hasPermission(Permission.CREATE, Item.DERIVEDBIOASSAYSET); 114 115 115 116 Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); … … 306 307 /> 307 308 <tbl:columndef 308 id=" scans"309 title=" Scans"310 property="& scans(name)"309 id="derivedBioAssaySets" 310 title="Derived bioassay sets" 311 property="&rootDerivedBioAssaySets(name)" 311 312 datatype="string" 312 313 filterable="true" … … 641 642 enablePropertyLink="<%=mode.hasPropertyLink()%>" 642 643 /></tbl:cell> 643 <tbl:cell column=" scans">644 <tbl:cell column="derivedBioAssaySets"> 644 645 <% 645 scanQuery.setParameter("hybridization", itemId, Type.INT);646 dbasQuery.setParameter("bioAssay", itemId, Type.INT); 646 647 try 647 648 { 648 649 String separator = ""; 649 for ( Scan s : scanQuery.list(dc))650 for (DerivedBioAssaySet dbas : dbasQuery.list(dc)) 650 651 { 651 652 out.write(separator); 652 653 if (mode.hasPropertyLink()) 653 654 { 654 out.write(Base.getLinkedName(ID, s, false, mode.hasEditLink()));655 out.write(Base.getLinkedName(ID, dbas, false, mode.hasEditLink())); 655 656 } 656 657 else 657 658 { 658 out.write(HTML.encodeTags( s.getName()));659 out.write(HTML.encodeTags(dbas.getName())); 659 660 } 660 661 separator = ", "; … … 670 671 <base:icon 671 672 image="add.png" 672 onclick="<%="new Scan("+itemId+")"%>"673 tooltip="Create new scan"674 visible="<%=mode.hasEditLink() && create ScanPermission && usePermission %>"673 onclick="<%="newDerivedBioAssaySet("+itemId+")"%>" 674 tooltip="Create new derived bioassay set" 675 visible="<%=mode.hasEditLink() && createDerivedBioAssaySetPermission && usePermission %>" 675 676 /> 676 677 </tbl:cell> -
trunk/www/views/physicalbioassays/view_bioassay.jsp
r5649 r5652 37 37 import="net.sf.basedb.core.BioMaterialEvent" 38 38 import="net.sf.basedb.core.Protocol" 39 import="net.sf.basedb.core. Scan"39 import="net.sf.basedb.core.DerivedBioAssaySet" 40 40 import="net.sf.basedb.core.Group" 41 41 import="net.sf.basedb.core.Hardware" … … 221 221 <tbl:button 222 222 image="add.png" 223 onclick="new Scan()"224 title="New scan…"225 tooltip="Create a new scan from this hybridization"226 visible="<%=sc.hasPermission(Permission.CREATE, Item. SCAN) && usePermission%>"223 onclick="newDerivedBioAssaySet()" 224 title="New derived bioassay set…" 225 tooltip="Create a new derived bioassay set from this physical bioassay" 226 visible="<%=sc.hasPermission(Permission.CREATE, Item.DERIVEDBIOASSAYSET) && usePermission%>" 227 227 /> 228 228 <tbl:button … … 404 404 405 405 <% 406 ItemQuery< Scan> scanQuery = (ItemQuery<Scan>)pba.getScans();407 scanQuery.include(Include.ALL);408 scanQuery.order(Orders.asc(Hql.property("name")));409 ItemResultList< Scan> scans = scanQuery.list(dc);410 if ( scans.size() == 0)411 { 412 %> 413 <h4> Scans</h4>414 No scans has been created from this hybridization406 ItemQuery<DerivedBioAssaySet> dbasQuery = (ItemQuery<DerivedBioAssaySet>)pba.getRootDerivedBioAssaySets(); 407 dbasQuery.include(Include.ALL); 408 dbasQuery.order(Orders.asc(Hql.property("name"))); 409 ItemResultList<DerivedBioAssaySet> bioAssaySets = dbasQuery.list(dc); 410 if (bioAssaySets.size() == 0) 411 { 412 %> 413 <h4>Derived bioassay sets</h4> 414 No derived bioassay sets has been created from this bioassay 415 415 (or, you don't have permission to view them). 416 416 <% … … 420 420 %> 421 421 <base:section 422 id=" scanSection"423 title="<%=" Scans (" + scans.size() + ")"%>"422 id="derivedBioAssaySetsSection" 423 title="<%="Derived bioassay sets (" + bioAssaySets.size() + ")"%>" 424 424 context="<%=cc%>" 425 425 > 426 426 <tbl:table 427 id=" scans"427 id="derivedBioAssaySets" 428 428 clazz="itemlist" 429 429 columns="all" … … 434 434 /> 435 435 <tbl:columndef 436 id=" scanner"437 title=" Scanner"436 id="hardware" 437 title="Hardware" 438 438 /> 439 439 … … 447 447 <tbl:rows> 448 448 <% 449 for ( Scan item : scans)449 for (DerivedBioAssaySet item : bioAssaySets) 450 450 { 451 451 %> … … 456 456 visible="<%=item.isRemoved()%>" 457 457 /><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> 458 <tbl:cell column=" scanner"><base:propertyvalue item="<%=item%>" property="scanner" /></tbl:cell>458 <tbl:cell column="hardware"><base:propertyvalue item="<%=item%>" property="hardware" /></tbl:cell> 459 459 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 460 460 </tbl:row>
Note: See TracChangeset
for help on using the changeset viewer.