Changeset 531


Ignore:
Timestamp:
Jan 10, 2008, 6:18:12 PM (13 years ago)
Author:
mbayer
Message:

had to add in ability for user to configure subject names and tissues against filenames and factors too - this implemented in UI now
also restructured code in writer class and test class

Location:
branches/uk_ac_ebi_Tab2MageImporter
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/uk_ac_ebi_Tab2MageImporter/jsp/uk/ac/ebi/nugo/plugins/experiment.jsp

    r530 r531  
    44<%@ page import="java.util.*"%>
    55
    6 <jsp:useBean id="inputDataBean" class="uk.ac.ebi.nugo.plugins.DataBean" scope="session"/>
     6<jsp:useBean id="inputDataBean" class="uk.ac.ebi.nugo.plugins.DataBean" scope="application"/>
    77<!-- submits the form data back to the bean assuming that each form element is matched to a variable in the bean by the same name -->
    88<jsp:setProperty name="inputDataBean" property="*"/>
     
    3232<link rel="stylesheet" type="text/css" href="/base/include/styles/main.css">
    3333<link rel="stylesheet" type="text/css" href="/base/include/styles/size_m.css">
     34
     35<script>
     36self.resizeTo(800,850);
     37</script>
    3438
    3539<script language="JavaScript" src="<%= request.getContextPath()%>/include/scripts/main.js" type="text/javascript"></script>
  • branches/uk_ac_ebi_Tab2MageImporter/jsp/uk/ac/ebi/nugo/plugins/hybridizations.jsp

    r530 r531  
    44<%@ page import="java.util.*"%>
    55
    6 <jsp:useBean id="inputDataBean" class="uk.ac.ebi.nugo.plugins.DataBean" scope="session" />
     6<jsp:useBean id="inputDataBean" class="uk.ac.ebi.nugo.plugins.DataBean" scope="application" />
    77<!-- submits the form data back to the bean assuming that each form element is matched to a variable in the bean by the same name -->
    88<jsp:setProperty name="inputDataBean" property="*" />
     
    182182  </tr>
    183183 
     184  <!-- question 8a -->
     185  <tr>
     186    <td class="boldText">Subject (replicate) labels:</td>
     187    <td class="input"><textarea rows="8" cols="32" name="subjectNames">plant1</textarea></td>
     188    <td>Please provide a list of labels(names) for the experimental subjects, one per line,
     189     in no particular order (copy and paste from Excel works).</td>
     190  </tr>
     191 
    184192  <!-- question 9 -->
    185193  <tr>
    186194    <td class="boldText">Target tissues:</td>
    187     <td class="input"><textarea rows="2" cols="32" name="tissues">stem</textarea></td>
    188     <td>List all target tissues (as a comma separated list).<br>
    189     Example: liver,heart</td>
     195    <td class="input"><textarea rows="4" cols="32" name="tissues">stem</textarea></td>
     196    <td>List all target tissues one per line, in no particular order (copy and paste from Excel works).</td>
    190197  </tr>
    191198 
  • branches/uk_ac_ebi_Tab2MageImporter/jsp/uk/ac/ebi/nugo/plugins/mappings.jsp

    r530 r531  
    77<%@ page import="uk.ac.ebi.nugo.plugins.*"%>
    88
    9 <jsp:useBean id="inputDataBean" class="uk.ac.ebi.nugo.plugins.DataBean" scope="session" />
     9<jsp:useBean id="inputDataBean" class="uk.ac.ebi.nugo.plugins.DataBean" scope="application" />
    1010<!-- submits the form data back to the bean assuming that each form element is matched to a variable in the bean by the same name -->
    1111<jsp:setProperty name="inputDataBean" property="*" />
     
    5151function gatherValues()
    5252{
    53   var fileString = '';
     53  var fileList = '';
     54  var subjectList = '';
     55  var tissueList = '';
    5456  var frm = document.forms['mappings'];
    5557  var numElements = frm.elements.length;
    56   //document.write(numElements);
    57   //document.write("<br />");
    5858  for(var i = 0; i < numElements; i++)
    5959  {
    6060    var value = frm.elements[i].value;
    6161    var id = frm.elements[i].id;
    62 
    63     if(id.match("fileinput"))
     62    if(id.match("fileInput"))
    6463    {
    65       //document.write("id = " + id);
    66       //document.write("<br />");
    67       //document.write("value = " + value);
    68       //document.write("<br />");
    69       fileString += frm.elements[i].value + '\t';
    70     }
    71   }
    72   //document.write('combined output = ' + fileString);
    73   frm.fileStringParam.value = fileString;
    74   //document.write('value of hidden input = ' + frm.fileStringParam.value);
     64      fileList += frm.elements[i].value + '\t';
     65    }
     66    if(id.match("subjectInput"))
     67    {
     68      subjectList += frm.elements[i].value + '\t';
     69    }
     70    if(id.match("tissueInput"))
     71    {
     72      tissueList += frm.elements[i].value + '\t';
     73    }
     74  }
     75  frm.fileList.value = fileList;
     76  frm.subjectList.value = subjectList;
     77  frm.tissueList.value = tissueList;
    7578}
    7679
     
    8891<input type="hidden" name="cmd" value="SetParameters">
    8992<input type="hidden" name="requestId" value="<%=requestId%>">
    90 <input type="hidden" id="fileStringParam" name="parameter:fileStringParam" value""/>
     93<input type="hidden" id="fileList" name="parameter:fileList" value""/>
     94<input type="hidden" id="subjectList" name="parameter:subjectList" value""/>
     95<input type="hidden" id="tissueList" name="parameter:tissueList" value""/>
    9196
    9297<!-- these are the parameters from the previous input pages; need to pick them up individually from the bean here; ugly as hell but can't be done any other way -->
     
    135140<input type="hidden" name="parameter:pooling" value="<%=inputDataBean.getPooling()%>">
    136141<input type="hidden" name="parameter:zipFile" value="<%=request.getParameter("path") %>" id="zipFile">
     142<input type="hidden" name="parameter:subjectNames" value="<%=inputDataBean.getSubjectNames()%>">
     143
    137144
    138145<%
     
    194201 
    195202  dc.close();
     203 
     204  //next get the subjectNames and make up select boxes with these
     205  //they too have to be mapped to filenames
     206  String [] subjectNames = request.getParameter("subjectNames").split("\n");
     207 
     208  //we also need to parse out the tissues string to produce another column of select boxes
     209  String [] tissueNames = request.getParameter("tissues").split("\n");
    196210%>
    197211
     
    201215
    202216The table below holds a list of all possible factor value combinations used in your experiment.
    203 Please select, for each combination, the appropriate file name from the drop down menu.</p><p>
     217Please select, for each combination, the appropriate file, subject and tissue from the drop down menu.</p><p>
    204218
    205219<!-- this table holds the combinations of factor values -->
     
    213227    <!-- file selector header -->
    214228    <td class="header"><h3>File</h3></td>
     229    <td class="header"><h3>Subject</h3></td>
     230    <td class="header"><h3>Tissue</h3></td>
    215231
    216232    <!-- factor names -->
     
    236252    <!-- first we need a cell with a drop down menu where we can select a filename to match the combination of factor values-->
    237253
    238     <td class="input" ><select id="fileinput<%=i %>">
     254    <td class="input" ><select id="fileInput<%=i %>">
    239255      <%
    240256          for (int k = 0; k < fileNamesArr.length; k++)
     
    243259
    244260      <option><%=fileNamesArr[k]%></option>
     261
     262      <%
     263      }
     264      %>
     265    </select></td>
     266   
     267    <!-- next  we need a cell with a drop down menu where we can select a subject name to match the combination of factor values-->
     268
     269    <td class="input" ><select id="subjectInput<%=i %>">
     270      <%
     271          for (int k = 0; k < subjectNames.length; k++)
     272          {
     273      %>
     274
     275      <option><%=subjectNames[k]%></option>
     276
     277      <%
     278      }
     279      %>
     280    </select></td>
     281   
     282    <!-- next  we need a cell with a drop down menu where we can select a tissue name to match the combination of factor values-->
     283
     284    <td class="input" ><select id="tissueInput<%=i %>">
     285      <%
     286          for (int k = 0; k < tissueNames.length; k++)
     287          {
     288      %>
     289
     290      <option><%=tissueNames[k]%></option>
    245291
    246292      <%
  • branches/uk_ac_ebi_Tab2MageImporter/jsp/uk/ac/ebi/nugo/plugins/protocols.jsp

    r530 r531  
    55<%@ page import="java.lang.*"%>
    66
    7 <jsp:useBean id="inputDataBean" class="uk.ac.ebi.nugo.plugins.DataBean" scope="session" />
     7<jsp:useBean id="inputDataBean" class="uk.ac.ebi.nugo.plugins.DataBean" scope="application" />
    88<!-- submits the form data back to the bean assuming that each form element is matched to a variable in the bean by the same name -->
    99<jsp:setProperty name="inputDataBean" property="*" />
  • branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/DataBean.java

    r517 r531  
    4444  String zipFile;
    4545  String experimentId;
     46  String subjectNames;
    4647 
    4748 
     
    365366  {
    366367    this.numTreatmentGroups = numTreatmentGroups;
     368  }
     369  public String getSubjectNames()
     370  {
     371    return subjectNames;
     372  }
     373  public void setSubjectNames(String subjectNames)
     374  {
     375    this.subjectNames = subjectNames;
    367376  }
    368377 
  • branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/Tab2MageImporter.java

    r530 r531  
    113113          "hybridizationProtocolParams","scanningProtocolParams","platform","organism",
    114114          "numDesigns","dyeSwap","refSample","numTreatmentGroups","expFactors","numReplicates",
    115           "tissues","pooling","zipFile", "fileStringParam"};
     115          "tissues","pooling","zipFile", "fileList", "subjectList", "tissueList"};
    116116 
    117117
  • branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/Tab2MageWriter.java

    r530 r531  
    2929  String[] factorNames;
    3030  String [] fileNames;
    31  
    32   String domain;
    33   String accession;
    34   String qualityControl;
    35   String experimentalDesign;
    36   String experimentName;
    37   String description;
    38   String releaseDate;
    39   String submissionDate;
    40   String submitter;
    41   String organization;
    42   String publicationTitle;
    43   String authors;
    44   String journal;
    45   String volume;
    46   String issue;
    47   String pages;
    48   String year;
    49   String pubmedId;
    50   String treatmentProtocol;
    51   String extractionProtocol;
    52   String labelingProtocol;
    53   String hybridizationProtocol;
    54   String scanningProtocol;
    55   String treatmentProtocolParams;
    56   String extractionProtocolParams;
    57   String labelingProtocolParams;
    58   String hybridizationProtocolParams;
    59   String scanningProtocolParams;
    60   String platform;
    61   String organism;
    62   String numDesigns;
    63   String dyeSwap;
    64   String refSample;
    65   String numTreatmentGroups;
    66   String expFactors;
    67   String numReplicates;
    68   String tissues;
    69   String pooling;
    70   String zipFile;
    71   String experimentId;
    72   String fileStringParam;
    73  
     31  String [] subjectNames;
     32  String [] tissueNames;
     33
     34  public String domain;
     35  public String accession;
     36  public String qualityControl;
     37  public String experimentalDesign;
     38  public String experimentName;
     39  public String description;
     40  public String releaseDate;
     41  public String submissionDate;
     42  public String submitter;
     43  public String organization;
     44  public String publicationTitle;
     45  public String authors;
     46  public String journal;
     47  public String volume;
     48  public String issue;
     49  public String pages;
     50  public String year;
     51  public String pubmedId;
     52  public String treatmentProtocol;
     53  public String extractionProtocol;
     54  public String labelingProtocol;
     55  public String hybridizationProtocol;
     56  public String scanningProtocol;
     57  public String treatmentProtocolParams;
     58  public String extractionProtocolParams;
     59  public String labelingProtocolParams;
     60  public String hybridizationProtocolParams;
     61  public String scanningProtocolParams;
     62  public String platform;
     63  public String organism;
     64  public String numDesigns;
     65  public String dyeSwap;
     66  public String refSample;
     67  public String numTreatmentGroups;
     68  public String expFactors;
     69  public String numReplicates;
     70  public String tissues;
     71  public String pooling;
     72  public String zipFile;
     73  public String experimentId;
     74  public String fileList;
     75  public String subjectList;
     76  public String tissueList;
     77
    7478
    7579  // ===================================================c'tor================================================
     
    8791  public Tab2MageWriter()
    8892  {
    89     initTestParamValues();
     93
    9094  }
    9195
     
    104108        field.set(this, job.getValue(paramNames[i]));
    105109      }
    106      
     110
    107111      //now extract the factor values and store them suitably so we can access them
    108112      makeFactorValueCombinations();
     
    113117    }
    114118  }
    115  
    116   // -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    117    
    118   private void makeFactorValueCombinations()
     119
     120  // -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     121
     122  public void makeFactorValueCombinations()
    119123  {
    120124    //first extract the factor names and the possible values
     
    147151      System.out.println();
    148152    }
    149    
     153
    150154    //now we want the filenames in a separate array so we can add them to their appropriate combinations as selected
    151155    //by the user in the UI
     
    153157    //array in the order we find them in the string
    154158    //they then match the order of the combinations in the cartesian product
    155     fileNames = fileStringParam.split("\t");
    156   }
    157  
     159    fileNames = fileList.split("\t");
     160    //ditto for the lists of subject names and tissues
     161    subjectNames = subjectList.split("\t");
     162    tissueNames = tissueList.split("\t");
     163  }
     164
    158165
    159166  // -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     
    175182
    176183    String[] rowHeaders = new String[]
    177     { "domain", "accession", "quality_control", "experiment_design_type", "name", "description",
     184                                     { "domain", "accession", "quality_control", "experiment_design_type", "name", "description",
    178185            "release_date", "submission_date", "submitter", "organization",
    179186            "publication_title", "authors", "journal", "volume", "issue", "pages",
    180187            "year", "pubmed_id" };
    181188    String[] experimentParams = new String[]
    182     { domain, accession, qualityControl, experimentalDesign, experimentName, description, releaseDate,
     189                                           { domain, accession, qualityControl, experimentalDesign, experimentName, description, releaseDate,
    183190            submissionDate, submitter, organization, publicationTitle, authors,
    184191            journal, volume, issue, pages, year, pubmedId };
     
    208215     */
    209216    String[] accessions = new String[]
    210     { "P-DIET-1", "P-EXTR-1", "P-LABL-1", "P-HYBR-1", "P-SCAN-1" };
     217                                     { "P-DIET-1", "P-EXTR-1", "P-LABL-1", "P-HYBR-1", "P-SCAN-1" };
    211218    String[] names = new String[]
    212     { "treatment", "extraction", "labeling", "hybridization", "scanning" };
     219                                { "treatment", "extraction", "labeling", "hybridization", "scanning" };
    213220    String[] values = new String[]
    214     { treatmentProtocol, extractionProtocol, labelingProtocol, hybridizationProtocol, scanningProtocol };
     221                                 { treatmentProtocol, extractionProtocol, labelingProtocol, hybridizationProtocol, scanningProtocol };
    215222    String[] parameters = new String[]
    216     { treatmentProtocolParams, extractionProtocolParams, labelingProtocolParams,
     223                                     { treatmentProtocolParams, extractionProtocolParams, labelingProtocolParams,
    217224            hybridizationProtocolParams, scanningProtocolParams };
    218225    String[] types = new String[]
    219     { "grow", "extraction", "labeling", "hybridization", "scanning" };
     226                                { "grow", "extraction", "labeling", "hybridization", "scanning" };
    220227
    221228    // print header
     
    241248    // print column headers for the section
    242249    String[] colHeaders = new String[]
    243     { "File[raw]", "Array[accession]", "BioSource", "BioMaterialCharacteristics[Organism]",
     250                                     { "File[raw]", "Array[accession]", "BioSource", "BioMaterialCharacteristics[Organism]",
    244251            "BioMaterialCharacteristics[OrganismPart]",
    245252            "BioMaterialCharacteristics[CellType]", "Sample", "Protocol[grow]",
     
    251258      t2mContent += colHeaders[i] + "\t";
    252259    }
    253    
     260
    254261    //now print the factorvalue headers
    255262    for (int i = 0; i < factorNames.length; i++)
     
    257264      t2mContent += "FactorValue["+factorNames[i] + "]\t";
    258265    }
    259    
     266
    260267    //next line will be data
    261268    t2mContent += "\n";
    262269
    263     //single channel data -- currently only Affy
    264     //we only need a single record for each tissue in each subject here
     270    //determine whether this is a single or dual channel experiment
     271    boolean singleChannel = false;
     272    //the number of times we have to print the block of data below
     273    //with dual channel platforms we have to print each block (row) twice
     274    int numPrintRepeats = 2;
    265275    if (platform.equalsIgnoreCase("affymetrix"))
    266276    {
    267       int count = 1;
    268 
    269       int numSubjects = Integer.parseInt(numReplicates);
    270       String[] allTissues = tissues.split(",");
    271       int numTissues = allTissues.length;
    272       int numGroups = Integer.parseInt(numTreatmentGroups);
    273 
    274       // for each treatment group
    275       for (int i = 1; i <= numGroups; i++)
     277      singleChannel = true;
     278      numPrintRepeats = 1;
     279    }
     280
     281
     282    //we need a single record for each tissue in each subject here
     283
     284    int count = 1;
     285
     286    int numSubjects = Integer.parseInt(numReplicates);
     287    String[] allTissues = tissues.split(",");
     288    int numTissues = allTissues.length;
     289    int numGroups = Integer.parseInt(numTreatmentGroups);
     290
     291    // for each treatment group i.e. factor value combination
     292    for (int i = 1; i <= numGroups; i++)
     293    {
     294      System.out.println("i=" +i);
     295      System.out.println("count = " + count);
     296      int subjectCount = 0;
     297      // for each subject within each group i.e. biological replicate within each factor value combination
     298      for (int j = 1; j <= numSubjects; j++)
    276299      {
    277         System.out.println("i=" +i);
    278         int subjectCount = 0;
    279         // for each subject within each group
    280         for (int j = 1; j <= numSubjects; j++)
     300        subjectCount = (i - 1) * numSubjects + j;
     301        System.out.println("subjectCount = "+ subjectCount);
     302        // for each target tissue for this subject
     303        for (int k = 1; k <= numTissues; k++)
    281304        {
    282           subjectCount = (i - 1) * numSubjects + j;
    283           // for each target tissue
    284           for (int k = 1; k <= numTissues; k++)
     305          for(int r = 0; r< numPrintRepeats; r++)
    285306          {
    286 
     307            String subjectName = subjectNames[count-1];
     308           
    287309            // file count first
    288310            t2mContent += fileNames[count-1] + "\t" +
     311           
    289312            // accession no. i.e the array
    290313            // design
    291314            accession + "\t" +
     315           
    292316            // bio source
    293             "group-" + i + "-subject-" + subjectCount + "\t" +
     317            subjectName + "\t" +
     318           
    294319            // BioMaterialCharacteristics[Organism]
    295320            organism + "\t" +
     321           
    296322            // BioMaterialCharacteristics[OrganismPart]
    297             allTissues[k - 1] + "\t" +
     323            tissueNames[count-1] + "\t" +
     324           
    298325            // BioMaterialCharacteristics[CellType]
    299326            "" + "\t" +
     327           
    300328            // sample
    301             "group-" + i + "-subject-" + subjectCount + ".sample-" + k + "\t" +
     329            subjectName + ".sample-" + k + "\t" +
     330           
    302331            // Protocol[grow]
    303332            "P-DIET-1" + "\t" +
     333           
    304334            // Extract
    305             "group-" + i + "-subject-" + subjectCount + ".sample-" + k + "-extract" + "\t" +
     335            subjectName + ".sample-" + k + "-extract" + "\t" +
     336           
    306337            // Protocol[extraction]
    307338            "P-EXTR-1" + "\t" +
     339           
    308340            // LabeledExtract
    309             "group-" + i + "-subject-" + subjectCount + ".sample-" + k + "-extract-le" + "\t" +
     341            subjectName + ".sample-" + k + "-extract-le" + "\t" +
     342           
    310343            // Protocol[labeling]
    311             "P-LABL-1" + "\t" +
     344            "P-LABL-1" + "\t" ;
     345           
    312346            // Dye
    313             "biotin" + "\t" +
     347            //depends on platform and repeat no.
     348            if(singleChannel)
     349            {
     350              t2mContent +="biotin" + "\t";
     351            }
     352            if(!singleChannel && numPrintRepeats==0)
     353            {
     354              t2mContent +="Cy3" + "\t";
     355            }
     356            if(!singleChannel && numPrintRepeats==1)
     357            {
     358              t2mContent +="Cy5" + "\t";
     359            }
     360           
    314361            // Hybridization
    315             "hybridization-" + count + "\t" +
     362            t2mContent += "hybridization-" + count + "\t" +
     363           
    316364            // Protocol[hybridization]
    317365            "P-HYBR-1" + "\t" +
     366           
    318367            // Scan
    319368            "scan-" + count + "\t" +
     369           
    320370            // Protocol[scanning]
    321371            "P-SCAN-1" + "\t";
    322            
     372
    323373            //now print all the factor values
    324374            // FactorValue[Treatment Type]
     
    327377            for(int n=0; n< cartesianProduct[0].length; n++)
    328378            {
    329               System.out.println("count = " + count);
    330379              System.out.println("n = "+ n);
    331380              t2mContent +=cartesianProduct[i-1][n]+ "\t";
     
    339388      }
    340389    }
    341 
    342     else //non Affy data, i.e. two channel
    343     {
    344 
    345       int count = 1;
    346 
    347       int numSubjects = Integer.parseInt(numReplicates);
    348       String[] allTissues = tissues.split(",");
    349       int numTissues = allTissues.length;
    350       int numGroups = Integer.parseInt(numTreatmentGroups);
    351 
    352       // for each treatment group
    353       for (int i = 1; i <= numGroups; i++)
    354       {
    355         int subjectCount = 0;
    356         // for each subject within each group
    357         for (int j = 1; j <= numSubjects; j++)
    358         {
    359           subjectCount = (i - 1) * numSubjects + j;
    360           // for each target tissue
    361           for (int k = 1; k <= numTissues; k++)
    362           {
    363             // this whole first block prints
    364             // the data for the first
    365             // channel
    366 
    367             // file count first
    368             t2mContent += fileNames[count-1] + "\t" +
    369             // accession no. i.e the array
    370             // design
    371             accession + "\t" +
    372             // bio source
    373             "group-" + i + "-subject-" + subjectCount + "\t" +
    374             // BioMaterialCharacteristics[Organism]
    375             organism + "\t" +
    376             // BioMaterialCharacteristics[OrganismPart]
    377             allTissues[k - 1] + "\t" +
    378             // BioMaterialCharacteristics[CellType]
    379             "" + "\t" +
    380             // sample
    381             "group-" + i + "-subject-" + subjectCount + ".sample-" + k + "\t" +
    382             // Protocol[grow]
    383             "P-DIET-1" + "\t" +
    384             // Extract
    385             "group-" + i + "-subject-" + subjectCount + ".sample-" + k + "-extract" + "\t" +
    386             // Protocol[extraction]
    387             "P-EXTR-1" + "\t" +
    388             // LabeledExtract
    389             "group-" + i + "-subject-" + subjectCount + ".sample-" + k + "-extract-le" + "\t" +
    390             // Protocol[labeling]
    391             "P-LABL-1" + "\t" +
    392             // Dye
    393             "Cy3" + "\t" +
    394             // Hybridization
    395             "hybridization-" + count + "\t" +
    396             // Protocol[hybridization]
    397             "P-HYBR-1" + "\t" +
    398             // Scan
    399             "scan-" + count + "\t" +
    400             // Protocol[scanning]
    401             "P-SCAN-1" + "\t" +
    402             // FactorValue[Treatment Type]
    403             "trt_group" + i + "\t";
    404 
    405             // new line
    406             t2mContent += "\n";
    407 
    408             // the second block prints the
    409             // data for the second channel
    410 
    411             // file count first
    412             t2mContent += fileNames[count-1] + "\t" +
    413             // accession no. i.e the array
    414             // design
    415             accession + "\t" +
    416             // bio source
    417             "reference" + "\t" +
    418             // BioMaterialCharacteristics[Organism]
    419             organism + "\t" +
    420             // BioMaterialCharacteristics[OrganismPart]
    421             "multi-tissue" + "\t" +
    422             // BioMaterialCharacteristics[CellType]
    423             "multi-cell type" + "\t" +
    424             // sample
    425             "reference" + "\t" +
    426             // Protocol[grow]
    427             "P-DIET-1" + "\t" +
    428             // Extract
    429             "reference" + "\t" +
    430             // Protocol[extraction]
    431             "P-EXTR-1" + "\t" +
    432             // LabeledExtract
    433             "reference" + "\t" +
    434             // Protocol[labeling]
    435             "P-LABL-1" + "\t" +
    436             // Dye
    437             "Cy5" + "\t" +
    438             // Hybridization
    439             "h" + count + "\t" +
    440             // Protocol[hybridization]
    441             "P-HYBR-1" + "\t" +
    442             // Scan
    443             "scan-" + count + "\t" +
    444             // Protocol[scanning]
    445             "P-SCAN-1" + "\t" +
    446             // FactorValue[Treatment Type]
    447             "reference" + "\t";
    448 
    449             // new line
    450             t2mContent += "\n";
    451 
    452             count++;
    453           }
    454         }
    455       }
    456     }
    457 
    458     // //////////////////////////////////////////////////////////////////////////////////////////////////////////
    459 
    460390  }
    461391
     
    468398    {
    469399      // set up a file writer
    470        dc = sc.newDbControl();
     400      dc = sc.newDbControl();
    471401      net.sf.basedb.core.File t2mFile = net.sf.basedb.core.File.getNew(dc, dir);
    472402      System.out.println("dir for writing new tab2mage file = " + dir.getName());
     
    543473  // -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    544474
    545   private void initTestParamValues()
    546   {
    547     /*
    548      * --org Homo_sapiens --array Agilent1 --single 2 --ref yes
    549      * --dye no --trtgroup 6 --factors
    550      * compound(aspirin,ibuprofen);dose(none,medium,high) --target
    551      * liver,heart,brain --subject 4
    552      */
    553 
    554     // experiment section
    555     experimentId = "2";
    556     domain = "scri.ac.uk";
    557     accession = "Affymetrix1";
    558     qualityControl = "biological replicate,spike quality control";
    559     experimentalDesign = "cell_component_comparison_design,RNA_stability_design,family_history_design,";
    560     experimentName = "New experiment";
    561     description = "description goes here";
    562     releaseDate = "2007-12-03";
    563     submissionDate = "2007-12-03";
    564     submitter = "Joe Bloggs";
    565     organization = "SCRI";
    566     publicationTitle = "My Ropey Paper";
    567     authors = "Bloggs, Joe";
    568     journal = "The Journal of Irreproducible Results";
    569     volume = "5";
    570     issue = "2";
    571     pages = "1234-1235";
    572     year = "2007";
    573     pubmedId = "11009762";
    574 
    575     // protocols
    576     treatmentProtocol = "my treatment protocol text";
    577     extractionProtocol = " my extraction protocol text";
    578     labelingProtocol = " my labeling protocol text";
    579     hybridizationProtocol = "my hybs protocol text";
    580     scanningProtocol = " my scanning protocol text";
    581     treatmentProtocolParams = "param1";
    582     extractionProtocolParams = "param2";
    583     labelingProtocolParams = "param3";
    584     hybridizationProtocolParams = "param4";
    585     scanningProtocolParams = " param5";
    586 
    587     // hybs
    588     platform = "Affymetrix";
    589     organism = "Solanum tuberosum";
    590     numDesigns = "1";
    591     dyeSwap = "no";
    592     refSample = "yes";
    593     numTreatmentGroups = "4";
    594     expFactors = "Strain(mutant,wildtype)\nTreatment(treated,control)";
    595     numReplicates = "2";
    596     tissues = "stem";
    597     pooling = "no";
    598     zipFile = "/home/michab/potato_small.zip";
    599     fileStringParam = "file1.CEL\tfile2.CEL\tfile3.CEL\tfile4.CEL\tfile5.CEL\tfile6.CEL\tfile7.CEL\tfile8.CEL";
    600    
    601    
    602     //now extract the factor values and store them suitably so we can access them
    603     makeFactorValueCombinations();
    604    
    605   }
    606   // -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    607475}// end class
  • branches/uk_ac_ebi_Tab2MageImporter/src/uk/ac/ebi/nugo/plugins/Tab2MageWriterTest.java

    r526 r531  
    1717      //get the tab2mage output gerenated by the writer
    1818      Tab2MageWriter writer = new Tab2MageWriter();
     19     
     20      //set parameters for testing
     21      writer.experimentId = "2";
     22      writer.domain = "scri.ac.uk";
     23      writer.accession = "Affymetrix1";
     24      writer.qualityControl = "biological replicate,spike quality control";
     25      writer.experimentalDesign = "cell_component_comparison_design,RNA_stability_design,family_history_design,";
     26      writer.experimentName = "New experiment";
     27      writer.description = "description goes here";
     28      writer.releaseDate = "2007-12-03";
     29      writer.submissionDate = "2007-12-03";
     30      writer.submitter = "Joe Bloggs";
     31      writer.organization = "SCRI";
     32      writer.publicationTitle = "My Ropey Paper";
     33      writer.authors = "Bloggs, Joe";
     34      writer.journal = "The Journal of Irreproducible Results";
     35      writer.volume = "5";
     36      writer.issue = "2";
     37      writer.pages = "1234-1235";
     38      writer.year = "2007";
     39      writer.pubmedId = "11009762";
     40
     41      // protocols
     42      writer.treatmentProtocol = "my treatment protocol text";
     43      writer.extractionProtocol = " my extraction protocol text";
     44      writer.labelingProtocol = " my labeling protocol text";
     45      writer.hybridizationProtocol = "my hybs protocol text";
     46      writer.scanningProtocol = " my scanning protocol text";
     47      writer.treatmentProtocolParams = "param1";
     48      writer.extractionProtocolParams = "param2";
     49      writer.labelingProtocolParams = "param3";
     50      writer.hybridizationProtocolParams = "param4";
     51      writer.scanningProtocolParams = " param5";
     52
     53      // hybs
     54      writer.platform = "Genepix";
     55      writer.organism = "Solanum tuberosum";
     56      writer.numDesigns = "1";
     57      writer.dyeSwap = "no";
     58      writer.refSample = "yes";
     59      writer.numTreatmentGroups = "4";
     60      writer.expFactors = "Strain(mutant,wildtype)\nTreatment(treated,control)";
     61      writer.numReplicates = "2";
     62      writer.tissues = "stem";
     63      writer.pooling = "no";
     64      writer.zipFile = "/home/michab/potato_small.zip";
     65      writer.fileList = "file1.CEL\tfile2.CEL\tfile3.CEL\tfile4.CEL\tfile5.CEL\tfile6.CEL\tfile7.CEL\tfile8.CEL";
     66      writer.subjectList = "plant1\tplant2\tplant3\tplant4\tplant5\tplant6\tplant7\tplant8";
     67      writer.tissueList = "stem\tleaf\troot\tstem\tleaf\troot\tstem\tleaf";
     68     
     69      writer.makeFactorValueCombinations();
     70     
     71     
    1972      String t2mContent = writer.generateFileContents();
    2073      System.out.println("t2mContent = \n\n" + t2mContent);
Note: See TracChangeset for help on using the changeset viewer.