Changeset 2085


Ignore:
Timestamp:
Oct 18, 2013, 12:46:58 PM (9 years ago)
Author:
Nicklas Nordborg
Message:

References #502: Design flow cells

Replaced ReadString with SequenceString. The wizard is using 3 separate input fields for Read 1, Index read and Read 2. The values are concatenated and stored in the SequenceString annotation as read1-index-read2. Default values are: 55-7-54

Location:
extensions/net.sf.basedb.reggie/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/create_flowcells.jsp

    r2045 r2085  
    1717final float scale = Base.getScale(sc);
    1818final String home = ExtensionsControl.getHomeUrl("net.sf.basedb.reggie");
     19final String DEFAULT_READ_1 = "55";
     20final String DEFAULT_READ_INDEX = "7";
     21final String DEFAULT_READ_2 = "54";
    1922DbControl dc = null;
    2023try
     
    3336var currentStep = 1;
    3437
    35 var DEFAULT_READ_STRING = 'Y54N1I6J1Y53N1';
    3638var VOLUME_TO_USE_FROM_POOL = 10.0; // µl
    3739
    3840var poolsAreValid = false;
    3941var flowCellsAreValid = false;
    40 var readStringisValid = false;
     42var readIsValid = [];
    4143
    4244var flowCells = [];
     
    296298 
    297299  checkFlowCells();
    298   readStringOnChange(DEFAULT_READ_STRING);
    299300 
    300301  currentStep = 2;
     
    304305  Main.show('gocancel');
    305306  Main.show('goregister');
    306   frm.readString.focus();
    307 
    308 }
    309 
    310 function readStringOnChange(readString)
    311 {
    312   var frm = document.forms['reggie'];
    313   if (readString) frm.readString.value = readString;
    314  
    315   readStringIsValid = false;
    316   setInputStatus('readString', '', '');
    317  
    318   var readString = frm.readString.value;
    319   if (readString == '')
    320   {
    321     setInputStatus('readString', 'Missing', 'invalid');
    322     return;
    323   }
    324 
    325   if (!readString.match(/^([YNIJ]\d+)+$/))
    326   {
    327     setInputStatus('readString', 'Invalid format', 'invalid');
    328     return;
    329   }
    330  
    331   setInputStatus('readString', '', 'valid');
    332   readStringIsValid = true;
     307 
     308  readOnBlur('read1');
     309  readOnBlur('indexRead');
     310  readOnBlur('read2');
     311  frm.read1.focus();
    333312
    334313}
     
    367346}
    368347
     348function readOnBlur(name, defaultValue)
     349{
     350  var frm = document.forms['reggie'];
     351  setInputStatus(name, '', '');
     352
     353  var value = frm[name].value;
     354  if (value == '')
     355  {
     356    readIsValid[name] = false;
     357    setInputStatus(name, 'Missing', 'invalid');
     358    return;
     359  }
     360 
     361  if (!Numbers.isInteger(value))
     362  {
     363    readIsValid[name] = false;
     364    setInputStatus(name, 'Not a number', 'invalid');
     365    return;
     366  }
     367 
     368  readIsValid[name] = true;
     369  if (defaultValue && parseInt(value) != defaultValue)
     370  {
     371    setInputStatus(name, 'Default: ' + defaultValue, 'warning');
     372  }
     373  else
     374  {
     375    setInputStatus(name, '', 'valid');
     376  }
     377}
     378
     379function step2IsValid()
     380{
     381  if (!flowCellsAreValid) return false;
     382   
     383  if (readIsValid['read1'] != true) return false;
     384  if (readIsValid['indexRead'] != true) return false;
     385  if (readIsValid['read2'] != true) return false;
     386 
     387  return true;
     388}
     389
    369390function goRegister()
    370391{
    371   if (!flowCellsAreValid || !readStringIsValid) return;
     392  if (!step2IsValid()) return;
    372393 
    373394  var frm = document.forms['reggie'];
    374   frm.readString.disabled = true;
     395  frm.read1.disabled = true;
     396  frm.indexRead.disabled = true;
     397  frm.read2.disabled = true;
     398 
    375399  Main.hide('goregister');
    376400  Main.hide('gocancel');
     
    378402
    379403  var submitInfo = {};
    380   submitInfo.readString = frm.readString.value;
     404  submitInfo.read1 = parseInt(frm.read1.value);
     405  submitInfo.indexRead = parseInt(frm.indexRead.value);
     406  submitInfo.read2 = parseInt(frm.read2.value);
    381407  submitInfo.flowCells = flowCells;
    382408 
     
    677703      <table>
    678704      <tr valign="top">
    679         <td class="prompt">Read string</td>
     705        <td class="prompt">Number of reads</td>
     706        <td class="input">(planned)</td>
     707        <td class="status"></td>
     708        <td class="help" rowspan="4">
     709          Planned number of reads. The actual numbers used may be changed in the
     710          registration wizard.<br>
     711        </td>
     712      </tr>
     713      <tr valign="top">
     714        <td class="subprompt">Read 1</td>
    680715        <td class="input">
    681           <input type="text" class="required" name="readString" value="" size="20"
    682             onblur="readStringOnChange()">
    683         </td>
    684         <td class="status" id="readString.status"></td>
    685         <td class="help"><span id="readString.message" class="message" style="display: none;"></span>
    686           Read string used in the HiSeq. Letters <b>Y</b>, <b>N</b>, <b>I</b>, <b>J</b>
    687           followed by digits.
    688         </td>
     716          <input type="text" class="required" name="read1" value="<%=DEFAULT_READ_1 %>"
     717            size="10" onkeypress="return Numbers.integerOnly(event)" onblur="readOnBlur(this.name, <%=DEFAULT_READ_1 %>)">
     718            <span id="read1.message" class="message" style="display: none;"></span>
     719        </td>
     720        <td class="status" id="read1.status"></td>
     721      </tr>
     722      <tr valign="top">
     723        <td class="subprompt">Index read</td>
     724        <td class="input">
     725          <input type="text" class="required" name="indexRead" value="<%=DEFAULT_READ_INDEX %>"
     726            size="10" onkeypress="return Numbers.integerOnly(event)" onblur="readOnBlur(this.name, <%=DEFAULT_READ_INDEX %>)">
     727            <span id="indexRead.message" class="message" style="display: none;"></span>
     728        </td>
     729        <td class="status" id="indexRead.status"></td>
     730      </tr>
     731      <tr valign="top">
     732        <td class="subprompt">Read 2</td>
     733        <td class="input">
     734          <input type="text" class="required" name="read2" value="<%=DEFAULT_READ_2 %>"
     735            size="10" onkeypress="return Numbers.integerOnly(event)" onblur="readOnBlur(this.name, <%=DEFAULT_READ_2 %>)">
     736            <span id="read2.message" class="message" style="display: none;"></span>
     737        </td>
     738        <td class="status" id="read2.status"></td>
    689739      </tr>
    690740      <tr valign="top">
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/Annotationtype.java

    r2079 r2085  
    589589
    590590  /**
     591    The "SequenceString" annotation, used for physical bioassays (FlowCell).
     592    @since 2.13
     593  */
     594  public static final Annotationtype SEQUENCE_STRING =
     595    new Annotationtype("SequenceString", Type.STRING, Item.PHYSICALBIOASSAY);
     596
     597 
     598  /**
    591599    The "HiSeqPosition" annotation, used for physical bioassays (FlowCell).
    592600    It is an enumerated string annotation type with two options: A and B
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/FlowCellServlet.java

    r2079 r2085  
    253253        JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader());
    254254        JSONArray jsonFlowCells = (JSONArray)jsonReq.get("flowCells");
    255         String readString = (String)jsonReq.get("readString");
    256        
     255       
     256        Number read1 = (Number)jsonReq.get("read1");
     257        Number indexRead = (Number)jsonReq.get("indexRead");
     258        Number read2 = (Number)jsonReq.get("read2");
     259        // Sequence string is concatenated: read1-index-read2
     260        String sequenceString = read1 + "-" + indexRead + "-" + read2;
     261           
    257262        dc = sc.newDbControl();
    258263        ItemSubtype flowCellType = Subtype.FLOW_CELL.load(dc);
     
    272277          flowCell.setSize(jsonLanes.size());
    273278          dc.saveItem(flowCell);
    274           Annotationtype.READ_STRING.setAnnotationValue(dc, flowCell, readString);
     279          Annotationtype.SEQUENCE_STRING.setAnnotationValue(dc, flowCell, sequenceString);
    275280         
    276281          Map<Number, Extract> poolCache = new HashMap<Number, Extract>();
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/InstallServlet.java

    r2080 r2085  
    290290        jsonChecks.add(checkAnnotationType(dc, Annotationtype.CLUSTER_OPERATOR, 1, null, effectiveOptions, createIfMissing));
    291291        jsonChecks.add(checkAnnotationType(dc, Annotationtype.READ_STRING, 1, null, effectiveOptions, createIfMissing));
     292        jsonChecks.add(checkAnnotationType(dc, Annotationtype.SEQUENCE_STRING, 1, null, effectiveOptions, createIfMissing));
    292293        jsonChecks.add(checkAnnotationType(dc, Annotationtype.HISEQ_POSITION, 1,
    293294            new ValueOptions("A", "B"),
     
    374375        jsonChecks.add(checkAnnotationTypeCategory(dc, Subtype.FLOW_CELL, createIfMissing,
    375376            Annotationtype.FLOWCELL_ID, Annotationtype.CLUSTER_START, Annotationtype.CLUSTER_OPERATOR,
    376             Annotationtype.READ_STRING, Annotationtype.HISEQ_POSITION,
     377            Annotationtype.SEQUENCE_STRING, Annotationtype.READ_STRING, Annotationtype.HISEQ_POSITION,
    377378            Annotationtype.PLATE_PROCESS_RESULT));
    378379       
Note: See TracChangeset for help on using the changeset viewer.