Changeset 527


Ignore:
Timestamp:
Jan 8, 2008, 10:35:06 AM (13 years ago)
Author:
mbayer
Message:

have added a cartesian product algorithm that compute

Location:
branches/uk_ac_ebi_Tab2MageImporter
Files:
1 added
4 edited

Legend:

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

    r526 r527  
    195195    <td class="boldText">Experimental factors:
    196196    </td>
    197     <td class="input"><textarea rows="7" cols="32" name="expFactors">Strain(mutant,wildtype)<br/>Treament(treated,control)</textarea></td>
     197    <td class="input"><textarea rows="7" cols="32" name="expFactors">Strain(mutant,wildtype)</textarea></td>
    198198    <td>Please list all experimental factors and value ranges using the following format (one per
    199199    line):<br>
  • branches/uk_ac_ebi_Tab2MageImporter/jsp/uk/ac/ebi/nugo/plugins/mappings.jsp

    r526 r527  
    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="net.sf.basedb.core.*"%>
    45<%@ page import="net.sf.basedb.clients.web.*"%>
    56<%@ page import="net.sf.basedb.util.*"%>
     7<%@ page import="uk.ac.ebi.nugo.plugins.*"%>
    68
    7 <jsp:useBean id="inputDataBean" class="uk.ac.ebi.nugo.plugins.DataBean" scope="application" />
     9<jsp:useBean id="inputDataBean" class="uk.ac.ebi.nugo.plugins.DataBean"
     10  scope="application" />
    811<!-- 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 -->
    912<jsp:setProperty name="inputDataBean" property="*" />
    1013
    1114<%
    12 final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
    13 final String ID = sc.getId();
    14 final String requestID = request.getParameter("requestId");
    15  %>
     15  final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
     16  final String ID = sc.getId();
     17  final String requestID = request.getParameter("requestId");
     18%>
    1619
    1720<html>
     
    1922<head>
    2023
    21 <link rel="stylesheet" type="text/css" href="<%= request.getContextPath()%>/plugins/uk/ac/ebi/nugo/plugins/styles.css" />
    22 <link rel="stylesheet" type="text/css" href="/base/include/styles/main.css">
    23 <link rel="stylesheet" type="text/css" href="/base/include/styles/size_m.css">
     24<link rel="stylesheet" type="text/css"
     25  href="<%= request.getContextPath()%>/plugins/uk/ac/ebi/nugo/plugins/styles.css" />
     26<link rel="stylesheet" type="text/css"
     27  href="/base/include/styles/main.css">
     28<link rel="stylesheet" type="text/css"
     29  href="/base/include/styles/size_m.css">
    2430
    25 <script language="JavaScript" src="<%= request.getContextPath()%>/include/scripts/main.js" type="text/javascript"></script>
     31<script language="JavaScript"
     32  src="<%= request.getContextPath()%>/include/scripts/main.js"
     33  type="text/javascript"></script>
    2634<script language="JavaScript" type="text/javascript">
    2735  //submits form
     
    3947    }
    4048</script>
    41  
     49
    4250</head>
    4351
     
    4755  //first extract the factor names and the possible values
    4856  String expFactors = inputDataBean.getExpFactors();
     57  String[] rawFactors = expFactors.split("\n");
    4958
    50   HashMap<String, LinkedList> factors = new HashMap<String, LinkedList>();
     59  String[][] factorValues = new String[rawFactors.length][];
     60  String[] factorNames = new String[rawFactors.length];
    5161
    52   String[] rawFactors = expFactors.split("\n");
    5362  for (int i = 0; i < rawFactors.length; i++)
    5463  {
    5564    //extract the factor name
    5665    String factorName = rawFactors[i].substring(0, rawFactors[i].indexOf("("));
     66    factorNames[i] = factorName;
    5767    //extract the possible values from between the parentheses
    58     String allValues = rawFactors[i].substring(rawFactors[i].indexOf("(") + 1,rawFactors[i].length() - 1);
     68    String allValues = rawFactors[i].substring(rawFactors[i].indexOf("(") + 1, rawFactors[i].indexOf(")"));
    5969    String[] values = allValues.split(",");
    60     System.out.println("factorName = " + factorName);
    61     System.out.println("allValues = " + allValues);
    62     //add them to a linkedlist object
    63     LinkedList<String> valueList = new LinkedList<String>();
    64     for (int j = 0; j < values.length; j++)
    65     {
    66       System.out.println("value: " + values[j]);
    67       %>
     70    factorValues[i] = values;
     71  }
    6872
    69       expFactors value = <%=values[j] %><br>
    70      
    71       <%
    72       valueList.add(values[j]);
    73     }
    74     //add this pair to the hashmap
    75     factors.put(factorName, valueList);
    76   }
     73  String[][] products = CartesianProduct.getCartesianProduct(factorValues);
    7774%>
    7875
    79 <form name="mappings"action="<%= request.getContextPath()%>/plugins/uk/ac/ebi/nugo/plugins/mappings.jsp" method="post">
    80 <input type="hidden" name="ID" value="<%=ID%>"> <input type="hidden" name="cmd" value="SetParameters">
    81 <input type="hidden"name="requestID" value="<%=requestID%>">
     76<form name="mappings"
     77  action="<%= request.getContextPath()%>/plugins/uk/ac/ebi/nugo/plugins/mappings.jsp"
     78  method="post"><input type="hidden" name="ID" value="<%=ID%>">
     79<input type="hidden" name="cmd" value="SetParameters"> <input
     80  type="hidden" name="requestID" value="<%=requestID%>"> <!-- these are the parameters from the input pages; need to pick them up individually from the bean here; ugly as hell but can't be done any other way -->
    8281
    83 <!-- these are the parameters from the input pages; need to pick them up individually from the bean here; ugly as hell but can't be done any other way -->
     82<!-- inputs from experiment.jsp page --> <input type="hidden"
     83  name="parameter:domain" value="<%=inputDataBean.getDomain()%>">
     84<input type="hidden" name="parameter:accession"
     85  value="<%=inputDataBean.getAccession()%>"> <input type="hidden"
     86  name="parameter:qualityControl"
     87  value="<%=inputDataBean.getQualityControl()%>"> <input
     88  type="hidden" name="parameter:experimentalDesign"
     89  value="<%=inputDataBean.getExperimentalDesign()%>"> <input
     90  type="hidden" name="parameter:experimentName"
     91  value="<%=inputDataBean.getExperimentName()%>"> <input
     92  type="hidden" name="parameter:description"
     93  value="<%=inputDataBean.getDescription()%>"> <input
     94  type="hidden" name="parameter:releaseDate"
     95  value="<%=inputDataBean.getReleaseDate()%>"> <input
     96  type="hidden" name="parameter:submissionDate"
     97  value="<%=inputDataBean.getSubmissionDate()%>"> <input
     98  type="hidden" name="parameter:submitter"
     99  value="<%=inputDataBean.getSubmitter()%>"> <input type="hidden"
     100  name="parameter:organization"
     101  value="<%=inputDataBean.getOrganization()%>"> <input
     102  type="hidden" name="parameter:publicationTitle"
     103  value="<%=inputDataBean.getPublicationTitle()%>"> <input
     104  type="hidden" name="parameter:authors"
     105  value="<%=inputDataBean.getAuthors()%>"> <input type="hidden"
     106  name="parameter:journal" value="<%=inputDataBean.getJournal()%>">
     107<input type="hidden" name="parameter:volume"
     108  value="<%=inputDataBean.getVolume()%>"> <input type="hidden"
     109  name="parameter:issue" value="<%=inputDataBean.getIssue()%>"> <input
     110  type="hidden" name="parameter:pages"
     111  value="<%=inputDataBean.getPages()%>"> <input type="hidden"
     112  name="parameter:year" value="<%=inputDataBean.getYear()%>"> <input
     113  type="hidden" name="parameter:pubmedId"
     114  value="<%=inputDataBean.getPubmedId()%>"> <input type="hidden"
     115  name="parameter:experimentId"
     116  value="<%=inputDataBean.getExperimentId()%>"> <!-- inputs from protocols.jsp page -->
     117<input type="hidden" name="parameter:treatmentProtocol"
     118  value="<%=inputDataBean.getTreatmentProtocol()%>"> <input
     119  type="hidden" name="parameter:extractionProtocol"
     120  value="<%=inputDataBean.getExtractionProtocol()%>"> <input
     121  type="hidden" name="parameter:labelingProtocol"
     122  value="<%=inputDataBean.getLabelingProtocol()%>"> <input
     123  type="hidden" name="parameter:hybridizationProtocol"
     124  value="<%=inputDataBean.getHybridizationProtocol()%>"> <input
     125  type="hidden" name="parameter:scanningProtocol"
     126  value="<%=inputDataBean.getScanningProtocol()%>"> <input
     127  type="hidden" name="parameter:treatmentProtocolParams"
     128  value="<%=inputDataBean.getTreatmentProtocolParams()%>"> <input
     129  type="hidden" name="parameter:extractionProtocolParams"
     130  value="<%=inputDataBean.getExtractionProtocolParams()%>"> <input
     131  type="hidden" name="parameter:labelingProtocolParams"
     132  value="<%=inputDataBean.getLabelingProtocolParams()%>"> <input
     133  type="hidden" name="parameter:hybridizationProtocolParams"
     134  value="<%=inputDataBean.getHybridizationProtocolParams()%>"> <input
     135  type="hidden" name="parameter:scanningProtocolParams"
     136  value="<%=inputDataBean.getScanningProtocolParams()%>"> <!-- inputs from hybridizations.jsp page -->
     137<input type="hidden" name="parameter:platform"
     138  value="<%=inputDataBean.getPlatform()%>"> <input type="hidden"
     139  name="parameter:organism" value="<%=inputDataBean.getOrganism()%>">
     140<input type="hidden" name="parameter:numDesigns"
     141  value="<%=inputDataBean.getNumDesigns()%>"> <input
     142  type="hidden" name="parameter:dyeSwap"
     143  value="<%=inputDataBean.getDyeSwap()%>"> <input type="hidden"
     144  name="parameter:refSample" value="<%=inputDataBean.getRefSample()%>">
     145<input type="hidden" name="parameter:numTreatmentGroups"
     146  value="<%=inputDataBean.getNumTreatmentGroups()%>"> <input
     147  type="hidden" name="parameter:expFactors"
     148  value="<%=inputDataBean.getExpFactors()%>"> <input
     149  type="hidden" name="parameter:numReplicates"
     150  value="<%=inputDataBean.getNumReplicates()%>"> <input
     151  type="hidden" name="parameter:tissues"
     152  value="<%=inputDataBean.getTissues()%>"> <input type="hidden"
     153  name="parameter:pooling" value="<%=inputDataBean.getPooling()%>">
    84154
    85 <!-- inputs from experiment.jsp page -->
    86 <input type="hidden" name="parameter:domain" value="<%=inputDataBean.getDomain()%>">
    87 <input type="hidden" name="parameter:accession" value="<%=inputDataBean.getAccession()%>">
    88 <input type="hidden" name="parameter:qualityControl" value="<%=inputDataBean.getQualityControl()%>">
    89 <input type="hidden" name="parameter:experimentalDesign" value="<%=inputDataBean.getExperimentalDesign()%>">
    90 <input type="hidden" name="parameter:experimentName" value="<%=inputDataBean.getExperimentName()%>">
    91 <input type="hidden" name="parameter:description" value="<%=inputDataBean.getDescription()%>">
    92 <input type="hidden" name="parameter:releaseDate" value="<%=inputDataBean.getReleaseDate()%>">
    93 <input type="hidden" name="parameter:submissionDate" value="<%=inputDataBean.getSubmissionDate()%>">
    94 <input type="hidden" name="parameter:submitter" value="<%=inputDataBean.getSubmitter()%>">
    95 <input type="hidden" name="parameter:organization" value="<%=inputDataBean.getOrganization()%>">
    96 <input type="hidden" name="parameter:publicationTitle" value="<%=inputDataBean.getPublicationTitle()%>">
    97 <input type="hidden" name="parameter:authors" value="<%=inputDataBean.getAuthors()%>">
    98 <input type="hidden" name="parameter:journal" value="<%=inputDataBean.getJournal()%>">
    99 <input type="hidden" name="parameter:volume" value="<%=inputDataBean.getVolume()%>">
    100 <input type="hidden" name="parameter:issue" value="<%=inputDataBean.getIssue()%>">
    101 <input type="hidden" name="parameter:pages" value="<%=inputDataBean.getPages()%>">
    102 <input type="hidden" name="parameter:year" value="<%=inputDataBean.getYear()%>">
    103 <input type="hidden" name="parameter:pubmedId" value="<%=inputDataBean.getPubmedId()%>">
    104 <input type="hidden" name="parameter:experimentId" value="<%=inputDataBean.getExperimentId()%>">
     155<input type="hidden" name="file_id"
     156  value="<%=(String)request.getAttribute("file_id") %>"> <input
     157  type="hidden" name="parameter:zipFile"
     158  value="<%=(String)request.getAttribute("path") %>" id="zipFile">
    105159
    106 <!-- inputs from protocols.jsp page -->
    107 <input type="hidden" name="parameter:treatmentProtocol" value="<%=inputDataBean.getTreatmentProtocol()%>">
    108 <input type="hidden" name="parameter:extractionProtocol" value="<%=inputDataBean.getExtractionProtocol()%>">
    109 <input type="hidden" name="parameter:labelingProtocol" value="<%=inputDataBean.getLabelingProtocol()%>">
    110 <input type="hidden" name="parameter:hybridizationProtocol" value="<%=inputDataBean.getHybridizationProtocol()%>">
    111 <input type="hidden" name="parameter:scanningProtocol" value="<%=inputDataBean.getScanningProtocol()%>">
    112 <input type="hidden" name="parameter:treatmentProtocolParams" value="<%=inputDataBean.getTreatmentProtocolParams()%>">
    113 <input type="hidden" name="parameter:extractionProtocolParams" value="<%=inputDataBean.getExtractionProtocolParams()%>">
    114 <input type="hidden" name="parameter:labelingProtocolParams" value="<%=inputDataBean.getLabelingProtocolParams()%>">
    115 <input type="hidden" name="parameter:hybridizationProtocolParams" value="<%=inputDataBean.getHybridizationProtocolParams()%>">
    116 <input type="hidden" name="parameter:scanningProtocolParams" value="<%=inputDataBean.getScanningProtocolParams()%>">
     160<table>
    117161
    118 <!-- inputs from hybridizations.jsp page -->
    119 <input type="hidden" name="parameter:platform" value="<%=inputDataBean.getPlatform()%>"> 
    120 <input type="hidden" name="parameter:organism" value="<%=inputDataBean.getOrganism()%>">
    121 <input type="hidden" name="parameter:numDesigns" value="<%=inputDataBean.getNumDesigns()%>">
    122 <input type="hidden" name="parameter:dyeSwap" value="<%=inputDataBean.getDyeSwap()%>">
    123 <input type="hidden" name="parameter:refSample" value="<%=inputDataBean.getRefSample()%>">
    124 <input type="hidden" name="parameter:numTreatmentGroups" value="<%=inputDataBean.getNumTreatmentGroups()%>">
    125 <input type="hidden" name="parameter:expFactors" value="<%=inputDataBean.getExpFactors()%>">
    126 <input type="hidden" name="parameter:numReplicates" value="<%=inputDataBean.getNumReplicates()%>">
    127 <input type="hidden" name="parameter:tissues" value="<%=inputDataBean.getTissues()%>">
    128 <input type="hidden" name="parameter:pooling" value="<%=inputDataBean.getPooling()%>">
    129162
    130 <input type="hidden" name="file_id" value="<%=(String)request.getAttribute("file_id") %>">
    131 <input type="hidden" name="parameter:zipFile" value="<%=(String)request.getAttribute("path") %>"  id="zipFile">
     163  <%
     164    for (int i = 0; i < products.length; i++)
     165    {
     166  %>
    132167
    133 <table border="1">
     168  <tr>
    134169
    135   <!-- column headers row -->
    136   <tr>
     170    <%
     171        for (int j = 0; j < products[i].length; j++)
     172        {
     173    %>
     174    <td><%=products[i][j]%></td>
     175    <%
     176    }
     177    %>
     178
     179
    137180  </tr>
    138181
    139 <%
    140 for(int i = 0; i< 10; i++)
    141 {
    142 %>
    143 
    144   <tr>
    145     <td>&nbsp;</td>
    146     <td>&nbsp;</td>
    147   </tr>
    148  
    149 <%
    150 }
    151  %>
    152 
    153  
    154 
    155 
     182  <%
     183  }
     184  %>
    156185
    157186</table>
    158 
    159 
    160187</body>
    161188</html>
Note: See TracChangeset for help on using the changeset viewer.