Changeset 6214


Ignore:
Timestamp:
Apr 15, 2021, 10:39:17 AM (13 months ago)
Author:
Nicklas Nordborg
Message:

References #1295: Registration of specimen handled by external lab

Moved the DataFilesFolder annotation from SequencingRun to DemuxedSequences since that makes more sense when dealing with the external sequencing where we get demuxed FASTQ files. This also makes it possible to implement checks in the "Start demux" and "Import FASTQ" wizards that data in the expected format is available. Eg. a SequencingRun with a DataFilesFolder should contain raw sequencing data and a DemuxedSequences should contain FASTQ files.

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

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/analysis/demux_start.js

    r6213 r6214  
    240240    var numDoNotUse = 0;
    241241    var hasPoolMix = false;
    242     var invalidPipeline = null;
     242    var invalidSelection = null;
    243243    Wizard.setInputStatus('seqRuns');
    244244    for (var seqNo = 0; seqNo < frm.seqRuns.length; seqNo++)
     
    249249        if (sr.pipeline && sr.pipeline != pipeline.name)
    250250        {
    251           invalidPipeline = Strings.encodeTags(sr.name+' ('+sr.pipeline)+') is not intended for the '+pipeline.name+' pipeline.';
     251          invalidSelection = Strings.encodeTags(sr.name+' ('+sr.pipeline)+') is not intended for the '+pipeline.name+' pipeline.';
     252        }
     253        else if (!sr.DataFilesFolder)
     254        {
     255          invalidSelection = Strings.encodeTags(sr.name+' is missing DataFilesFolder information');
    252256        }
    253257
     
    272276      return;
    273277    }
    274     if (invalidPipeline)
    275     {
    276       Wizard.setInputStatus('seqRuns', 'invalid', invalidPipeline);
     278    if (invalidSelection)
     279    {
     280      Wizard.setInputStatus('seqRuns', 'invalid', invalidSelection);
    277281      return;
    278282    }
  • extensions/net.sf.basedb.reggie/trunk/resources/analysis/import_fastq.js

    r6213 r6214  
    102102    var numSelected = 0;
    103103    var numDoNotUse = 0;
    104     var invalidPipeline = null;
    105     var missingRawFastq = null;
     104    var invalidSelection = null;
    106105   
    107106    Wizard.setInputStatus('mergedSequences');
     
    116115        if (ms.pipeline && ms.pipeline != 'RNAseq')
    117116        {
    118           invalidPipeline = Strings.encodeTags(ms.name+' ('+ms.pipeline)+') is not intended for the RNAseq pipeline.';
     117          invalidSelection = Strings.encodeTags(ms.name+' ('+ms.pipeline)+') is not intended for the RNAseq pipeline.';
    119118        }
    120         if (ms.rawFastq.length == 0)
     119        else if (ms.rawFastq.length == 0)
    121120        {
    122           missingRawFastq = Strings.encodeTags(ms.name+' is missing RawFASTQ information');
     121          invalidSelection = Strings.encodeTags(ms.name+' is missing RawFASTQ information');
     122        }
     123        else if (!ms.rawFastqFolder)
     124        {
     125          invalidSelection = Strings.encodeTags(ms.name+' demux ('+ms.demuxName+') is missing DataFilesFolder information');
    123126        }
    124127      }
     
    130133      return;
    131134    }
    132     if (invalidPipeline)
    133     {
    134       Wizard.setInputStatus('mergedSequences', 'invalid', invalidPipeline);
    135       return;
    136     }
    137     if (missingRawFastq)
    138     {
    139       Wizard.setInputStatus('mergedSequences', 'invalid', missingRawFastq);
     135    if (invalidSelection)
     136    {
     137      Wizard.setInputStatus('mergedSequences', 'invalid', invalidSelection);
    140138      return;
    141139    }
  • extensions/net.sf.basedb.reggie/trunk/resources/mipsanalysis/demux_start.js

    r6213 r6214  
    239239    var numDoNotUse = 0;
    240240    var hasPoolMix = false;
    241     var invalidPipeline = null;
     241    var invalidSelection = null;
    242242    Wizard.setInputStatus('seqRuns');
    243243    for (var seqNo = 0; seqNo < frm.seqRuns.length; seqNo++)
     
    248248        if (sr.pipeline && sr.pipeline != pipeline.name)
    249249        {
    250           invalidPipeline = Strings.encodeTags(sr.name+' ('+sr.pipeline)+') is not intended for the '+pipeline.name+' pipeline.';
     250          invalidSelection = Strings.encodeTags(sr.name+' ('+sr.pipeline)+') is not intended for the '+pipeline.name+' pipeline.';
     251        }
     252        else if (!sr.DataFilesFolder)
     253        {
     254          invalidSelection = Strings.encodeTags(sr.name+' is missing DataFilesFolder information');
    251255        }
    252256
     
    271275      return;
    272276    }
    273     if (invalidPipeline)
    274     {
    275       Wizard.setInputStatus('seqRuns', 'invalid', invalidPipeline);
     277    if (invalidSelection)
     278    {
     279      Wizard.setInputStatus('seqRuns', 'invalid', invalidSelection);
    276280      return;
    277281    }
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/MergedSequences.java

    r6193 r6214  
    233233  }
    234234
     235  public DemuxedSequences getSingleDemuxedSequecnces(DbControl dc)
     236  {
     237    ItemQuery<DerivedBioAssay> query = getItem().getParents();
     238    Subtype.DEMUXED_SEQUENCES.addFilter(dc, query);
     239    query.include(Reggie.INCLUDE_IN_CURRENT_PROJECT);
     240
     241    List<DerivedBioAssay> tmp = query.list(dc);
     242    if (tmp.size() == 0)
     243    {
     244      throw new InvalidDataException(
     245        "No demux item was found for " + getName() +
     246        "This wizard can't be used until that is corrected.");
     247    }
     248    else if (tmp.size() > 1)
     249    {
     250      throw new InvalidDataException(
     251        "More than one demux was found for " + getName() +
     252        "This wizard can't be used until that is corrected.");
     253    }
     254    return DemuxedSequences.get(tmp.get(0));
     255  }
     256 
    235257  /**
    236258    Get the parent flow cells.
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/grid/ImportFastqJobCreator.java

    r6211 r6214  
    189189     
    190190      // Get SequencingRun so that we can get the path to the FASTQ folder.
    191       List<DemuxedSequences> demux = ms.getDemuxedSequences(dc);
    192       if (demux.size() > 1)
    193       {
    194         throw new InvalidDataException(
    195           "More than one demux was found for " + mergeName +
    196           "This wizard can't be used until that is corrected.");
    197       }
    198       SequencingRun sr = SequencingRun.getByDemuxedSequences(dc, demux.get(0));
    199       String rawFastqFolder = ScriptUtil.checkValidPath((String)Annotationtype.DATA_FILES_FOLDER.getAnnotationValue(dc, sr.getItem()), true, true);
     191      DemuxedSequences demux = ms.getSingleDemuxedSequecnces(dc);
     192      String rawFastqFolder = ScriptUtil.checkValidPath((String)Annotationtype.DATA_FILES_FOLDER.getAnnotationValue(dc, demux.getItem()), true, true);
    200193     
    201194      if (merged.hasFileSet() && merged.getFileSet().hasMember(fastqData))
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/FutureSpecimenImporter.java

    r6210 r6214  
    140140   
    141141    if (items.sequencingRun == null || !demuxInfo.valid) return null;
    142     items.demux = getOrCreateDemux(dc, items.sequencingRun, flowCellInfo, demuxInfo);
     142    items.demux = getOrCreateDemux(dc, items.sequencingRun, flowCellInfo, seqRunInfo, demuxInfo);
    143143   
    144144    if (items.demux == null || !mergeInfo.valid || !fastqInfo.valid) return null;
     
    497497      Annotationtype.SEQUENCING_RESULT.setAnnotationValue(dc, seqRun, SequencingRun.SEQUENCING_SUCCESSFUL);
    498498     
    499       DateFormat df = new SimpleDateFormat("/yyyy/yyMMdd");
    500       String dataFilesFolder = df.format(seqRunInfo.startDate)+
    501         "_"+seqRunInfo.sequencer.serialNo+
    502         "_"+MD5.leftPad(Integer.toString(seqRunInfo.runNumber), '0', 4)+
    503         "_"+seqRunInfo.position+flowCellInfo.flowCellId;
    504       addDebugMessage("DataFilesFolder: "+dataFilesFolder);
    505       Annotationtype.DATA_FILES_FOLDER.setAnnotationValue(dc, seqRun, dataFilesFolder);
    506499      dc.saveItem(seqRun);
    507500     
     
    512505 
    513506 
    514   private DemuxedSequences getOrCreateDemux(DbControl dc, SequencingRun seqRun, FlowCellInfo flowCellInfo, DemuxInfo demuxInfo)
     507  private DemuxedSequences getOrCreateDemux(DbControl dc, SequencingRun seqRun, FlowCellInfo flowCellInfo, SequencingRunInfo seqRunInfo, DemuxInfo demuxInfo)
    515508  {
    516509    String flowCellId = flowCellInfo.flowCellId;
     
    532525      demux.setProtocol(null);
    533526      Annotationtype.ANALYSIS_RESULT.setAnnotationValue(dc, demux, DemuxedSequences.DEMUX_SUCCESSFUL);
    534       Annotationtype.READ_STRING.setAnnotationValue(dc, demux, demuxInfo.readString);       
     527      Annotationtype.READ_STRING.setAnnotationValue(dc, demux, demuxInfo.readString);   
     528     
     529      DateFormat df = new SimpleDateFormat("/yyyy/yyMMdd");
     530      String dataFilesFolder = df.format(seqRunInfo.startDate)+
     531        "_"+seqRunInfo.sequencer.serialNo+
     532        "_"+MD5.leftPad(Integer.toString(seqRunInfo.runNumber), '0', 4)+
     533        "_"+seqRunInfo.position+flowCellInfo.flowCellId;
     534      addDebugMessage("DataFilesFolder: "+dataFilesFolder);
     535      Annotationtype.DATA_FILES_FOLDER.setAnnotationValue(dc, demux, dataFilesFolder);
     536     
    535537      dc.saveItem(demux);
    536538     
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/DemuxMergeServlet.java

    r5862 r6214  
    660660    run.loadAnnotations(dc, "HiSeqPosition", Annotationtype.HISEQ_POSITION, null);
    661661    run.loadAnnotations(dc, "SequencingResult", Annotationtype.SEQUENCING_RESULT, null);
     662    run.loadAnnotations(dc, "DataFilesFolder", Annotationtype.DATA_FILES_FOLDER, null);
    662663    String seqCycles = (String)Annotationtype.SEQUENCING_CYCLES.getAnnotationValue(dc, run.getDerivedBioAssay());
    663664    Pipeline pipeline = Pipeline.getByName((String)Annotationtype.PIPELINE.getAnnotationValue(dc, run.getItem()));
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/FastqServlet.java

    r6213 r6214  
    3939import net.sf.basedb.reggie.dao.Annotationtype;
    4040import net.sf.basedb.reggie.dao.BiomaterialList;
     41import net.sf.basedb.reggie.dao.DemuxedSequences;
    4142import net.sf.basedb.reggie.dao.Library;
    4243import net.sf.basedb.reggie.dao.MergedSequences;
     
    99100          ms.loadAnnotations(dc, "pipeline", Annotationtype.PIPELINE, null);
    100101          ms.loadAnnotations(dc, "rawFastq", Annotationtype.RAW_FASTQ, null);
     102          DemuxedSequences demux = ms.getSingleDemuxedSequecnces(dc);
     103          ms.setAnnotation("rawFastqFolder", Annotationtype.DATA_FILES_FOLDER.getAnnotationValue(dc, demux.getItem()));
     104          ms.setAnnotation("demuxName", demux.getName());
    101105          Library lib = ms.getLibrary(dc);
    102106          lib.loadBioPlateLocation();
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/FutureSpecimenServlet.java

    r6212 r6214  
    265265              BiomaterialList.FASTQ_IMPORT_PIPELINE.get(dc).add(items.merged.getItem());
    266266              // Save the JSON to Fileserver.IMPORT_ARCHIVE
    267               String dataFilesFolder = (String)Annotationtype.DATA_FILES_FOLDER.getAnnotationValue(dc, items.sequencingRun.getItem());
     267              String dataFilesFolder = (String)Annotationtype.DATA_FILES_FOLDER.getAnnotationValue(dc, items.demux.getItem());
    268268              jsonFile.saveTo(archiveSession, archiveRoot + dataFilesFolder);
    269269              dc.commit();
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/InstallServlet.java

    r6213 r6214  
    10251025            Annotationtype.READ_STRING, Annotationtype.OMIT_LANES,
    10261026            Annotationtype.ANALYSIS_RESULT, Annotationtype.AUTO_PROCESSING,
     1027            Annotationtype.DATA_FILES_FOLDER,
    10271028            Annotationtype.READS, Annotationtype.PF_READS, Annotationtype.PF_NNNN_PCT,
    10281029            Annotationtype.PF_UNUSED_PCT, Annotationtype.DEMUX_WARNINGS, Annotationtype.SKIPPED_TILES,
Note: See TracChangeset for help on using the changeset viewer.