Changeset 64


Ignore:
Timestamp:
Dec 15, 2009, 4:37:11 PM (13 years ago)
Author:
ademcan
Message:

Loading new magetab data in the database from IDF file.

Location:
trunk
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/LoadController.groovy

    r63 r64  
    2424        File file = new File("/home/ademcan/Desktop/magetab/examples/E-GEOD-2354.idf.txt");
    2525
     26        def investigationDesign = new magetab.idf.InvestigationDesign();
    2627        def person = new magetab.idf.Person();
    2728        def protocol = new magetab.idf.Protocol();
    2829        def publication = new magetab.idf.Publication();
     30        def normalization = new magetab.sdrf.Normalization();
     31        //def termSource = new magetab.adf.Termsource();
     32        def comment = new magetab.idf.Comment();
     33        def experimentalInfo = new magetab.idf.ExperimentalInfo();
    2934
    3035        ArrayList rows = new ArrayList();
     
    4146            if (tmp_list.size() > 1){
    4247                if (tmp_list[0]=="Investigation Title"){
    43                     magetab.idf.InvestigationDesign investigationDesign = new magetab.idf.InvestigationDesign();
    44                     investigationDesign.title=tmp_list[1];
     48                    investigationDesign.title = tmp_list[1];
     49                }
     50                else if (tmp_list[0]=="Comment[AEMIAMESCORE]") {
     51                    comment.aemiameScore = tmp_list[1];
     52                }
     53                else if (tmp_list[0]=="Comment[SecondaryAccession]") {
     54                    comment.secondaryAccession = tmp_list[1];
     55                }
     56                else if (tmp_list[0]=="Comment[ArrayExpressReleaseDate]") {
     57                    comment.arrayExpressReleaseDate = tmp_list[1];
     58                }
     59                else if (tmp_list[0]=="Comment[ArrayExpressAccession]") {
     60                    comment.arrayExpressAccession = tmp_list[1];
     61                }
     62                else if (tmp_list[0]=="Comment[MAGETAB TimeStamp_Version]") {
     63                    comment.timestamp_version = tmp_list[1];
    4564                }
    4665                else if (tmp_list[0]=="Experimental Design") {
    47 
    48                 }
    49                 else if (tmp_list[0]=="Experimental Term Source REF") {
    50 
     66                    String design = tmp_list[1];
     67                    for (a in 2..tmp_list.size()-1){
     68                        design = design + " , " +tmp_list[a];
     69                    }
     70                    experimentalInfo.design = design;
     71                }
     72                else if (tmp_list[0]=="Experimental Design Term Source REF") {
     73                    String term_ref = tmp_list[1];
     74                    for (a in 2..tmp_list.size()-1){
     75                        term_ref = term_ref + " , " +tmp_list[a];
     76                    }
     77                    experimentalInfo.design_term_source_ref = term_ref;
    5178                }
    5279                else if (tmp_list[0]=="Experimental Factor Name") {
    53 
     80                    String factor_name = tmp_list[1];
     81                    for (a in 2..tmp_list.size()-1){
     82                        factor_name = factor_name + " , " +tmp_list[a];
     83                    }
     84                    experimentalInfo.factor_name = factor_name;
    5485                }
    5586                else if (tmp_list[0]=="Experimental Factor Type") {
    56 
     87                    String factor_type = tmp_list[1];
     88                    for (a in 2..tmp_list.size()-1){
     89                        factor_type = factor_type + " , " +tmp_list[a];
     90                    }
     91                    experimentalInfo.factor_type = factor_type;
    5792                }
    5893                else if (tmp_list[0]=="Experimental Factor Term Source REF") {
    59 
     94                    experimentalInfo.factor_term_source_ref = tmp_list[1];
    6095                }
    6196                else if (tmp_list[0]=="Person Last Name") {
     
    102137                }
    103138                else if (tmp_list[0]=="Normalization Type") {
    104 
     139                    normalization.type = tmp_list[1];
    105140                }
    106141                else if (tmp_list[0]=="Normalization Term Source REF") {
    107 
     142                    normalization.term_source_ref = tmp_list[1];
    108143                }
    109144                else if (tmp_list[0]=="Date Of Experiment") {
    110 
     145                    investigationDesign.dateOfExperiment = tmp_list[1];
    111146                }
    112147                else if (tmp_list[0]=="Public Release Date") {
    113 
     148                    investigationDesign.publicReleaseDate = tmp_list[1];
    114149                }
    115150                else if (tmp_list[0]=="PubMed ID") {
     
    120155                }
    121156                else if (tmp_list[0]=="Publication Author List") {
    122 
     157                    publication.authors_list = tmp_list[1];
    123158                }
    124159                else if (tmp_list[0]=="Publication Title") {
     
    126161                }
    127162                else if (tmp_list[0]=="Publication Status") {
    128 
     163                    def status = new magetab.idf.OntologyTerm();
     164                    status.text = tmp_list[1];
     165                    status.save();
     166                    publication.status = status;
    129167                }
    130168                else if (tmp_list[0]=="Publication Status Term Source REF") {
    131 
     169                    publication.status_term_source_ref = tmp_list[1];
    132170                }
    133171                else if (tmp_list[0]=="Experiment Description") {
    134 
     172                    investigationDesign.experimentDescription = tmp_list[1];
    135173                }
    136174                else if (tmp_list[0]=="Protocol Name") {
     
    138176                }
    139177                else if (tmp_list[0]=="Protocol Type") {
    140                    
     178                    def type = new magetab.idf.OntologyTerm();
     179                    for (j in 1..tmp_list.size()){
     180                        type.text = tmp_list[j];
     181                        type.save();
     182                    }
     183                    protocol.type = type;
    141184                }
    142185                else if (tmp_list[0]=="Protocol Description") {
     
    156199                }
    157200                else if (tmp_list[0]=="Protocol Term Source REF") {
    158 
     201                    protocol.term_source_ref = tmp_list[1];
    159202                }
    160203                else if (tmp_list[0]=="SDRF File") {
     
    162205                }
    163206                else if (tmp_list[0]=="Term Source Name") {
    164 
     207                    //termSource.name = tmp_list[1];
    165208                }
    166209                else if (tmp_list[0]=="Term Source File") {
    167 
     210                    //termSource.file = tmp_list[1];
    168211                }
    169212                else if (tmp_list[0]=="Term Source Version") {
    170 
    171                 }
    172 
     213                    //termSource.version = tmp_list[1];
     214                }
    173215            }
    174216
     
    176218            protocol.save();
    177219            publication.save();
     220            normalization.save();
     221            investigationDesign.save();
     222            comment.save();
     223            experimentalInfo.save();
     224            //termSource.save();
    178225
    179226        }
  • trunk/grails-app/domain/magetab/idf/InvestigationDesign.groovy

    r59 r64  
    55    String title
    66    String experimentDescription
    7     Date dateOfExperiment
    8     Date publicReleaseDate
     7    String dateOfExperiment
     8    String publicReleaseDate
    99
    1010    static hasMany = [
     
    2323
    2424    static constraints = {
     25        title(nullable:true,blank:true)
     26        experimentDescription(nullable:true,blank:true)
     27        dateOfExperiment(nullable:true,blank:true)
     28        publicReleaseDate(nullable:true,blank:true)
    2529    }
    2630}
  • trunk/grails-app/domain/magetab/idf/OntologyTerm.groovy

    r59 r64  
    1111    static constraints = {
    1212//        termSource(nullable: true)
     13        text(nullable:true,blank:true)
     14        category(nullable:true,blank:true)
     15        accessionNumber(nullable:true,blank:true)
    1316    }
    1417}
  • trunk/grails-app/domain/magetab/idf/Protocol.groovy

    r63 r64  
    1010    String parameters
    1111    String contact
     12    String term_source_ref
    1213
    1314    static hasMany = [
     
    2324        parameters(nullable:true,blank:true)
    2425        contact(nullable:true,blank:true)
     26        term_source_ref(nullable:true,blank:true)
    2527    }
    2628}
  • trunk/grails-app/domain/magetab/idf/Publication.groovy

    r63 r64  
    77    String DOI
    88    OntologyTerm status
     9    String status_term_source_ref
     10    String authors_list
    911
    1012    static hasMany = [
     
    1719        pubMedID(nullable:true,blank:true)
    1820        DOI(nullable:true,blank:true)
     21        authors_list(nullable:true,blank:true)
    1922    }
    2023}
  • trunk/grails-app/domain/magetab/sdrf/Normalization.groovy

    r58 r64  
    33class Normalization {
    44
     5    String type;
     6    String term_source_ref;
     7
    58    static constraints = {
     9        type(nullable:true,blank:true)
     10        term_source_ref(nullable:true,blank:true)
    611    }
    712}
Note: See TracChangeset for help on using the changeset viewer.