Ignore:
Timestamp:
Jan 23, 2008, 3:21:52 PM (13 years ago)
Author:
mbayer
Message:

have restructured the code completely that writes the hybs section

File:
1 edited

Legend:

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

    r548 r550  
    1515  final String ID = sc.getId();
    1616  final String requestId = request.getParameter("requestId");
    17 
    1817%>
    1918
     
    7372      tissueList += frm.elements[i].value + '\t';
    7473    }
     74    if(id.match("dyeInput"))
     75    {
     76      dyeList += frm.elements[i].value + '\t';
     77    }
    7578    if(id.match("combinationInput"))
    7679    {
     
    8184  frm.subjectList.value = subjectList;
    8285  frm.tissueList.value = tissueList;
     86  frm.dyeList.value = dyeList;
    8387  frm.combinationList.value = combinationList;
    8488}
     
    101105<input type="hidden" id="subjectList" name="subjectList" value""/>
    102106<input type="hidden" id="tissueList" name="tissueList" value""/>
     107<input type="hidden" id="dyeList" name="dyeList" value""/>
    103108<input type="hidden" id="combinationList" name="combinationList" value""/>
    104109
     
    120125    //extract the possible values from between the parentheses
    121126    String allValues = rawFactors[i].substring(rawFactors[i].indexOf("(") + 1,
    122         rawFactors[i].indexOf(")"));
     127    rawFactors[i].indexOf(")"));
    123128    String[] values = allValues.split(",");
    124129    factorValues[i] = values;
     
    171176  {
    172177    singleChannel = true;
    173   } 
     178  }
    174179  int numReplicates = Integer.parseInt(inputDataBean.getNumReplicates());
    175180  int numTreatmentGroups = Integer.parseInt(inputDataBean.getNumTreatmentGroups());
    176181  int numTissues = inputDataBean.getTissues().split("\n").length;
    177   int numHybs = Tab2MageWriter.calcNumHybs(singleChannel,numReplicates, numTreatmentGroups, numTissues);
     182  boolean dyeSwapBool = false;
     183  boolean poolingBool = false;
     184  if(inputDataBean.getDyeSwap().equals("yes"))
     185  {
     186    dyeSwapBool = true;
     187  }
     188  if(inputDataBean.getPooling().equals("yes"))
     189  {
     190    poolingBool = true;
     191  }
     192   
     193  int numHybs = Tab2MageUtils.calcNumHybs(dyeSwapBool,poolingBool,Integer.parseInt(inputDataBean.getNumDesigns()), numReplicates, numTreatmentGroups,numTissues);
     194
    178195  System.out.println("numHybs = " + numHybs);
    179196  System.out.println("products.length = " + products.length);
    180197%>
    181198
    182 <h1>Tab2MAGE Import Wizard -- File Mappings</h1>
     199<h2>Tab2MAGE Import Wizard -- File Mappings</h2>
    183200<p>
    184201
     
    198215    <td class="header"><h3>Subject</h3></td>
    199216    <td class="header"><h3>Tissue</h3></td>
     217    <td class="header"><h3>Dye</h3></td>
    200218    <td class="header"><h3>Factor Value Combination</h3></td>
    201219
     
    205223
    206224  <%
    207     for (int i = 0; i < numHybs; i++)
    208     {
     225      for (int i = 0; i < numHybs; i++)
     226      {
    209227  %>
    210228
     
    215233    <td class="input" ><select id="fileInput<%=i %>">
    216234      <%
    217           for (int k = 0; k < fileNamesArr.length; k++)
    218           {
     235            for (int k = 0; k < fileNamesArr.length; k++)
     236            {
    219237      %>
    220238
     
    230248    <td class="input" ><select id="subjectInput<%=i %>">
    231249      <%
    232           for (int k = 0; k < subjectNames.length; k++)
    233           {
     250            for (int k = 0; k < subjectNames.length; k++)
     251            {
    234252      %>
    235253
     
    245263    <td class="input" ><select id="tissueInput<%=i %>">
    246264      <%
    247           for (int k = 0; k < tissueNames.length; k++)
    248           {
     265            for (int k = 0; k < tissueNames.length; k++)
     266            {
    249267      %>
    250268
     
    256274    </select></td>
    257275
    258 <!-- need a single cell with a select box that lets the user select from a list of unique factor value combinations -->
     276    <!-- select your dye here-->
     277
     278    <td class="input"><select id="dyeInput<%=i %>">
     279      <%
     280            if (!singleChannel)
     281            {
     282      %>
     283      <option>Cy3</option>
     284      <option>Cy5</option>
     285      <%
     286            }
     287            else
     288            {
     289      %>
     290      <option>biotin</option>
     291      <%
     292      }
     293      %>
     294
     295    </select></td>
     296
     297    <!-- need a single cell with a select box that lets the user select from a list of unique factor value combinations -->
    259298
    260299    <td>
    261300    <select id="combinationInput<%=i %>">
    262301      <%
    263           for (int k = 0; k < products.length; k++)
     302            for (int k = 0; k < products.length; k++)
     303            {
     304          //make a String with all the factor values in this combination
     305          //separate values in each combi with a space
     306          String combi = "";
     307          for (int j = 0; j < products[k].length; j++)
    264308          {
    265             //make a String with all the factor values in this combination
    266             //separate values in each combi with a space
    267             String combi = "";
    268             for (int j = 0; j < products[k].length; j++)
    269             {
    270               combi += products[k][j] + " ";
    271             }
     309            combi += products[k][j] + " ";
     310          }
    272311      %>
    273312
Note: See TracChangeset for help on using the changeset viewer.