Changeset 643


Ignore:
Timestamp:
Apr 9, 2008, 4:14:32 PM (15 years ago)
Author:
mbayer
Message:

code base simplified -- no longer supporting autogenerate option and have stripped things down accordingly to ease maintenance burden

Location:
plugins/base2/uk.ac.ebi.tab2mage/branches/tab2mageimporter
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • plugins/base2/uk.ac.ebi.tab2mage/branches/tab2mageimporter/build.xml

    r639 r643  
    6969
    7070  <target name="copyToServer" depends="build.plugin,copyJSPs">
    71     <copy file="${plugin.name}.jar" todir="${tomcat.home}\webapps\base\plugins" verbose="false" />
    72     <copy file="${utils.name}.jar" todir="${tomcat.home}\webapps\base\plugins" verbose="false" />
     71    <copy file="${plugin.name}.jar" todir="${tomcat.home}\webapps\base\WEB-INF\lib" verbose="false" />
     72    <copy file="${utils.name}.jar" todir="${tomcat.home}\webapps\base\WEB-INF\lib" verbose="false" />
    7373    <!-- now restart tomcat to reload the application -->
    7474    <echo message="tomcat home = "/>
  • plugins/base2/uk.ac.ebi.tab2mage/branches/tab2mageimporter/jsp/uk/ac/ebi/nugo/plugins/hybridizations.jsp

    r639 r643  
    159159    <select name="platform">
    160160    <option onclick="hideTwoChannelQuestions();">Affymetrix</option>
    161     <option onclick="showTwoChannelQuestions();">Agilent</option>
     161    <option onclick="showTwoChannelQuestions();" selected="selected" >Agilent</option>
    162162    <option onclick="showTwoChannelQuestions();">AIDA</option>
    163163    <option onclick="showTwoChannelQuestions();">BZScan</option>
    164164    <option onclick="showTwoChannelQuestions();">ChipSkipper</option>
    165     <option onclick="showTwoChannelQuestions();"  selected="selected" >GenePix</option>
     165    <option onclick="showTwoChannelQuestions();" >GenePix</option>
    166166    <option onclick="showTwoChannelQuestions();">GeneTAC</option>
    167167    <option onclick="showTwoChannelQuestions();">Illumina</option>
     
    178178  <tr>
    179179    <td class="boldText">Experimental organism:<font color="red"><b>&nbsp;*</b></font></td>
    180     <td class="input"><input type="text" size="50" name="organism" value="Solanum spp."/></td>
     180    <td class="input"><input type="text" size="50" name="organism" value="Mus musculus"/></td>
    181181    <td>The full scientific name of the experimental organism used.</td>
    182182  </tr>
     
    185185  <tr>
    186186    <td class="boldText">Number of hybridizations:<font color="red"><b>&nbsp;*</b></font></td>
    187     <td class="input"><input type="text" size="3" name="numHybs" value="4"/></td>
     187    <td class="input"><input type="text" size="3" name="numHybs" value="12"/></td>
    188188    <td>The total number of hybridizations in the experiment. <b>Please note: for two-channel experiments there are two hybridizations per chip.</b>
    189189    </td>
     
    215215  <tr>
    216216    <td class="boldText">Target tissues:<font color="red"><b>&nbsp;*</b></font></td>
    217     <td class="input"><textarea rows="4" cols="32" name="tissues">enterocyte</textarea></td>
     217    <td class="input"><textarea rows="4" cols="32" name="tissues">heart</textarea></td>
    218218    <td>List all target tissues -- one per line, in no particular order, each tissue once only.</td>
    219219  </tr>
     
    228228      <tr class="noBorder" >
    229229     
    230         <td style="vertical-align: middle;border-style: none;"><input type="text" name="path" size="35" value=""></td>
     230        <td style="vertical-align: middle;border-style: none;"><input type="text" name="path" size="35" value="/home/michab/E-MEXP-1340.raw.zip"></td>
    231231       
    232232        <td  style="vertical-align: middle;border-style: none;">
  • plugins/base2/uk.ac.ebi.tab2mage/branches/tab2mageimporter/jsp/uk/ac/ebi/nugo/plugins/mappings.jsp

    r639 r643  
    1 <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
     1<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
     2  pageEncoding="ISO-8859-1"%>
    23<%@ page import="java.util.*"%>
    34<%@ page import="java.util.zip.*"%>
     
    78<%@ page import="uk.ac.ebi.nugo.plugins.*"%>
    89
    9 <jsp:useBean id="inputDataBean" class="uk.ac.ebi.nugo.plugins.DataBean" scope="session" />
     10
     11<jsp:useBean id="inputDataBean" class="uk.ac.ebi.nugo.plugins.DataBean"
     12  scope="session" />
    1013<!-- 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 -->
    1114<jsp:setProperty name="inputDataBean" property="*" />
     
    2124  <head>
    2225
    23     <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/plugins/uk/ac/ebi/nugo/plugins/styles.css" />
    24     <link rel="stylesheet" type="text/css" href="/base/include/styles/main.css">
    25     <link rel="stylesheet" type="text/css" href="/base/include/styles/size_m.css">
    26 
    27     <script language="JavaScript" src="<%=request.getContextPath()%>/include/scripts/main.js" type="text/javascript"></script>
     26    <link rel="stylesheet" type="text/css"
     27      href="<%=request.getContextPath()%>/plugins/uk/ac/ebi/nugo/plugins/styles.css" />
     28    <link rel="stylesheet" type="text/css"
     29      href="/base/include/styles/main.css">
     30    <link rel="stylesheet" type="text/css"
     31      href="/base/include/styles/size_m.css">
     32
     33    <script language="JavaScript"
     34      src="<%=request.getContextPath()%>/include/scripts/main.js"
     35      type="text/javascript"></script>
    2836    <script language="JavaScript" type="text/javascript">
    2937
     
    7886      dyeList += frm.elements[i].value + '\t';
    7987    }
    80     if(id.match("combinationInput"))
     88    if(id.match("factorInput"))
    8189    {
    8290      combinationList += frm.elements[i].value + '\t';
     
    98106
    99107
    100     <form name="mappings" action="<%=request.getContextPath()%>/plugins/uk/ac/ebi/nugo/plugins/submit.jsp?ID=<%=ID%>"
     108    <form name="mappings"
     109      action="<%=request.getContextPath()%>/plugins/uk/ac/ebi/nugo/plugins/submit.jsp?ID=<%=ID%>"
    101110      method="post">
    102111
     
    133142        }
    134143       
    135         //here we get hold of the cartesian product of all the factor values
    136         //String[][] products = CartesianProduct.getCartesianProduct(factorValues);
    137        
    138144        //now inspect the content of the zip file and list all the individual files therein
    139145       
     
    172178        String[] tissueNames = inputDataBean.getTissues().split("\n");
    173179       
    174         //work out the number of hybridizations
    175         String platform = inputDataBean.getPlatform();
    176         //work out whether this is a single or dual channel experiment
     180        //work out the number of channels
    177181        boolean singleChannel = false;
    178         if (platform.equalsIgnoreCase("affymetrix"))
     182        if (inputDataBean.getPlatform().equalsIgnoreCase("affymetrix"))
    179183        {
    180184          singleChannel = true;
    181185        }
    182         int numReplicates = Integer.parseInt(inputDataBean.getNumReplicates());
    183         int numTreatmentGroups = Integer.parseInt(inputDataBean.getNumTreatmentGroups());
     186        //int numReplicates = Integer.parseInt(inputDataBean.getNumReplicates());
     187        //int numTreatmentGroups = Integer.parseInt(inputDataBean.getNumTreatmentGroups());
    184188        int numTissues = inputDataBean.getTissues().split("\n").length;
    185189        boolean dyeSwapBool = false;
     
    195199       
    196200        //we need the number of hybs so we can work out how many rows we have to print in the table of select boxes
    197         int numHybs = inputDataBean.getNumHybs();
     201        int numHybs = Integer.parseInt(inputDataBean.getNumHybs());
    198202        //this hash map contains all factor values - each entry represents a factor, with the factor name as key and a list of factor levels as the value
    199203        //we iterate over this to get the factor value input boxes in the table
    200         HashMap factorMap = Tab2MageUtils.getAllFactorValues(inputDataBean.getExpFactors());
     204        HashMap<String, List<String>> factorMap = Tab2MageUtils.getAllFactorValues(inputDataBean.getExpFactors());
    201205       
    202206        System.out.println("numHybs = " + numHybs);
     
    208212      <p>
    209213
    210         The table below allows you to configure your hybridizations as combinations of a subject/sample, tissue and factor
    211         values, and to then map them against a file name that corresponds to the hybridization.. Please select, for each
    212         hybridization, the appropriate file, subject, tissue, factor value combination and -- where appropriate -- dye from
    213         the drop down menus.
     214        The table below allows you to configure your hybridizations as
     215        combinations of a subject/sample, tissue and factor values, and to
     216        then map them against a file name that corresponds to the
     217        hybridization.. Please select, for each hybridization, the
     218        appropriate file, subject, tissue, factor value combination and --
     219        where appropriate -- dye from the drop down menus.
    214220      </p>
    215221      <p>
    216222
    217223        <!-- this table holds the combination values-->
     224      </p>
    218225      <table align="center" cellpadding="15">
    219226
     
    225232          <td class="header">
    226233            <h3>
    227               File
     234              file
    228235            </h3>
    229236          </td>
    230237          <td class="header">
    231238            <h3>
    232               Subject
     239              subject
    233240            </h3>
    234241          </td>
    235242          <td class="header">
    236243            <h3>
    237               Tissue
     244              tissue
    238245            </h3>
    239246          </td>
     
    245252          <td class="header">
    246253            <h3>
    247               Dye
     254              dye
    248255            </h3>
    249256          </td>
     
    258265          %>
    259266          <!-- have a  cell with the name of this factor -->
    260           <td><%=factorName%></td>
     267          <td class="header"><h3><%=factorName%></h3></td>
    261268          <%
    262269            }
     
    368375          %>
    369376          <!-- have a  cell with a select box  with factor values for this factor -->
    370           <td>
     377          <td class="input">
    371378            <select id="factorInput<%=i%>">
    372379              <%
     
    396403
    397404      <p>
    398       <table align="center" class="noBorder" cellspacing="5" cellpadding="5">
     405      </p>
     406      <table align="center" class="noBorder" cellspacing="5"
     407        cellpadding="5">
    399408        <tr class="noBorder">
    400409          <td id="back" style="border-style: none;">
    401             <div class="buttons" onmouseover="this.className='buttons_hover';" onmouseout="this.className='buttons';"
    402               onclick="back()">
     410            <div class="buttons" onmouseover="this.className='buttons_hover';"
     411              onmouseout="this.className='buttons';" onclick="back()">
    403412              <div class="buttons_inner">
    404413                <table class="noBorder" cellspacing="0" cellpadding="0">
     
    416425          </td>
    417426          <td id="next" style="border-style: none;">
    418             <div class="buttons" onmouseover="this.className='buttons_hover';" onmouseout="this.className='buttons';"
    419               onclick="submit()">
     427            <div class="buttons" onmouseover="this.className='buttons_hover';"
     428              onmouseout="this.className='buttons';" onclick="submit()">
    420429              <div class="buttons_inner">
    421430                <table class="noBorder" cellspacing="0" cellpadding="0">
     
    433442          </td>
    434443          <td id="close" style="border-style: none;">
    435             <div class="buttons" onmouseover="this.className='buttons_hover';" onmouseout="this.className='buttons';"
    436               onclick="window.close()">
     444            <div class="buttons" onmouseover="this.className='buttons_hover';"
     445              onmouseout="this.className='buttons';" onclick="window.close()">
    437446              <div class="buttons_inner">
    438447                <table class="noBorder" cellspacing="0" cellpadding="0">
  • plugins/base2/uk.ac.ebi.tab2mage/branches/tab2mageimporter/jsp/uk/ac/ebi/nugo/plugins/submit.jsp

    r639 r643  
    3434<p>
    3535
    36 Please review the values you have entered and click 'Submit' if you are happy with them -- otherwise you can use the Back button to
    37 navigate to earlier pages.
     36Please review the values you have entered and click 'Submit' if you are happy with them -- otherwise use the Back button to
     37navigate to previous pages and edit your values there.
    3838<p>
    3939
     
    6969    "hybridizationProtocolParams","scanningProtocolParams","platform","organism",
    7070    "numDesigns","dyeSwap","refSample","numTreatmentGroups","expFactors","numReplicates",
    71     "tissues","pooling","path","samplePairing","timeCourse","timePoints"};
     71    "tissues","pooling","path","samplePairing","timeCourse","timePoints", "numHybs"};
    7272   
    7373    String [] friendlyNames = new String []{"Domain","Accession","Quality Control","Experimental Design",
     
    7878    "Hybridization Protocol Parameters","Scanning Protocol Parameters","Platform","Organism",
    7979    "Number of Array Designs","Dye Swap","Reference Sample","Number of Treatment Groups","Experimental Factors","Number of Replicates per Group",
    80     "Tissues","Pooling","Zip File","Sample Pairing Rationale","Time Course","Time Points"};
     80    "Tissues","Pooling","Zip File","Sample Pairing Rationale","Time Course","Time Points" ,"Number of Hybridizations"};
    8181
    8282  //print out all relevant parameter values in the bean
  • plugins/base2/uk.ac.ebi.tab2mage/branches/tab2mageimporter/src/uk/ac/ebi/nugo/plugins/HybridizationEntry.java

    r558 r643  
    3838    String row = "";
    3939
    40     String subjectName = subjectNames[count];
    41     String fileName = fileNames[count];
    42     String tissue = tissueNames[count];
    43     String dyeName;
    44     if(singleChannel)
     40    try
    4541    {
    46       dyeName = "biotin";
     42      String subjectName = subjectNames[count];
     43      String fileName = fileNames[count];
     44      String tissue = tissueNames[count];
     45      String dyeName;
     46      if(singleChannel)
     47      {
     48        dyeName = "biotin";
     49      }
     50      else
     51      {
     52        dyeName = dyeNames[count];
     53      }
     54
     55      // file count first
     56      row += fileName + "\t" +
     57
     58      // accession no. i.e the array design
     59      accession + "\t" +
     60
     61      // bio source
     62      subjectName + "\t" +
     63
     64      // BioMaterialCharacteristics[Organism]
     65      organism + "\t" +
     66
     67      // BioMaterialCharacteristics[OrganismPart]
     68      tissue + "\t" +
     69
     70      // sample
     71      subjectName + ".sample-" + tissue + "\t" +
     72
     73      // Protocol[grow]
     74      "P-DIET-1" + "\t" +
     75
     76      // Extract
     77      subjectName + ".sample-" + tissue + "-extract" + "\t" +
     78
     79      // Protocol[extraction]
     80      "P-EXTR-1" + "\t" +
     81
     82      // LabeledExtract
     83      subjectName + ".sample-" + tissue + "-extract-le" + "\t" +
     84
     85      // Protocol[labeling]
     86      "P-LABL-1" + "\t" +
     87
     88      // Dye
     89      dyeName + "\t" +
     90
     91      // Hybridization
     92      "hybridization-" + count + "\t" +
     93
     94      // Protocol[hybridization]
     95      "P-HYBR-1" + "\t" +
     96
     97      // Scan
     98      "scan-" + count + "\t" +
     99
     100      // Protocol[scanning]
     101      "P-SCAN-1" + "\t";
     102
     103      //now print all the factor values
     104      for(int factorNumber=0; factorNumber< combinations[0].length; factorNumber++)
     105      {
     106        row +=combinations[count][factorNumber]+ "\t";
     107      }
     108
     109      // new line
     110      row += "\n";
    47111    }
    48     else
     112    catch (Exception e)
    49113    {
    50       dyeName = dyeNames[count];
     114      e.printStackTrace();
    51115    }
    52 
    53     // file count first
    54     row += fileName + "\t" +
    55 
    56     // accession no. i.e the array design
    57     accession + "\t" +
    58 
    59     // bio source
    60     subjectName + "\t" +
    61 
    62     // BioMaterialCharacteristics[Organism]
    63     organism + "\t" +
    64 
    65     // BioMaterialCharacteristics[OrganismPart]
    66     tissue + "\t" +
    67 
    68     // sample
    69     subjectName + ".sample-" + tissue + "\t" +
    70 
    71     // Protocol[grow]
    72     "P-DIET-1" + "\t" +
    73 
    74     // Extract
    75     subjectName + ".sample-" + tissue + "-extract" + "\t" +
    76 
    77     // Protocol[extraction]
    78     "P-EXTR-1" + "\t" +
    79 
    80     // LabeledExtract
    81     subjectName + ".sample-" + tissue + "-extract-le" + "\t" +
    82 
    83     // Protocol[labeling]
    84     "P-LABL-1" + "\t" +
    85 
    86     // Dye
    87     dyeName + "\t" +
    88 
    89     // Hybridization
    90     "hybridization-" + count + "\t" +
    91 
    92     // Protocol[hybridization]
    93     "P-HYBR-1" + "\t" +
    94 
    95     // Scan
    96     "scan-" + count + "\t" +
    97 
    98     // Protocol[scanning]
    99     "P-SCAN-1" + "\t";
    100 
    101     //System.out.println("combinations[0].length = "+ combinations[0].length);
    102     //System.out.println("combinations.length = " + combinations.length);
    103     //now print all the factor values
    104     // FactorValue[Treatment Type]
    105     for(int factorNumber=0; factorNumber< combinations[0].length; factorNumber++)
    106     {
    107       //System.out.println("count = " + count);
    108       //System.out.println("factorNumber = "+ factorNumber);
    109       row +=combinations[count][factorNumber]+ "\t";
    110     }
    111 
    112     // new line
    113     row += "\n";
    114116
    115117    return row;
  • plugins/base2/uk.ac.ebi.tab2mage/branches/tab2mageimporter/src/uk/ac/ebi/nugo/plugins/Tab2MageUtils.java

    r639 r643  
    33import java.util.Arrays;
    44import java.util.HashMap;
     5import java.util.LinkedHashMap;
    56import java.util.List;
    67
     
    1011 
    1112 
    12   public static HashMap<String, List<String>> getAllFactorValues(String expFactors)
     13  public static LinkedHashMap<String, List<String>> getAllFactorValues(String expFactors)
    1314  {
    14     HashMap<String, List<String>> hashMap = new HashMap<String, List<String>>();
     15    LinkedHashMap<String, List<String>> hashMap = new LinkedHashMap<String, List<String>>();
    1516   
    1617    String[] rawFactors = expFactors.split("\n");
     
    2627      String[] values = allValues.split(",");
    2728     
    28       //make new LinkedList with the values in it
     29      //make new List with the values in it
    2930      List<String> valueList = Arrays.asList(values);
    3031     
  • plugins/base2/uk.ac.ebi.tab2mage/branches/tab2mageimporter/src/uk/ac/ebi/nugo/plugins/Tab2MageWriter.java

    r558 r643  
    55import java.io.Writer;
    66import java.lang.reflect.Field;
     7import java.util.LinkedHashMap;
     8import java.util.List;
     9import java.util.Set;
    710
    811import net.sf.basedb.core.DbControl;
     
    2124  ParameterValues job;
    2225  boolean singleChannel = false;
    23   int numHybs = 0;
    24   int numFactors = 0;
    25 
    26   String[] paramNames;
    27   String[] factorNames;
     26
     27  String [] paramNames;
    2828  String [] fileNames;
    2929  String [] subjectNames;
    3030  String [] tissueNames;
    3131  String [] dyeNames;
     32  //stores the factor value combinations
     33  //outer array contains the combinations
     34  //each inner array contains a factor value for each factor
    3235  String [][] combinations;
    33   String[][] cartesianProduct;
    34   String[][] factorValues;
    3536
    3637  public String experimentId;
     
    8990  public String timePoints;
    9091  public String proceed;
     92  public String numHybs;
    9193
    9294
     
    111113
    112114  // sets all the values of the local variables to those found in the job
    113   // object
     115  // object so we can access them easily here
    114116  public void initJobParamValues()
    115117  {
     
    169171  // -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    170172
    171   //work out how many hybridizations we have in this experiment
    172   private void calcNumHybs()
    173   {
    174     //first work out how many hybs we are supposed to have
    175     boolean dyeSwapBool = false;
    176     boolean poolingBool = false;
    177     if(dyeSwap.equals("yes"))
    178     {
    179       dyeSwapBool = true;
    180     }
    181     if(pooling.equals("yes"))
    182     {
    183       poolingBool = true;
    184     }
    185     numHybs = Tab2MageUtils.calcNumHybs(dyeSwapBool,poolingBool, Integer.parseInt(numDesigns), Integer.parseInt(numReplicates), Integer.parseInt(numTreatmentGroups), tissues.split("\n").length);
    186   }
    187 
    188 
    189   // -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    190 
    191   public String[][] makeFactorValueCombinations()
    192   {
    193     String[] rawFactors = expFactors.split("\n");
    194 
    195     factorValues = new String[rawFactors.length][];
    196     factorNames = new String[rawFactors.length];
    197     numFactors = factorNames.length;
    198 
    199     for (int i = 0; i < rawFactors.length; i++)
    200     {
    201       //extract the factor name
    202       String factorName = rawFactors[i].substring(0, rawFactors[i].indexOf("("));
    203       factorNames[i] = factorName;
    204       //extract the possible values from between the parentheses
    205       String allValues = rawFactors[i].substring(rawFactors[i].indexOf("(") + 1,
    206               rawFactors[i].indexOf(")"));
    207       String[] values = allValues.split(",");
    208       factorValues[i] = values;
    209     }
    210 
    211     //here we get hold of the cartesian product of all the factor values
    212     return CartesianProduct.getCartesianProduct(factorValues); 
    213   }
    214 
    215   // -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    216 
    217173  private void initArrays()
    218174  {
    219     //if the mappings were manually selected by the user, do this
     175    //work out the number of experimental factors first
     176    int numFactors = expFactors.split("\n").length;
     177   
     178    //if the mappings were manually selected by the user
    220179    if(mappingsMode.equals("manualSelect"))
    221180    {
     
    230189      dyeNames = dyeList.split("\t");
    231190
    232       //parse the list of factor value combinations and put it into a 2d array
    233       String [] allCombis = combinationList.split("\t");
    234       combinations = new String [allCombis.length][];
    235       for (int i = 0; i < allCombis.length; i++)
    236       {
    237         String [] combi = allCombis[i].split(",");
     191      //parse the list of factor values and put it into a 2d array
     192      //these simply come as a long single String from the mappings page
     193      //values separated by tabs but no distinction between factors i.e.
     194      //factor1value1\tfactor2value1\tfactor1value2\tfactor2value2\t etc for two factors
     195      //need to split this appropriately
     196      String [] allValues = combinationList.split("\t");
     197      combinations = new String [Integer.parseInt(numHybs)][];
     198      int totalCount = 0;
     199      for (int i = 0; i < combinations.length; i++)
     200      {
     201        String [] combi = new String [numFactors];
     202        for (int j = 0; j < numFactors; j++)
     203        {
     204          //get the factor value
     205          combi[j] = allValues[totalCount];
     206          totalCount ++;
     207        }
    238208        combinations[i] = combi;
    239209      }
    240210    }
    241211
    242     //if the mappings were copied and pasted from a spreadsheet we need to parse them into arrays to match the ones above
     212    //if the mappings were copied and pasted from a spreadsheet
    243213    if(mappingsMode.equals("copyPaste"))
    244214    {
     215      //the copied and pasted block of text contains entries consisting of columns and rows
     216      //each row represents a hybridization
     217      //split this up into rows  first
    245218      String [] entriesWithHeader = spreadSheetMappings.split("\n");
    246219
    247       //need to remove the header row - this akward with arrays but we need to use arrays here
     220      //need to remove the header row
    248221      String [] entries = new String [entriesWithHeader.length -1];
    249222      for (int i = 0; i < entries.length; i++)
     
    267240        tissueNames[i] = row[2];
    268241        dyeNames[i] = row[3];
     242       
     243        //each individual combination contains a factor value for each factor and is stored as an array
    269244        String [] combi = new String [numFactors];
    270245        for (int j = 0; j < combi.length; j++)
    271246        {
    272           combi[j] = row[j+4];
    273         }
     247          combi[j] = row[j+4].trim();
     248        }
     249        //now store the new combination in the outer array
    274250        combinations[i] = combi;       
    275251      }
    276252    }
    277253
    278     //if the user chose new data rather than legacy data in the UI then we want to autogenerate the entire hybs section for them
    279     if(legacyData.equals("no"))
    280     {
    281       initAutoGenerateSettings();
    282     }
    283   }
    284 
    285   // -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    286 
    287 
    288   private void initAutoGenerateSettings()
    289   {
    290 
    291     //get all possible factor value combinations
    292     cartesianProduct = makeFactorValueCombinations();
    293 
    294     //init the arrays needed here
    295     fileNames = new String [numHybs];
    296     subjectNames = new String [numHybs];
    297     tissueNames = new String [numHybs];
    298     dyeNames = new String [numHybs];
    299     combinations = new String [numHybs][];
    300 
    301     int numSubjects = Integer.parseInt(numReplicates);
    302     String[] allTissues = tissues.split(",");
    303     int numGroups = Integer.parseInt(numTreatmentGroups);
    304     int numArrayDesigns = Integer.parseInt(numDesigns);
    305 
    306 
    307     /* if no pooling, iterate through
    308         Number of ArrayDesigns
    309         Number of Study Groups
    310         Number of Subject per Study group
    311         Number of tissues per Subject
    312      */
    313     if(pooling.equals("no"))
    314     {
    315       //the number of times we have to print the block of data below
    316       //with dual channel platforms we have to print each block (row) twice
    317       int numPrintRepeats = 0;
    318       if (singleChannel)
    319       {     
    320         numPrintRepeats = 1;
    321       }
    322       else
    323       {
    324         if(dyeSwap.equals("yes"))
    325         {
    326           numPrintRepeats = 2;
    327         }
    328         else
    329         {
    330           numPrintRepeats = 1;
    331         }
    332        
    333       }
    334      
    335       int hybCount =0;
    336       // for each treatment group i.e. factor value combination
    337       for(int a = 0; a< numArrayDesigns; a++)
    338       {
    339         for (int i = 0; i < numGroups; i++)
    340         {
    341           // for each subject within each group i.e. biological replicate within each factor value combination
    342           for (int j = 0; j < numSubjects; j++)
    343           {
    344             // for each target tissue for this subject
    345             for (int k = 0; k < allTissues.length; k++)
    346             {
    347               for(int r = 0; r< numPrintRepeats; r++)
    348               {
    349                 fileNames[hybCount] = "file" + hybCount;
    350                 subjectNames[hybCount] = "subject" + hybCount;
    351                 if(singleChannel)
    352                 {
    353                   dyeNames[hybCount] = "biotin";
    354                 }
    355                 if(!singleChannel && r==0)
    356                 {
    357                   dyeNames[hybCount] = "Cy3";
    358                 }
    359                 if(!singleChannel && r==1)
    360                 {
    361                   dyeNames[hybCount] = "Cy5";
    362                 }
    363                 tissueNames[hybCount] = allTissues[k];
    364                 //print all factor values
    365                 for(int n=0; n< numFactors; n++)
    366                 {
    367                   combinations[hybCount] = new String[numFactors];
    368                   combinations[hybCount][n] =cartesianProduct[i][n];
    369                 }
    370                 hybCount++;
    371               }
    372             }
    373           }
    374         }
    375       }
    376 //      TODO:  with pooling
    377       /* if pooling, iterate through
    378         Number of ArrayDesigns
    379         Number of Study Groups
    380         Number of tissues per Subject
    381        */       
    382     }
    383     //dual channel platforms
    384     else
    385     {
    386       /*
    387       If (Ref=yes) then
    388 
    389       for each treatment group TGk
    390         for each subject in the group
    391         create a sample(subject) Si(TGk)
    392           create 2 hybridizations where Le1.Si(TGk) gets Dye1 and Le1.Ref gets Dye2
    393           IF (Dye-swap = yes)
    394             create dye swap hyb where where Le2. Si(TGk)gets Dye2 and Le2. Ref get Dye1
    395 
    396        */     
    397 
    398       /*
    399       If (Ref=no) then
    400 
    401       for each treatment group TGk
    402         create a sample Si(TGk)
    403         create a sample Sj(CG) in the control group
    404         create first hybridization where Le1.Si(TGk) gets Dye1 and Le1. Sj(CG) get Dye2
    405           if (Dye-swap = yes)
    406           create dye swap hyb where where Le2. Si(TGk)gets Dye2 and Le2. Sj(CG) get Dye1
    407        */
    408 
    409 
    410 
    411 
    412 
    413     }
    414 
    415   }
     254  }
     255
    416256
    417257//  -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     
    494334  public String makeHybridizationsSection()
    495335  {
    496     //work out the number of hybridizations
    497     calcNumHybs();
     336    String hybSection = "";
     337
     338    try
     339    {
     340      //work out whether this is a single or dual channel experiment
     341      if (platform.equalsIgnoreCase("affymetrix"))
     342      {
     343        singleChannel = true;
     344      }
     345
     346      //initialize the arrays we need
     347      initArrays();
     348
     349      // header for this section
     350      hybSection += "Hybridization section\n";
     351
     352      // print column headers for the section
     353      String[] colHeaders = new String[]
     354                                       { "File[raw]", "Array[accession]", "BioSource", "BioMaterialCharacteristics[Organism]",
     355              "BioMaterialCharacteristics[OrganismPart]",
     356              "Sample", "Protocol[grow]",
     357              "Extract", "Protocol[extraction]", "LabeledExtract",
     358              "Protocol[labeling]", "Dye", "Hybridization",
     359              "Protocol[hybridization]", "Scan", "Protocol[scanning]" };
     360      for (int i = 0; i < colHeaders.length; i++)
     361      {
     362        hybSection += colHeaders[i] + "\t";
     363      }
     364
     365      //get the factor names
     366       LinkedHashMap<String, List<String>> factorMap = Tab2MageUtils.getAllFactorValues(expFactors);
     367      Set<String> keys = factorMap.keySet();
     368      for (String factorName : keys)
     369      {
     370        hybSection += "FactorValue["+factorName + "]\t";
     371      }
     372
     373      //next line will be data
     374      hybSection += "\n";
     375
     376      HybridizationEntry hyb = new HybridizationEntry( false, singleChannel,  fileNames, subjectNames, tissueNames,dyeNames,combinations, accession, organism);
     377      int numberHybs = Integer.parseInt(numHybs);
     378      for (int i = 0; i < numberHybs; i++)
     379      {
     380        hybSection += hyb.makeRow(i);
     381      }
     382
     383      //append the hybs section to the general content
     384      t2mContent += hybSection;
     385    }
     386    catch (Exception e)
     387    {
     388      e.printStackTrace();
     389    }
    498390   
    499     //initialise the factors
    500     makeFactorValueCombinations();
    501 
    502     //work out whether this is a single or dual channel experiment
    503     if (platform.equalsIgnoreCase("affymetrix"))
    504     {
    505       singleChannel = true;
    506     }
    507 
    508     //initialize the arrays we need
    509     initArrays();
    510 
    511     String hybSection = "";
    512 
    513     // header for this section
    514     hybSection += "Hybridization section\n";
    515 
    516     // print column headers for the section
    517     String[] colHeaders = new String[]
    518                                      { "File[raw]", "Array[accession]", "BioSource", "BioMaterialCharacteristics[Organism]",
    519             "BioMaterialCharacteristics[OrganismPart]",
    520             "Sample", "Protocol[grow]",
    521             "Extract", "Protocol[extraction]", "LabeledExtract",
    522             "Protocol[labeling]", "Dye", "Hybridization",
    523             "Protocol[hybridization]", "Scan", "Protocol[scanning]" };
    524     for (int i = 0; i < colHeaders.length; i++)
    525     {
    526       hybSection += colHeaders[i] + "\t";
    527     }
    528 
    529     //now print the factorvalue headers
    530     for (int i = 0; i < factorNames.length; i++)
    531     {
    532       hybSection += "FactorValue["+factorNames[i] + "]\t";
    533     }
    534 
    535     //next line will be data
    536     hybSection += "\n";
    537 
    538 
    539     //also need to figure if we are to autogenerate labels or use those supplied by the user
    540     if(legacyData.equals("no"))
    541     {
    542       //autogenerate the contents of the hybs section
    543       HybridizationEntry hyb = new HybridizationEntry( true, singleChannel,  fileNames, subjectNames, tissueNames,dyeNames,combinations, accession, organism);
    544       for (int i = 0; i < numHybs; i++)
    545       {
    546         hybSection += hyb.makeRow(i);
    547       }
    548     }
    549     //otherwise use the data from the mappings we have obtained
    550     else
    551     {
    552       HybridizationEntry hyb = new HybridizationEntry( false, singleChannel,  fileNames, subjectNames, tissueNames,dyeNames,combinations, accession, organism);
    553       for (int i = 0; i < numHybs; i++)
    554       {
    555         hybSection += hyb.makeRow(i);
    556       }
    557     }
    558 
    559     //append the hybs section to the general content
    560     t2mContent += hybSection;
    561391    return hybSection;
    562392  }
     
    573403      dc = sc.newDbControl();
    574404      net.sf.basedb.core.File t2mFile = net.sf.basedb.core.File.getNew(dc, dir);
    575       System.out.println("dir for writing new tab2mage file = " + dir.getName());
    576405      t2mFile.setName("tab2mage.txt");
    577406      dc.saveItem(t2mFile);
     
    609438      DbControl dc = sc.newDbControl();
    610439      net.sf.basedb.core.File t2mFile = net.sf.basedb.core.File.getNew(dc, dir);
    611       System.out.println("dir for writing new tab2mage file = " + dir.getName());
    612440      t2mFile.setName("statusReport.txt");
    613441      dc.saveItem(t2mFile);
  • plugins/base2/uk.ac.ebi.tab2mage/branches/tab2mageimporter/src/uk/ac/ebi/nugo/plugins/Tab2MageWriterTest.java

    r639 r643  
    77import java.io.Writer;
    88
    9 import junit.framework.TestCase;
     9//import junit.framework.TestCase;
    1010
    1111public class Tab2MageWriterTest  //extends TestCase
     
    1616  {
    1717    //org.junit.runner.JUnitCore.main("uk.ac.ebi.nugo.plugins.Tab2MageWriterTest");
    18     test0();
    19     //test1();
    20     //test2();
    21     //test3();
     18    test1();
     19    test2();
     20    test3();
     21    test4();
    2222  }
    2323
    2424  //----------------------------------------------------------------------------------------------------------------------
    2525
    26   public static void test0()
    27   {
    28     //here we simulate data coming from the web UI with mappings provided from a spreadsheet
    29     Tab2MageWriter writer = new Tab2MageWriter();
    30 
    31     System.out.println("======================START TEST0============================");
    32 
    33     writer.legacyData = "yes";
    34     writer.platform = "Affymetrix";
    35     writer.organism = "Solanum tuberosum";
    36     writer.numDesigns = "1";
    37     writer.dyeSwap = "no";
    38     writer.refSample = "yes";
    39     writer.numTreatmentGroups = "4";
    40     writer.expFactors = "Strain(mutant,wildtype)\nTreatment(treated,control)";
    41     writer.numReplicates = "2";
    42     writer.tissues = "whole_organism";
    43     writer.pooling = "no";
    44     writer.path = "/home/michab/gen2.zip";
    45     writer.fileList ="file1\tfile2\tfile3\tfile4\tfile5\tfile6\tfile7\tfile8";
    46     writer.subjectList = "subject1\tsubject2\tsubject3\tsubject4\tsubject5\tsubject6\tsubject7\tsubject8";
    47     writer.tissueList = "whole_organism\twhole_organism\twhole_organism\twhole_organism\twhole_organism\twhole_organism\twhole_organism\twhole_organism";
    48     writer.mappingsMode = "copyPaste";
    49     writer.spreadSheetMappings = "File\tSample\tTissue\tDye\tFactorValue[Strain]\tFactorValue(Treatment)\nfile1\tsubject1\twhole_plant\tbiotin\tmutant\ttreated\nfile2\tsubject2\twhole_plant\tbiotin\twildtype\ttreated\nfile3\tsubject3\twhole_plant\tbiotin\tmutant\tcontrol\nfile4\tsubject4\twhole_plant\tbiotin\twildtype\tcontrol\nfile5\tsubject5\twhole_plant\tbiotin\tmutant\ttreated\nfile6\tsubject6\twhole_plant\tbiotin\twildtype\ttreated\nfile7\tsubject7\twhole_plant\tbiotin\tmutant\tcontrol\nfile8\tsubject8\twhole_plant\tbiotin\twildtype\tcontrol";
    50 
    51     String hybSection = writer.makeHybridizationsSection();
    52     System.out.println("hybs section = \n\n" + hybSection);
    53     System.out.println("======================END TEST0======================");
    54 
    55   }
    56 
    57 //  ----------------------------------------------------------------------------------------------------------------------
    58  
    5926  public static void test1()
    6027  {
     
    6229    Tab2MageWriter writer = new Tab2MageWriter();
    6330
    64     System.out.println("======================START TEST1============================");
     31    System.out.println("======================START TEST 1============================");
    6532
    66     writer.legacyData = "yes";
    67     writer.platform = "Affymetrix";
     33    writer.mappingsMode = "copyPaste";
    6834    writer.organism = "Solanum tuberosum";
    69     writer.numDesigns = "1";
    70     writer.dyeSwap = "no";
    71     writer.refSample = "yes";
    72     writer.numTreatmentGroups = "4";
    7335    writer.expFactors = "Strain(mutant,wildtype)\nTreatment(treated,control)";
    74     writer.numReplicates = "2";
    7536    writer.tissues = "whole_organism";
    76     writer.pooling = "no";
    77     writer.path = "/home/michab/gen2.zip";
     37    writer.numHybs = "8";
     38
    7839    writer.fileList ="file1\tfile2\tfile3\tfile4\tfile5\tfile6\tfile7\tfile8";
    7940    writer.subjectList = "subject1\tsubject2\tsubject3\tsubject4\tsubject5\tsubject6\tsubject7\tsubject8";
    80     writer.tissueList = "whole_organism\twhole_organism\twhole_organism\twhole_organism\twhole_organism\twhole_organism\twhole_organism\twhole_organism";
    81     writer.combinationList = "mutant treated\twildtype treated\tmutant control\twildtype control\tmutant treated\twildtype treated\tmutant control\twildtype control";
    82     writer.dyeList = "biotin\tbiotin\tbiotin\tbiotin\tbiotin\tbiotin\tbiotin\tbiotin\t";
    83     writer.mappingsMode = "manualSelect";
     41    writer.tissueList = "whole_organism\twhole_organism\twhole_organism\twhole_organism\twhole_organism\twhole_organism\twhole_organism\twhole_organism";   
     42    writer.spreadSheetMappings = "File\tSample\tTissue\tDye\tFactorValue[Strain]\tFactorValue(Treatment)\nfile1\tsubject1\twhole_plant\tbiotin\tmutant\ttreated\nfile2\tsubject2\twhole_plant\tbiotin\twildtype\ttreated\nfile3\tsubject3\twhole_plant\tbiotin\tmutant\tcontrol\nfile4\tsubject4\twhole_plant\tbiotin\twildtype\tcontrol\nfile5\tsubject5\twhole_plant\tbiotin\tmutant\ttreated\nfile6\tsubject6\twhole_plant\tbiotin\twildtype\ttreated\nfile7\tsubject7\twhole_plant\tbiotin\tmutant\tcontrol\nfile8\tsubject8\twhole_plant\tbiotin\twildtype\tcontrol";
    8443
    8544    String hybSection = writer.makeHybridizationsSection();
    8645    System.out.println("hybs section = \n\n" + hybSection);
    87     System.out.println("======================END TEST1======================");
     46    System.out.println("======================END TEST 1======================\n\n");
    8847
    8948  }
     49
     50
    9051
    9152//  ----------------------------------------------------------------------------------------------------------------------
    9253
    9354  //affy simple design, 1 factor, 6 files only
     55  //manual configuration by user
    9456  public static void test2()
    9557  {
    9658
    97     /*
    98     platform  = Affymetrix
    99     number of array designs = 1
    100     dyeswap yes/no = not applicable
    101     refSample yes/no = no
    102     number of treatment groups = 2
    103     experimental factors list = genotype (wild type;PGC-1 beta transgenic)
    104     number of replicates within groups = 3
    105     list of tissues used = skeletal muscle (1)
    106     pooling yes/no = no
    107     Total number of Hybs/datafiles = 6
    108      */
    109 
     59    System.out.println("======================START TEST2============================");
     60   
    11061    Tab2MageWriter writer = new Tab2MageWriter();
    111 
    112     System.out.println("======================START TEST2============================");
    113     writer.legacyData = "yes";
    114     writer.platform = "Affymetrix";
     62 
     63    writer.mappingsMode = "manualSelect";
     64   
    11565    writer.organism = "Mus musculus";
    11666    writer.accession = "E-MEXP-939";
    117     writer.numDesigns = "1";
    118     writer.dyeSwap = "no";
    119     writer.refSample = "no";
    120     writer.numTreatmentGroups = "2";
     67    writer.numHybs = "6";
    12168    writer.expFactors = "Genotype(wild type,PGC-1 beta transgenic)\n";
    122     writer.numReplicates = "3";
    12369    writer.tissueList = "skeletal_muscle\tskeletal_muscle\tskeletal_muscle\tskeletal_muscle\tskeletal_muscle\tskeletal_muscle";
    12470    writer.fileList = "E-MEXP-939-raw-cel-1353140153.cel\tE-MEXP-939-raw-cel-1353140189.cel\tE-MEXP-939-raw-cel-1353140261.cel\tE-MEXP-939-raw-cel-1353140117.cel\tE-MEXP-939-raw-cel-1353140081.cel\tE-MEXP-939-raw-cel-1353140225.cel\t";
     
    12672    writer.dyeList = "biotin\tbiotin\tbiotin\tbiotin\tbiotin\tbiotin";
    12773    writer.subjectList = "wt3\ttg-1\ttg-3\twt2\twt1\ttg-2\t";
    128     writer.pooling = "no";
    129     writer.mappingsMode = "manualSelect";
    13074
    131     String hybSection = writer.makeHybridizationsSection();
    132     System.out.println("hybs section = \n\n" + hybSection);
    133     System.out.println("======================END TEST2======================");
    134   }
    135 
    136 //  ----------------------------------------------------------------------------------------------------------------------
    137 
    138   //auto generate required
    139   public static void test3()
    140   {
    141     /*
    142     ArrayExpress Accession Number CacoVitE Inserm
    143     platform  Agilent
    144     number of array designs 1
    145     dyeswap yes/no  yes
    146     refSample yes/no  no
    147     number of treatment groups  2
    148     experimental factors list Dose(90µM,physiological concentration); Compound(alpha-tocopherol,gamma-tocopheral)
    149     number of replicates within groups  2
    150     list of tissues used  enterocyte cell culture
    151     pooling yes/no  no
    152     Total number of Hybs/datafiles  8
    153     */
    154 
    155     Tab2MageWriter writer = new Tab2MageWriter();
    156 
    157     System.out.println("======================START TEST3============================");
    158 
    159     writer.platform = "Agilent";
    160     writer.organism = "Home sapiens";
    161     writer.accession = "CacoVitE Inserm";
    162    
    163     writer.legacyData = "yes"; 
    164     writer.mappingsMode = "manualSelect";
    165    
    166     writer.numDesigns = "1";
    167     writer.numReplicates = "2";
    168     writer.numTreatmentGroups = "4";
    169    
    170     writer.dyeSwap = "yes";
    171     writer.refSample = "no";
    172     writer.pooling = "no";
    173 
    174    
    175     writer.expFactors = "Compound(alpha-tocopherol,gamma-tocopheral)\nDose(90microM,physiological concentration)\n";
    176 
    177     writer.tissueList = "enterocyte\tenterocyte\tenterocyte\tenterocyte\tenterocyte\tenterocyte\tenterocyte\tenterocyte\tenterocyte\tenterocyte\tenterocyte\tenterocyte\tenterocyte\tenterocyte\tenterocyte\tenterocyte\t";
    178     writer.fileList = "US22502631_251485012409_S01_GE2-v5_91_0806_1_2.txt\tUS22502631_251485012409_S01_GE2-v5_91_0806_1_2.txt\tUS22502631_251485012409_S01_GE2-v5_91_0806_1_3.txt\tUS22502631_251485012409_S01_GE2-v5_91_0806_1_3.txt\tUS22502631_251485012409_S01_GE2-v5_91_0806_1_4.txt\tUS22502631_251485012409_S01_GE2-v5_91_0806_1_4.txt\tUS22502631_251485012407_S01_GE2-v5_91_0806_1_1.txt\tUS22502631_251485012407_S01_GE2-v5_91_0806_1_1.txt\tUS22502631_251485012408_S01_GE2-v5_91_0806_1_2.txt\tUS22502631_251485012408_S01_GE2-v5_91_0806_1_2.txt\tUS22502631_251485012408_S01_GE2-v5_91_0806_1_1.txt\tUS22502631_251485012408_S01_GE2-v5_91_0806_1_1.txt\tUS22502631_251485012408_S01_GE2-v5_91_0806_1_4.txt\tUS22502631_251485012408_S01_GE2-v5_91_0806_1_4.txt\tUS22502631_251485012408_S01_GE2-v5_91_0806_1_3.txt\tUS22502631_251485012408_S01_GE2-v5_91_0806_1_3.txt\t";
    179     writer.combinationList = "micelle control,physiological concentration\tmicelle alpha tocopherol,90µM\tmicelle control,physiological concentration\tmicelle alpha tocopherol,90µM\tmicelle control,physiological concentration\tmicelle gamma tocopherol,90µM\tmicelle control,physiological concentration\tmicelle gamma tocopherol,90µM\tmicelle control,physiological concentration\tmicelle alpha tocopherol,90µM\tmicelle control,physiological concentration\tmicelle alpha tocopherol,90µM\tmicelle control,physiological concentration\tmicelle gamma tocopherol,90µM\tmicelle control,physiological concentration\tmicelle gamma tocopherol,90µM\t";
    180     writer.dyeList ="Cy3\tCy5\tCy5\tCy3\tCy3\tCy5\tCy5\tCy3\tCy3\tCy5\tCy5\tCy3\tCy3\tCy5\tCy5\tCy3\t";
    181     writer.subjectList = "culture1\tculture2\tculture1\tculture2\tculture3\tculture4\tculture3\tculture4\tculture5\tculture6\tculture5\tculture6\tculture7\tculture8\tculture7\tculture8\t";
    18275   
    18376
    18477    String hybSection = writer.makeHybridizationsSection();
    18578    System.out.println("hybs section = \n\n" + hybSection);
    186     System.out.println("======================END TEST3======================");
     79   
     80    System.out.println("======================END TEST2======================\n\n");
    18781  }
     82
     83 
     84//  ----------------------------------------------------------------------------------------------------------------------
     85 
     86  public static void test3()
     87  {   
     88    System.out.println("======================START TEST 3============================");
     89   
     90    Tab2MageWriter writer = new Tab2MageWriter();
     91   
     92    writer.platform = "Agilent";
     93    writer.organism = "Mus musculus";   
     94    writer.accession = "Agilent Mouse Oligo Microarray (V2) [G4121B]";   
     95    writer.useWizard="yes";
     96    writer.legacyData = "yes"; 
     97    writer.mappingsMode = "manualSelect";   
     98    writer.numHybs = "12";   
     99    writer.expFactors = "disease state(normal,dilated cardiomyopathy)\ngenotype(TNNT2 +/deltaK210,wild_type,TNNT2 deltaK210/deltaK210)\n";
     100    writer.tissueList = "heart\theart\theart\theart\theart\theart\theart\theart\theart\theart\theart\theart\t";
     101    writer.fileList = "E-MEXP-1340-raw-data-1560505207.txt\tE-MEXP-1340-raw-data-1560505207.txt\tE-MEXP-1340-raw-data-1560505186.txt\tE-MEXP-1340-raw-data-1560505186.txt\tE-MEXP-1340-raw-data-1560505169.txt\tE-MEXP-1340-raw-data-1560505169.txt\tE-MEXP-1340-raw-data-1560505145.txt\tE-MEXP-1340-raw-data-1560505145.txt\tE-MEXP-1340-raw-data-1560505233.txt\tE-MEXP-1340-raw-data-1560505233.txt\tE-MEXP-1340-raw-data-1560505220.txt\tE-MEXP-1340-raw-data-1560505220.txt\t";
     102    writer.dyeList ="Cy5\tCy3\tCy5\tCy3\tCy5\tCy3\tCy5\tCy3\tCy5\tCy3\tCy5\tCy3\t";
     103    writer.subjectList = "Wt 2\tHeterozygous 2\tWt 2\tHomozygous 2\tWt 1\tHeterozygous 1\tWt 1\tHomozygous 1\tWt 3\tHeterozygous 3\tWt 3\tHomozygous 3\t";   
     104    writer.combinationList = "normal\twild_type\tdilated cardiomyopathy\tTNNT2 +/deltaK210\tnormal\twild_type\tdilated cardiomyopathy\tTNNT2 deltaK210/deltaK210\tnormal\twild_type\tdilated cardiomyopathy\tTNNT2 +/deltaK210\tnormal\twild_type\tdilated cardiomyopathy\tTNNT2 deltaK210/deltaK210\tnormal\twild_type\tdilated cardiomyopathy\tTNNT2 +/deltaK210\tnormal\twild_type\tdilated cardiomyopathy\tTNNT2 deltaK210/deltaK210"; 
     105    writer.path = "/home/michab/E-MEXP-1340.raw.zip";
     106
     107    String hybSection = writer.makeHybridizationsSection();
     108    System.out.println("hybs section = \n\n" + hybSection);
     109   
     110    System.out.println("======================END TEST 3======================\n\n");
     111  }
     112 
    188113 
    189114//  ----------------------------------------------------------------------------------------------------------------------
     
    191116  public static void test4()
    192117  {
    193     /*
    194     experimentId = 2
    195     domain = scri.ac.uk
    196     accession = Agilent potato POCI 1x44k
    197     qualityControl = biological replicate
    198     experimentalDesign = strain_or_line_design,
    199     experimentName = LD1 experiment
    200     description = my test description
    201     releaseDate = 2007-05-15
    202     submissionDate = 2007-05-30
    203     submitter = Micha Bayer
    204     organization = SCRI
    205     publicationTitle = My completely ropey paper
    206     authors = Micha Bayer; Joe Bloggs
    207     journal = The Journal of Irreproducible Results
    208     volume = 1
    209     issue = 1
    210     pages = 112-122
    211     year = 2007
    212     pubmedId =
    213     treatmentProtocol = treatment protocol text
    214     poolingProtocol = pooling protocol text
    215     extractionProtocol = extraction protocol text
    216     labelingProtocol = labeling protocol text
    217     hybridizationProtocol = hybs protocol text
    218     scanningProtocol = scanning protocol text
    219     treatmentProtocolParams = medium;CO2;antibiotics
    220     hybridizationProtocolParams = temperature(degree_C) ; duration(hr)
    221     scanningProtocolParams =
    222     platform = GenePix
    223     organism = Solanum tuberosum
    224     numDesigns = 1
    225     dyeSwap = yes
    226     refSample = no
    227     numTreatmentGroups = 4
    228     expFactors = DevelopmentalStage(mature tubers (6 weeks post H3),golf ball size,2 weeks post H1,2 wee
    229     ks post H2)
    230     StrainOrLine(Maris Piper,Desiree,333-37,333-16)
    231     numReplicates = 2
    232     tissues = enterocyte
    233     pooling = no
    234     path = /home/michab/LD1_files.zip
    235     subjectNames = Solanum phureja cv. 337-37.H1_1
    236     Solanum phureja cv. 333-16.H1_1
    237     Solanum phureja cv. 333-16.H3_2
    238     Solanum tuberosum cv. Maris Piper.H3_1
    239     Solanum tuberosum cv. Maris Piper.H3_2
    240     Solanum tuberosum cv. Desiree.H3_1
    241     Solanum phureja cv. 337-37.H3_2
    242     Solanum tuberosum cv. Desiree.H3_2
    243     Solanum phureja cv. 333-16.H4_1
    244     Solanum phureja cv. 337-37.H4_1
    245     Solanum phureja cv. 333-16.H4_2
    246     Solanum tuberosum cv. Maris Piper.H4_1
    247     Solanum tuberosum cv. Maris Piper.H4_2
    248     Solanum tuberosum cv. Desiree.H4_1
    249     Solanum phureja cv. 337-37.H4_2
    250     Solanum tuberosum cv. Desiree.H4_2
    251     Solanum phureja cv. 333-16.H1_2
    252     Solanum tuberosum cv. Maris Piper.H1_1
    253     Solanum tuberosum cv. Maris Piper.H1_2
    254     Solanum tuberosum cv. Desiree.H1_1
    255     Solanum phureja cv. 337-37.H1_2
    256     Solanum tuberosum cv. Desiree.H1_2
    257     Solanum phureja cv. 333-16.H2_1
    258     Solanum phureja cv. 337-37.H2_1
    259     Solanum phureja cv. 333-16.H2_2
    260     Solanum tuberosum cv. Maris Piper.H2_1
    261     Solanum tuberosum cv. Maris Piper.H2_2
    262     Solanum tuberosum cv. Desiree.H2_1
    263     Solanum phureja cv. 337-37.H2_2
    264     Solanum tuberosum cv. Desiree.H2_2
    265     Solanum phureja cv. 337-37.H3_1
    266     Solanum phureja cv. 333-16.H3_1
     118    System.out.println("======================START TEST 4============================");
    267119
     120    Tab2MageWriter writer = new Tab2MageWriter();
    268121
    269     useWizard = yes
    270     legacyData = yes
    271     mappingsMode = copyPaste
    272     spreadSheetMappings = File      Subject Tissue  Dye     FactorValue[DevelopmentalStage] FactorValue[
    273     StrainOrLine]
    274     10d_7d_w685.gpr Solanum phureja cv. 337-37.H1_1 tuber   cy3     golf ball size  333-37
    275     10d_7d_w685.gpr Solanum phureja cv. 333-16.H1_1 tuber   cy5     golf ball size  333-16
    276     8b_13b_w685.gpr Solanum phureja cv. 333-16.H3_2 tuber   cy3     2 weeks post H2 333-16
    277     8b_13b_w685.gpr Solanum tuberosum cv. Maris Piper.H3_1  tuber   cy5     2 weeks post H2 Maris Piper
    278     14b_1b_w685.gpr Solanum tuberosum cv. Maris Piper.H3_2  tuber   cy3     2 weeks post H2 Maris Piper
    279     14b_1b_w685.gpr Solanum tuberosum cv. Desiree.H3_1      tuber   cy5     2 weeks post H2 Desiree
    280     2b_11b_w685.gpr Solanum phureja cv. 337-37.H3_2 tuber   cy5     2 weeks post H2 333-37
    281     2b_11b_w685.gpr Solanum tuberosum cv. Desiree.H3_2      tuber   cy3     2 weeks post H2 Desiree
    282     7a_10a_w685.gpr Solanum phureja cv. 333-16.H4_1 tuber   cy3     mature tubers (6 weeks post H3) 333-
    283     16
    284     7a_10a_w685.gpr Solanum phureja cv. 337-37.H4_1 tuber   cy5     mature tubers (6 weeks post H3) 333-
    285     37
    286     13a_8a_w685.gpr Solanum phureja cv. 333-16.H4_2 tuber   cy5     mature tubers (6 weeks post H3) 333-
    287     16
    288     13a_8a_w685.gpr Solanum tuberosum cv. Maris Piper.H4_1  tuber   cy3     mature tubers (6 weeks post
    289     H3)     Maris Piper
    290     1a_14a_w685.gpr Solanum tuberosum cv. Maris Piper.H4_2  tuber   cy5     mature tubers (6 weeks post
    291     H3)     Maris Piper
    292     1a_14a_w685.gpr Solanum tuberosum cv. Desiree.H4_1      tuber   cy3     mature tubers (6 weeks post
    293     H3)     Desiree
    294     11a_2a_w685.gpr Solanum phureja cv. 337-37.H4_2 tuber   cy5     mature tubers (6 weeks post H3) 333-
    295     37
    296     11a_2a_w685.gpr Solanum tuberosum cv. Desiree.H4_2      tuber   cy3     mature tubers (6 weeks post
    297     H3)     Desiree
    298     8d_13d_w685.gpr Solanum phureja cv. 333-16.H1_2 tuber   cy3     golf ball size  333-16
    299     8d_13d_w685.gpr Solanum tuberosum cv. Maris Piper.H1_1  tuber   cy5     golf ball size  Maris Piper
    300     14d_1d_w685.gpr Solanum tuberosum cv. Maris Piper.H1_2  tuber   cy3     golf ball size  Maris Piper
    301     14d_1d_w685.gpr Solanum tuberosum cv. Desiree.H1_1      tuber   cy5     golf ball size  Desiree
    302     2d_11d_w685.gpr Solanum phureja cv. 337-37.H1_2 tuber   cy5     golf ball size  333-37
    303     2d_11d_w685.gpr Solanum tuberosum cv. Desiree.H1_2      tuber   cy3     golf ball size  Desiree
    304     7c_10c_w685.gpr Solanum phureja cv. 333-16.H2_1 tuber   cy3     2 weeks post H1 333-16
    305     7c_10c_w685.gpr Solanum phureja cv. 337-37.H2_1 tuber   cy5     2 weeks post H1 333-37
    306     13c_8c_w685.gpr Solanum phureja cv. 333-16.H2_2 tuber   cy5     2 weeks post H1 333-16
    307     13c_8c_w685.gpr Solanum tuberosum cv. Maris Piper.H2_1  tuber   cy3     2 weeks post H1 Maris Piper
    308     1c_14c_w685.gpr Solanum tuberosum cv. Maris Piper.H2_2  tuber   cy5     2 weeks post H1 Maris Piper
    309     1c_14c_w685.gpr Solanum tuberosum cv. Desiree.H2_1      tuber   cy3     2 weeks post H1 Desiree
    310     11c_2c_w685.gpr Solanum phureja cv. 337-37.H2_2 tuber   cy5     2 weeks post H1 333-37
    311     11c_2c_w685.gpr Solanum tuberosum cv. Desiree.H2_2      tuber   cy3     2 weeks post H1 Desiree
    312     10b_7b_w685.gpr Solanum phureja cv. 337-37.H3_1 tuber   cy3     2 weeks post H2 333-37
    313     10b_7b_w685.gpr Solanum phureja cv. 333-16.H3_1 tuber   cy5     2 weeks post H2 333-16
    314     */
     122    writer.organism = "Mus musculus";   
     123    writer.accession = "Agilent Mouse Oligo Microarray (V2) [G4121B]"; 
     124    writer.mappingsMode = "copyPaste"; 
     125    writer.numHybs = "12"; 
     126    writer.expFactors = "disease state(normal,dilated cardiomyopathy)\ngenotype(TNNT2 +/deltaK210,wild_type,TNNT2 deltaK210/deltaK210)\n";
     127    writer.spreadSheetMappings = "File\tSubject\tTissue\tDye\tFactorValue [disease state]\tFactorValue [genotype]\nE-MEXP-1340-raw-data-1560505207.txt\tWt 2\theart\tCy5\tnormal\twild_type\nE-MEXP-1340-raw-data-1560505207.txt\tHeterozygous 2\theart\tCy3\tdilated cardiomyopathy\tTNNT2 +/deltaK210\nE-MEXP-1340-raw-data-1560505186.txt\tWt 2\theart\tCy5\tnormal\twild_type\nE-MEXP-1340-raw-data-1560505186.txt\tHomozygous 2\theart\tCy3\tdilated cardiomyopathy\tTNNT2 deltaK210/deltaK210\nE-MEXP-1340-raw-data-1560505169.txt\tWt 1\theart\tCy5\tnormal\twild_type\nE-MEXP-1340-raw-data-1560505169.txt\tHeterozygous 1\theart\tCy3\tdilated cardiomyopathy\tTNNT2 +/deltaK210\nE-MEXP-1340-raw-data-1560505145.txt\tWt 1\theart\tCy5\tnormal\twild_type\nE-MEXP-1340-raw-data-1560505145.txt\tHomozygous 1\theart\tCy3\tdilated cardiomyopathy\tTNNT2 deltaK210/deltaK210\nE-MEXP-1340-raw-data-1560505233.txt\tWt 3\theart\tCy5\tnormal\twild_type\nE-MEXP-1340-raw-data-1560505233.txt\tHeterozygous 3\theart\tCy3\tdilated cardiomyopathy\tTNNT2 +/deltaK210\nE-MEXP-1340-raw-data-1560505220.txt\tWt 3\theart\tCy5\tnormal\twild_type\nE-MEXP-1340-raw-data-1560505220.txt\tHomozygous 3\theart\tCy3\tdilated cardiomyopathy\tTNNT2 deltaK210/deltaK210\t\n";
     128   
     129    String hybSection = writer.makeHybridizationsSection();
     130    System.out.println("hybs section = \n\n" + hybSection);
     131   
     132    System.out.println("======================END TEST 4======================\n\n");   
    315133  }
    316134 
     135//  ----------------------------------------------------------------------------------------------------------------------
     136   
    317137 
    318138}//end class
Note: See TracChangeset for help on using the changeset viewer.