Changeset 5170


Ignore:
Timestamp:
Dec 3, 2018, 3:16:05 PM (5 months ago)
Author:
Nicklas Nordborg
Message:

References #1081: The release exporter should export more data

Added protocol, original and remaining quantity to exporters for RNA, DNA and FlowThrough. The original and remaining quantities are specific for each item type since not all have the same unit.

Location:
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/release
Files:
3 edited

Legend:

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

    r5132 r5170  
    77import org.json.simple.JSONObject;
    88
     9import net.sf.basedb.core.BioMaterialEvent;
    910import net.sf.basedb.core.DbControl;
    1011import net.sf.basedb.core.Extract;
     
    1213import net.sf.basedb.core.Quantity;
    1314import net.sf.basedb.core.Type;
     15import net.sf.basedb.core.Unit;
    1416import net.sf.basedb.core.snapshot.SnapshotManager;
    1517import net.sf.basedb.reggie.Reggie;
     
    4648      Extract dna = d.getExtract();
    4749      Lysate lys = d.getLysate();
     50      BioMaterialEvent creationEvent = dna.getCreationEvent();
    4851     
    4952      DbControl dc = item.getDbControl();
     
    6467 
    6568      jsonAnnotations.add(item.createBatchIndexAnnotationJSON("QiacubeBatchNo", qiacubeDate));
     69      jsonAnnotations.add(item.createAnnotationJSON("Protocol", getName(creationEvent.getProtocol())));
     70      jsonAnnotations.add(item.createAnnotationJSON("DNAOriginalQuantity", dna.getOriginalQuantity()));
     71      jsonAnnotations.add(item.createAnnotationJSON("DNARemainingQuantity", dna.getRemainingQuantity()));
    6672      jsonAnnotations.add(item.getAnnotationJSON(Annotationtype.ND_CONC, dna, null));
    6773      jsonAnnotations.add(item.getAnnotationJSON(Annotationtype.ND_260_BY_230, dna, null));
     
    8086    CohortTypeDefFactory dnaFactory = new CohortTypeDefFactory(dc, Item.EXTRACT, "DNA");
    8187
     88    Unit µg = UnitUtil.getUnit(dc, Quantity.MASS, "µg");
     89
    8290    // DNA annotation
    8391    dnaFactory.createAnnotationType("QiacubeBatchNo", Type.INT).setProjectSpecificValues(true);
     92    dnaFactory.createAnnotationType("Protocol", Type.STRING);
     93    dnaFactory.createAnnotationType("DNAOriginalQuantity", Type.FLOAT).setUnit(µg);
     94    dnaFactory.createAnnotationType("DNARemainingQuantity", Type.FLOAT).setUnit(µg).setProjectSpecificValues(true);
    8495    dnaFactory.createAnnotationType(Annotationtype.ND_CONC).setUnit(UnitUtil.getUnit(dc, Quantity.DENSITY, "ng/µl"));
    8596    dnaFactory.createAnnotationType(Annotationtype.ND_260_BY_230);
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/release/FlowThroughWriter.java

    r5132 r5170  
    77import org.json.simple.JSONObject;
    88
     9import net.sf.basedb.core.BioMaterialEvent;
    910import net.sf.basedb.core.DbControl;
    1011import net.sf.basedb.core.Extract;
    1112import net.sf.basedb.core.Item;
     13import net.sf.basedb.core.Quantity;
    1214import net.sf.basedb.core.Type;
     15import net.sf.basedb.core.Unit;
    1316import net.sf.basedb.core.snapshot.SnapshotManager;
    1417import net.sf.basedb.reggie.Reggie;
     
    1821import net.sf.basedb.reggie.json.FilteredJSONArray;
    1922import net.sf.basedb.util.filter.NotNullFilter;
     23import net.sf.basedb.util.units.UnitUtil;
    2024
    2125/**
     
    4448      Extract flowThrough = ft.getExtract();
    4549      Lysate lys = ft.getLysate();
     50      BioMaterialEvent creationEvent = flowThrough.getCreationEvent();
    4651     
    4752      DbControl dc = item.getDbControl();
     
    6267
    6368      jsonAnnotations.add(item.createBatchIndexAnnotationJSON("QiacubeBatchNo", qiacubeDate));
     69      jsonAnnotations.add(item.createAnnotationJSON("Protocol", getName(creationEvent.getProtocol())));
     70      jsonAnnotations.add(item.createAnnotationJSON("FTOriginalVolume", flowThrough.getOriginalQuantity()));
     71      jsonAnnotations.add(item.createAnnotationJSON("FTRemainingVolume", flowThrough.getRemainingQuantity()));
    6472
    6573      json.add(jsonFt);
     
    7583    CohortTypeDefFactory ftFactory = new CohortTypeDefFactory(dc, Item.EXTRACT, "FlowThrough");
    7684
     85    Unit µl = UnitUtil.getUnit(dc, Quantity.VOLUME, "µl");
     86
    7787    // FlowThrough annotations
    7888    ftFactory.createAnnotationType("QiacubeBatchNo", Type.INT).setProjectSpecificValues(true);
     89    ftFactory.createAnnotationType("Protocol", Type.STRING);
     90    ftFactory.createAnnotationType("FTOriginalVolume", Type.FLOAT).setUnit(µl);
     91    ftFactory.createAnnotationType("FTRemainingVolume", Type.FLOAT).setUnit(µl).setProjectSpecificValues(true);
    7992   
    8093    return ftFactory.allCreated();
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/release/RnaWriter.java

    r5100 r5170  
    77import org.json.simple.JSONObject;
    88
     9import net.sf.basedb.core.BioMaterialEvent;
    910import net.sf.basedb.core.DbControl;
    1011import net.sf.basedb.core.Extract;
     
    1213import net.sf.basedb.core.Quantity;
    1314import net.sf.basedb.core.Type;
     15import net.sf.basedb.core.Unit;
    1416import net.sf.basedb.core.snapshot.SnapshotManager;
    1517import net.sf.basedb.reggie.Reggie;
     
    5052      Extract rna = r.getItem();
    5153      Lysate lys = r.getLysate();
     54      BioMaterialEvent creationEvent = rna.getCreationEvent();
    5255     
    5356      DbControl dc = item.getDbControl();
     
    6871 
    6972      jsonAnnotations.add(item.createBatchIndexAnnotationJSON("QiacubeBatchNo", qiacubeDate));
     73      jsonAnnotations.add(item.createAnnotationJSON("Protocol", getName(creationEvent.getProtocol())));
     74      jsonAnnotations.add(item.createAnnotationJSON("RNAOriginalQuantity", rna.getOriginalQuantity()));
     75      jsonAnnotations.add(item.createAnnotationJSON("RNARemainingQuantity", rna.getRemainingQuantity()));
     76
    7077      jsonAnnotations.add(item.getAnnotationJSON(Annotationtype.ND_CONC, rna, null));
    7178      jsonAnnotations.add(item.getAnnotationJSON(Annotationtype.ND_260_BY_230, rna, null));
     
    8895    CohortTypeDefFactory rnaFactory = new CohortTypeDefFactory(dc, Item.EXTRACT, "RNA");
    8996
     97    Unit µg = UnitUtil.getUnit(dc, Quantity.MASS, "µg");
     98
    9099    // RNA annotation
    91100    rnaFactory.createAnnotationType("QiacubeBatchNo", Type.INT).setProjectSpecificValues(true);
     101    rnaFactory.createAnnotationType("Protocol", Type.STRING);
     102    rnaFactory.createAnnotationType("RNAOriginalQuantity", Type.FLOAT).setUnit(µg);
     103    rnaFactory.createAnnotationType("RNARemainingQuantity", Type.FLOAT).setUnit(µg).setProjectSpecificValues(true);
    92104    rnaFactory.createAnnotationType(Annotationtype.ND_CONC).setUnit(UnitUtil.getUnit(dc, Quantity.DENSITY, "ng/µl"));
    93105    rnaFactory.createAnnotationType(Annotationtype.ND_260_BY_230);
Note: See TracChangeset for help on using the changeset viewer.