Changeset 1930


Ignore:
Timestamp:
Apr 16, 2013, 9:28:14 AM (9 years ago)
Author:
Nicklas Nordborg
Message:

References #472 and #473. Use 'ng/ml' in Qubit files since that is what is shown in the display on the Qubit. The importer converts to 'ng/µl'.

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

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/QubitSampleNameExporter.java

    r1925 r1930  
    287287    tw.setEncoder(new CsvEncoderDecoder());
    288288   
    289     tw.tablePrintData("# Enter concentration measurements in nanogram/microliter");
    290     tw.tablePrintData("# All extracts should have an 'Original conc.' value");
     289    tw.tablePrintData("# Enter concentration measurements in nanogram/milliliter");
     290    tw.tablePrintData("# All extracts should have an 'Qubit ng/ml' value");
    291291    tw.tablePrintData("# Extracts that have been SpeedVac:ed should have ");
    292292    tw.tablePrintData("# a second measurement made after the SpeedVac");
    293293    tw.tablePrintData("#");
    294     tw.tablePrintData("Well", "Library name", "Original conc.", "SpeedVac conc.");
     294    tw.tablePrintData("Well", "Library name", "Qubit ng/ml", "After SpeedVac");
    295295    Iterator<BioWell> it = query.iterate(dc);
    296296    int lastCol = -1;
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/LibPrepServlet.java

    r1925 r1930  
    629629    // Parse the Qubit file and store concentration before and after speedvac in two maps
    630630    FlatFileParser ffp = new FlatFileParser();
    631     ffp.setDataHeaderRegexp(Pattern.compile("Well\\tLibrary name\\tOriginal conc\\.\\tSpeedVac conc\\..*"));
     631    ffp.setDataHeaderRegexp(Pattern.compile("Well\\tLibrary name\\tQubit ng/ml\\tAfter SpeedVac.*"));
    632632    ffp.setIgnoreRegexp(Pattern.compile("^#.*")); // Ignore all lines starting with '#'
    633633    ffp.setDataSplitterRegexp(Pattern.compile("\t")); // Split on tab
     
    640640
    641641    Mapper nameMapper = ffp.getMapper("\\Library name\\");
    642     Mapper originalConcMapper = ffp.getMapper("\\Original conc.\\");
    643     Mapper speedVacConcMapper = ffp.getMapper("\\SpeedVac conc.\\");
    644 
    645     Map<String, String> originalConc = new HashMap<String, String>();
    646     Map<String, String> speedVacConc = new HashMap<String, String>();
     642    Mapper originalConcMapper = ffp.getMapper("\\Qubit ng/ml\\");
     643    Mapper speedVacConcMapper = ffp.getMapper("\\After SpeedVac\\");
     644
     645    Map<String, Float> originalConc = new HashMap<String, Float>();
     646    Map<String, Float> speedVacConc = new HashMap<String, Float>();
    647647    while (ffp.hasMoreData())
    648648    {
     649      int lineNo = ffp.getParsedLines();
    649650      FlatFileParser.Data data = ffp.nextData();
    650651      String libName = nameMapper.getValue(data);
    651       originalConc.put(libName, originalConcMapper.getValue(data));
    652       speedVacConc.put(libName, speedVacConcMapper.getValue(data));
     652      originalConc.put(libName, checkQubitConcentration(originalConcMapper.getFloat(data), lineNo));
     653      speedVacConc.put(libName, checkQubitConcentration(speedVacConcMapper.getFloat(data), lineNo));
    653654    }
    654655   
    655656    // An original concentration is required, but SpeedVac concentration is optional
    656     LookupConverter<String, String> originalConcLookup = new LookupConverter<String, String>(originalConc,
     657    LookupConverter<String, Float> originalConcLookup = new LookupConverter<String, Float>(originalConc,
    657658      "Could not find original concentration for extract '{KEY}'"
    658659      );
    659     LookupConverter<String, String> speedVacConcLookup = new LookupConverter<String, String>(speedVacConc, null);
     660    LookupConverter<String, Float> speedVacConcLookup = new LookupConverter<String, Float>(speedVacConc, null);
    660661
    661662    cpi.addExternalLookup(originalConcLookup, originalConcType);
    662663    cpi.addExternalLookup(speedVacConcLookup, speedVacConcType);
    663664  }
     665 
     666  private Float checkQubitConcentration(Float value, int lineNo)
     667  {
     668    return value == null ? null : value / 1000;
     669  }
    664670}
Note: See TracChangeset for help on using the changeset viewer.