Changeset 24 for trunk/grails-app/domain
- Timestamp:
- Mar 23, 2011, 1:24:24 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/domain/nl/tno/metagenomics/AssaySample.groovy
r20 r24 15 15 Integer numUniqueSequences // Number of unique sequences / OTUs. Is only available after preprocessing 16 16 17 String oligoNumber // Oligonumber used to identify the sample 18 String tagSequence // Tag originally used to identify the sample 19 String tagName // Tag name 17 String fwOligo 18 String fwMidName 19 String fwTotalSeq 20 String fwMidSeq 21 String fwPrimerSeq 22 23 String revOligo 24 String revMidName 25 String revTotalSeq 26 String revMidSeq 27 String revPrimerSeq 20 28 21 29 static belongsTo = [ assay: Assay, sample: Sample, run: Run ] … … 24 32 static constraints = { 25 33 numUniqueSequences(nullable: true) 26 oligoNumber(nullable: true) 27 28 /* 29 , validator: { value, obj, errors -> 30 // When one oligoNumber is used in different assaysamples, 31 // they must also have the same tagSequences and tagNames 32 33 // Check whether this oligoNumber exists in the database 34 def otherAssaySamples = AssaySample.findAllByOligoNumber( value ) 35 if( !otherAssaySamples || otherAssaySamples.size() == 0 ) { 36 return true; 37 } 38 39 // Loop through the other assaysamples with this oligonumber 40 otherAssaySamples.each { otherAS -> 41 // Only check other objects, don't compare with itself (because that 42 // way it wouldn't be possible anymore to edit an object) 43 if( otherAS.id != obj.id ) { 44 if( otherAS.tagSequence != obj.tagSequence || otherAS.tagName != obj.tagName ) { 45 return false; 46 } 47 } 48 } 49 50 return true 51 } 52 */ 53 tagSequence(nullable: true) 54 tagName(nullable:true) 34 fwOligo(nullable: true) 35 fwMidName(nullable: true) 36 fwTotalSeq(nullable:true) 37 fwMidSeq(nullable:true) 38 fwPrimerSeq(nullable:true) 39 revOligo(nullable: true) 40 revMidName(nullable: true) 41 revTotalSeq(nullable:true) 42 revMidSeq(nullable:true) 43 revPrimerSeq(nullable:true) 55 44 run(nullable: true); 56 45 } … … 201 190 */ 202 191 public boolean containsData() { 203 return tagSequence || tagName || oligoNumber || numFiles() > 0; 192 return fwOligo || fwMidName || fwTotalSeq || fwMidSeq || fwPrimerSeq || 193 revOligo || revMidName || revTotalSeq || revMidSeq || revPrimerSeq || 194 numFiles() > 0; 204 195 } 205 196 … … 213 204 public void moveValuableDataTo( AssaySample otherAssaySample ) { 214 205 // Copy properties 215 otherAssaySample.tagSequence = tagSequence; 216 otherAssaySample.oligoNumber = oligoNumber; 217 otherAssaySample.tagName = tagName; 206 otherAssaySample.fwOligo = fwOligo; 207 otherAssaySample.fwMidName = fwMidName; 208 otherAssaySample.fwTotalSeq = fwTotalSeq; 209 otherAssaySample.fwMidSeq = fwMidSeq; 210 otherAssaySample.fwPrimerSeq = fwPrimerSeq; 218 211 212 otherAssaySample.revOligo = revOligo; 213 otherAssaySample.revMidName = revMidName; 214 otherAssaySample.revTotalSeq = revTotalSeq; 215 otherAssaySample.revMidSeq = revMidSeq; 216 otherAssaySample.revPrimerSeq = revPrimerSeq; 217 219 218 // Move attached data 220 219 def dataList = [] + sequenceData?.toList()
Note: See TracChangeset
for help on using the changeset viewer.