Changeset 2105


Ignore:
Timestamp:
Oct 25, 2013, 11:34:45 AM (9 years ago)
Author:
Nicklas Nordborg
Message:

References #499: Export sample sheet for flow cell

The ReadString parameter is now calculated automatically from the SequencingCycles values. It is assumed that the SequencingCycles consists of 3 values separated by '-'. The first and last values are normal reads and use 'Y'/'N' and the middle value is index read and use 'I' and 'J'.
Each value is subtracted by one and used for the 'Y' or 'I' part. Then 'N1' or 'J1' is added.

If it is not possible to calculate the ReadString the default value 'Y54N1I6J1Y53N1' is used.

For this to work, the plug-in configuration can no longer have any parameter for the ReadString since it has higher priority than the default values.

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

    r2088 r2105  
    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 
    136 Y = the cycle should be used as part of an insert read
    137 N = the cycle should be skipped
    138 I = the cycle should be used as part of the index (barcode)
    139 J = the cycle is part of the index but should not be used in demultiplexing
    140 
    141 A number means repeat the preceeding letter this many times.</description>
    142       <class>java.lang.String</class>
    143       <value>Y54N1I6J1Y53N1</value>
    144     </parameter>
    145131    <parameter>
    146132      <name>SequencingCenter</name>
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/FlowCellSampleSheetExporter.java

    r2088 r2105  
    4545import net.sf.basedb.reggie.dao.Annotationtype;
    4646import net.sf.basedb.reggie.dao.Subtype;
     47import net.sf.basedb.util.Values;
    4748import net.sf.basedb.util.export.TableWriter;
    4849
     
    165166          return;
    166167        }
    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"));
     168
    175169        storeValue(configuration, request, ri.getParameter("Project"));
    176170        storeValue(configuration, request, ri.getParameter("SequencingCenter"));
     
    292286    {
    293287      dc = sc.newDbControl();
    294       parameters.add(getReadStringParameter(null));
    295288      parameters.add(getProjectParameter(dc));
    296289      parameters.add(getSequencingCenterParameter());
     
    548541  private PluginParameter<String> getReadStringParameter(String sequencingCycles)
    549542  {
     543    String readString = null;
     544    if (sequencingCycles != null)
     545    {
     546      readString = sequencingCycles2ReadString(sequencingCycles);
     547    }
    550548   
    551549    PluginParameter<String> parameter = new PluginParameter<String>("ReadString", "Read string",
     
    556554      "I = the cycle should be used as part of the index (barcode)\n"+
    557555      "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.",
     556      "A number means repeat the preceeding letter this many times.", readString,
    559557      new StringParameterType(255, DEFAULT_READ_STRING, true)
    560558      );
     
    609607    return parameter;
    610608  }
     609 
     610  private String sequencingCycles2ReadString(String sequencingCycles)
     611  {
     612    StringBuilder readString = new StringBuilder();
     613    try
     614    {
     615      Integer[] cycles = Values.getInt(sequencingCycles.split("-"));
     616      if (cycles.length == 3)
     617      {
     618        // First value converted to Y(x-1)N1
     619        if (cycles[0] > 0)
     620        {
     621          readString.append("Y").append(cycles[0]-1);
     622          readString.append("N1");
     623        }
     624       
     625        // Second value converted to I(x-1)J1
     626        if (cycles[1] > 0)
     627        {
     628          readString.append("I").append(cycles[1]-1);
     629          readString.append("J1");
     630        }
     631       
     632        // Third value converted to Y(x-1)N1
     633        if (cycles[2] > 0)
     634        {
     635          readString.append("Y").append(cycles[2]-1);
     636          readString.append("N1");
     637        }
     638      }
     639    }
     640    catch (RuntimeException ex)
     641    {
     642      // Could not convert to read string
     643      readString.setLength(0);
     644    }
     645    return readString.length() == 0 ? null : readString.toString();
     646  }
     647 
    611648}
Note: See TracChangeset for help on using the changeset viewer.