Changeset 2088


Ignore:
Timestamp:
Oct 18, 2013, 2:29:03 PM (9 years ago)
Author:
Nicklas Nordborg
Message:

References #499: Export sample sheet for flow cell

Added ReadString as a parameter to the sample sheet exporter.

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

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/META-INF/plugin-configurations.xml

    r2075 r2088  
    129129    <configname>SCAN-B</configname>
    130130    <description>Configuration for the default SCAN-B setup.</description>
     131   <parameter>
     132      <name>ReadString</name>
     133      <label>Read string</label>
     134      <description>Pattern describing how each sequencing cycle is used.
     135
     136Y = the cycle should be used as part of an insert read
     137N = the cycle should be skipped
     138I = the cycle should be used as part of the index (barcode)
     139J = the cycle is part of the index but should not be used in demultiplexing
     140
     141A number means repeat the preceeding letter this many times.</description>
     142      <class>java.lang.String</class>
     143      <value>Y54N1I6J1Y53N1</value>
     144    </parameter>
    131145    <parameter>
    132146      <name>SequencingCenter</name>
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/FlowCellSampleSheetExporter.java

    r2076 r2088  
    6666    The deault read string pattern.
    6767  */
    68   public static final String DEFAULT_READ_STRING = "Y100N1I6J1Y100N1";
     68  public static final String DEFAULT_READ_STRING = "Y54N1I6J1Y53N1";
    6969 
    7070  public static final String DEFAULT_PROJECT_NAME = "scanb";
     
    165165          return;
    166166        }
    167 
     167        String readString = (String)request.getParameterValue("ReadString");
     168        if (!isValidReadString(readString))
     169        {
     170          response.setError("Not a valid ReadString: '"+readString + "'", null);
     171          return;
     172        }
     173
     174        storeValue(configuration, request, ri.getParameter("ReadString"));
    168175        storeValue(configuration, request, ri.getParameter("Project"));
    169176        storeValue(configuration, request, ri.getParameter("SequencingCenter"));
     
    181188          response.setError(errors.size() + " invalid parameters were found in the request",errors);
    182189          return;
    183         }       
     190        }
     191       
     192        String readString = (String)request.getParameterValue("ReadString");
     193        if (!isValidReadString(readString))
     194        {
     195          response.setError("Not a valid ReadString: '"+readString + "'", null);
     196          return;
     197        }
    184198
    185199        storeValue(job, request, ri.getParameter("flowCell"));
     200        storeValue(job, request, ri.getParameter("ReadString"));
    186201        storeValue(job, request, ri.getParameter("Project"));
    187202        storeValue(job, request, ri.getParameter("SequencingCenter"));
     
    277292    {
    278293      dc = sc.newDbControl();
     294      parameters.add(getReadStringParameter(null));
    279295      parameters.add(getProjectParameter(dc));
    280296      parameters.add(getSequencingCenterParameter());
     
    304320       
    305321        PhysicalBioAssay currentBioAssay = null;
     322        String currentSequencingCycles = null;
    306323        int currentBioAssayId = sc.getCurrentContext(Item.PHYSICALBIOASSAY).getId();
    307324        if (currentBioAssayId != 0)
    308325        {
    309326          currentBioAssay = PhysicalBioAssay.getById(dc, currentBioAssayId);
     327          currentSequencingCycles = (String)Annotationtype.SEQUENCING_CYCLES.getAnnotationValue(dc, currentBioAssay);
    310328        }
    311329       
     
    330348        parameters.add(new PluginParameter<String>(null, "Sample sheet options",
    331349          "The options for the entire sample sheet are defined in the plug-in configuration but can be modified here.", null));
     350        parameters.add(getReadStringParameter(currentSequencingCycles));
    332351        parameters.add(getProjectParameter(dc));
    333352        parameters.add(getSequencingCenterParameter());
     
    396415    // Some info is global on the flow cell
    397416    info[0] = Annotationtype.FLOWCELL_ID.getAnnotationValue(dc, flowCell); // Flow cell ID
    398     info[2] = Annotationtype.READ_STRING.getAnnotationValue(dc, flowCell); // Read string
     417    info[2] = getParameter(parameters, "ReadString", DEFAULT_READ_STRING); // Read string
    399418    info[3] = getParameter(parameters, "Project", projectName); // Project name
    400419    info[9] = getParameter(parameters, "Width", DEFAULT_LIBRARY_WIDTH); // Width
     
    511530 
    512531  /**
     532    Check that the value is a sequence of Y, N, I, J followed by a number
     533  */
     534  private boolean isValidReadString(String value)
     535  {
     536    return value != null && value.matches("([YNIJ]\\d+)+");
     537  }
     538
     539 
     540  /**
    513541    Convert to lower case and remove all characters not in [a-z0-9_]
    514542  */
     
    518546  }
    519547
     548  private PluginParameter<String> getReadStringParameter(String sequencingCycles)
     549  {
     550   
     551    PluginParameter<String> parameter = new PluginParameter<String>("ReadString", "Read string",
     552      (sequencingCycles != null ? "<b>SequencingCycles for this flow cell: <i>" + sequencingCycles + "</i></b>\n\n" : "") +
     553      "Pattern describing how each sequencing cycle is used.\n\n"+
     554      "Y = the cycle should be used as part of an insert read\n"+
     555      "N = the cycle should be skipped\n"+
     556      "I = the cycle should be used as part of the index (barcode)\n"+
     557      "J = the cycle is part of the index but should not be used in demultiplexing\n\n"+
     558      "A number means repeat the preceeding letter this many times.",
     559      new StringParameterType(255, DEFAULT_READ_STRING, true)
     560      );
     561    return parameter;
     562  }
     563
     564 
    520565  private PluginParameter<String> getProjectParameter(DbControl dc)
    521566  {
Note: See TracChangeset for help on using the changeset viewer.