source: trunk/grails-app/domain/dbnp/studycapturing/Assay.groovy @ 1430

Last change on this file since 1430 was 1430, checked in by work@…, 10 years ago
  • set keyword expansion
  • Property svn:keywords set to Rev Author Date
File size: 1.9 KB
Line 
1package dbnp.studycapturing
2import nl.grails.plugins.gdt.*
3
4/**
5 * This class describes an Assay, which describes the application of a certain (omics) measurement to multiple samples.
6 * The actual data of these measurements are described in submodules of dbNP. The type property describes in which module
7 * this data can be found.
8 */
9class Assay extends nl.grails.plugins.gdt.TemplateEntity {
10        // The name of the assay, which should indicate the measurements represented in this assay to the user.
11        String name
12
13        // The dbNP module in which the assay omics data can be found. */
14        AssayModule module
15
16        // The assay ID which is used in the dbNP submodule which contains the actual omics data of this assay.
17        // This ID is generated in GSCF, but is used in the submodules to refer to this particular Assay.
18        String externalAssayID
19
20        /**
21         * return the domain fields for this domain class
22         * @return List
23         */
24        static List<TemplateField> giveDomainFields() { return Assay.domainFields }
25        static List<TemplateField> domainFields = [
26                new TemplateField(
27                        name: 'name',
28                        type: TemplateFieldType.STRING,
29                        preferredIdentifier: true,
30                        required: true
31                ),
32                new TemplateField(
33                        name: 'module',
34                        type: TemplateFieldType.MODULE,
35                        required: true
36                ),
37                new TemplateField(
38                        name: 'externalAssayID',
39                        type: TemplateFieldType.STRING,
40                        required: true
41                )
42        ]
43
44        // An Assay always belongs to one study.
45        static belongsTo = [parent: Study]
46
47        // An Assay can have many samples on which it is performed, but all samples should be within the 'parent' Study.
48        static hasMany = [samples: Sample]
49
50        static constraints = {
51                externalAssayID(nullable:false, blank:false, unique: true)
52        }
53
54    static mapping = {
55        sort "name"
56
57        // Workaround for bug http://jira.codehaus.org/browse/GRAILS-6754
58        templateTextFields type: 'text'
59    }
60
61        def String toString() {
62                return name;
63        }
64
65    def getToken() {
66                return externalAssayID
67    }
68}
Note: See TracBrowser for help on using the repository browser.