Changeset 6207
- Timestamp:
- Apr 12, 2021, 2:50:47 PM (13 months ago)
- Location:
- extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/RnaQc.java
r4107 r6207 92 92 } 93 93 94 public static RnaQc get(Extract extract) 95 { 96 return new RnaQc(extract); 97 } 98 94 99 RnaQc(Extract extract) 95 100 { -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/FutureSpecimenImporter.java
r6205 r6207 6 6 7 7 import net.sf.basedb.core.BioMaterialEvent; 8 import net.sf.basedb.core.BioMaterialEventSource; 8 9 import net.sf.basedb.core.BioPlate; 9 10 import net.sf.basedb.core.BioWell; … … 17 18 import net.sf.basedb.reggie.dao.BioplateType; 18 19 import net.sf.basedb.reggie.dao.DemuxedSequences; 20 import net.sf.basedb.reggie.dao.Dna; 19 21 import net.sf.basedb.reggie.dao.FlowCell; 22 import net.sf.basedb.reggie.dao.FlowThrough; 20 23 import net.sf.basedb.reggie.dao.Library; 21 24 import net.sf.basedb.reggie.dao.Lysate; … … 25 28 import net.sf.basedb.reggie.dao.ReactionPlate; 26 29 import net.sf.basedb.reggie.dao.Rna; 30 import net.sf.basedb.reggie.dao.RnaQc; 27 31 import net.sf.basedb.reggie.dao.SequencingRun; 28 32 import net.sf.basedb.reggie.dao.SpecimenTube; 29 33 import net.sf.basedb.reggie.dao.Subtype; 30 34 import net.sf.basedb.reggie.plugins.cmd.DemuxInfo; 35 import net.sf.basedb.reggie.plugins.cmd.DnaInfo; 31 36 import net.sf.basedb.reggie.plugins.cmd.FlowCellInfo; 37 import net.sf.basedb.reggie.plugins.cmd.FlowThroughInfo; 32 38 import net.sf.basedb.reggie.plugins.cmd.JsonFile; 33 39 import net.sf.basedb.reggie.plugins.cmd.JsonSection; 34 40 import net.sf.basedb.reggie.plugins.cmd.LibraryInfo; 41 import net.sf.basedb.reggie.plugins.cmd.LysateInfo; 35 42 import net.sf.basedb.reggie.plugins.cmd.MergeInfo; 36 43 import net.sf.basedb.reggie.plugins.cmd.PoolInfo; 44 import net.sf.basedb.reggie.plugins.cmd.RnaInfo; 37 45 import net.sf.basedb.reggie.plugins.cmd.SequencingRunInfo; 38 46 import net.sf.basedb.util.MD5; … … 87 95 88 96 JsonSection jsonSpecimen = jsonFile.getRequiredSection("Specimen"); 89 JsonSection jsonLysate = jsonFile.getRequiredSection("Lysate");90 JsonSection jsonRNA = jsonFile.getRequiredSection("RNA");91 JsonSection jsonDNA = jsonFile.getRequiredSection("DNA");92 JsonSection jsonFT = jsonFile.getRequiredSection("FlowThrough");93 97 98 LysateInfo lysateInfo = jsonFile.getLysate(); 99 RnaInfo rnaInfo = jsonFile.getRna(); 100 DnaInfo dnaInfo = jsonFile.getDna(); 101 FlowThroughInfo ftInfo = jsonFile.getFlowThroughInfo(); 94 102 LibraryInfo libInfo = jsonFile.getLibrary(); 95 103 PoolInfo poolInfo = jsonFile.getPool(); … … 103 111 SpecimenTube specimen = importToSpecimen(dc, sample, jsonSpecimen); 104 112 105 if (jsonLysate == null) return; 106 Lysate lysate = createLysate(dc, specimen, jsonLysate); 107 108 if (jsonRNA == null) return; 109 Rna rna = createRNA(dc, lysate, jsonRNA); 113 if (specimen == null || !lysateInfo.valid) return; 114 Lysate lysate = createLysate(dc, specimen, lysateInfo); 115 116 if (lysate == null || !rnaInfo.valid || !dnaInfo.valid || !ftInfo.valid) return; 117 Rna rna = createRna(dc, lysate, rnaInfo); 118 RnaQc rnaQc = rna != null ? createRnaQc(dc, rna, rnaInfo) : null; 119 Dna dna = createDna(dc, lysate, dnaInfo); 120 FlowThrough ft = createFlowThrough(dc, lysate, ftInfo); 110 121 111 122 if (rna == null || !libInfo.valid) return; … … 153 164 } 154 165 155 private Lysate createLysate(DbControl dc, SpecimenTube specimen, JsonSection jsonLysate)166 private Lysate createLysate(DbControl dc, SpecimenTube specimen, LysateInfo lysateInfo) 156 167 { 157 168 Extract lysate = Extract.getNew(dc); 158 169 lysate.setItemSubtype(Subtype.LYSATE.get(dc)); 159 170 lysate.setName(specimen.getNextLysateName(dc)); 171 160 172 BioMaterialEvent creationEvent = lysate.getCreationEvent(); 161 creationEvent.setSource(specimen.getItem()); 162 173 BioMaterialEventSource specSrc = creationEvent.setSource(specimen.getItem()); 174 creationEvent.setEventDate(lysateInfo.lysateDate); 175 if (lysateInfo.protocol != null) addDebugMessage("Found: " + lysateInfo.protocol.getName()); 176 creationEvent.setProtocol(lysateInfo.protocol); 177 creationEvent.setHardware(null); 178 179 Annotationtype.PARTITION_DATE.setAnnotationValue(dc, lysate, lysateInfo.partitionDate); 180 181 lysate.setOriginalQuantity(lysateInfo.originalVolume); 182 specSrc.setUsedQuantity(lysateInfo.usedFromSpecimen); 183 184 // TODO -- box/tube information 185 163 186 dc.saveItem(lysate); 164 187 … … 167 190 } 168 191 169 private Rna createR NA(DbControl dc, Lysate lysate, JsonSection jsonRNA)192 private Rna createRna(DbControl dc, Lysate lysate, RnaInfo rnaInfo) 170 193 { 171 194 Extract rna = Extract.getNew(dc); 172 195 rna.setItemSubtype(Subtype.RNA.get(dc)); 173 196 rna.setName(lysate.getNextChildName(dc, Subtype.RNA)); 197 174 198 BioMaterialEvent creationEvent = rna.getCreationEvent(); 175 creationEvent.setSource(lysate.getItem()); 176 199 BioMaterialEventSource lysSrc = creationEvent.setSource(lysate.getItem()); 200 creationEvent.setEventDate(rnaInfo.qiacubeDate); 201 if (rnaInfo.protocol != null) addDebugMessage("Found: " + rnaInfo.protocol.getName()); 202 creationEvent.setProtocol(rnaInfo.protocol); 203 creationEvent.setHardware(null); 204 205 Annotationtype.QIACUBE_DATE.setAnnotationValue(dc, rna, rnaInfo.qiacubeDate); 206 Annotationtype.QIACUBE_RUN_NO.setAnnotationValue(dc, rna, rnaInfo.qiacubeRunNumber); 207 Annotationtype.QIACUBE_POSITION.setAnnotationValue(dc, rna, rnaInfo.qiacubePos); 208 Annotationtype.QIACUBE_OPERATOR.setAnnotationValue(dc, rna, rnaInfo.operator); 209 210 // TODO -- concentrations and quantities 211 Annotationtype.QUBIT_CONC.setAnnotationValue(dc, rna, rnaInfo.qubitConc); 212 rna.setOriginalQuantity(null); 213 lysSrc.setUsedQuantity(null); 214 215 // TODO -- box/tube information 216 177 217 dc.saveItem(rna); 178 218 179 219 addDebugMessage("Created: "+ rna.getName()); 180 220 return Rna.get(rna); 221 } 222 223 private Dna createDna(DbControl dc, Lysate lysate, DnaInfo dnaInfo) 224 { 225 Extract dna = Extract.getNew(dc); 226 dna.setItemSubtype(Subtype.DNA.get(dc)); 227 dna.setName(lysate.getNextChildName(dc, Subtype.DNA)); 228 229 BioMaterialEvent creationEvent = dna.getCreationEvent(); 230 BioMaterialEventSource lysSrc = creationEvent.setSource(lysate.getItem()); 231 creationEvent.setEventDate(dnaInfo.qiacubeDate); 232 if (dnaInfo.protocol != null) addDebugMessage("Found: " + dnaInfo.protocol.getName()); 233 creationEvent.setProtocol(dnaInfo.protocol); 234 creationEvent.setHardware(null); 235 236 Annotationtype.QIACUBE_DATE.setAnnotationValue(dc, dna, dnaInfo.qiacubeDate); 237 Annotationtype.QIACUBE_RUN_NO.setAnnotationValue(dc, dna, dnaInfo.qiacubeRunNumber); 238 Annotationtype.QIACUBE_POSITION.setAnnotationValue(dc, dna, dnaInfo.qiacubePos); 239 Annotationtype.QIACUBE_OPERATOR.setAnnotationValue(dc, dna, dnaInfo.operator); 240 241 // TODO -- concentrations and quantities 242 Annotationtype.QUBIT_CONC.setAnnotationValue(dc, dna, dnaInfo.qubitConc); 243 dna.setOriginalQuantity(null); 244 lysSrc.setUsedQuantity(null); 245 246 // TODO -- box/tube information 247 248 dc.saveItem(dna); 249 250 addDebugMessage("Created: "+ dna.getName()); 251 return Dna.get(dna); 252 } 253 254 private FlowThrough createFlowThrough(DbControl dc, Lysate lysate, FlowThroughInfo ftInfo) 255 { 256 Extract ft = Extract.getNew(dc); 257 ft.setItemSubtype(Subtype.FLOW_THROUGH.get(dc)); 258 ft.setName(lysate.getNextChildName(dc, Subtype.FLOW_THROUGH)); 259 260 BioMaterialEvent creationEvent = ft.getCreationEvent(); 261 BioMaterialEventSource lysSrc = creationEvent.setSource(lysate.getItem()); 262 creationEvent.setEventDate(ftInfo.qiacubeDate); 263 if (ftInfo.protocol != null) addDebugMessage("Found: " + ftInfo.protocol.getName()); 264 creationEvent.setProtocol(ftInfo.protocol); 265 creationEvent.setHardware(null); 266 267 Annotationtype.QIACUBE_DATE.setAnnotationValue(dc, ft, ftInfo.qiacubeDate); 268 Annotationtype.QIACUBE_RUN_NO.setAnnotationValue(dc, ft, ftInfo.qiacubeRunNumber); 269 Annotationtype.QIACUBE_POSITION.setAnnotationValue(dc, ft, ftInfo.qiacubePos); 270 Annotationtype.QIACUBE_OPERATOR.setAnnotationValue(dc, ft, ftInfo.operator); 271 272 // TODO -- quantities 273 ft.setOriginalQuantity(null); 274 lysSrc.setUsedQuantity(null); 275 276 // TODO -- box/tube information 277 278 dc.saveItem(ft); 279 280 addDebugMessage("Created: "+ ft.getName()); 281 return FlowThrough.get(ft); 282 } 283 284 private RnaQc createRnaQc(DbControl dc, Rna rna, RnaInfo rnaInfo) 285 { 286 Extract rnaQc = Extract.getNew(dc); 287 rnaQc.setItemSubtype(Subtype.RNAQC.get(dc)); 288 rnaQc.setName(rna.getNextRnaQcName(dc)); 289 290 BioMaterialEvent creationEvent = rnaQc.getCreationEvent(); 291 creationEvent.setSource(rna.getItem()); 292 // TODO -- do we need more information about RNAQC 293 // creationEvent.setEventDate(rnaInfo.qcDate); 294 creationEvent.setEventDate(rnaInfo.qiacubeDate); 295 296 // TODO -- BA_RIN or CA_RQS 297 Annotationtype.CA_RQS.setAnnotationValue(dc, rnaQc, rnaInfo.rinOrRqs); 298 299 dc.saveItem(rnaQc); 300 addDebugMessage("Created: "+ rnaQc.getName()); 301 return RnaQc.get(rnaQc); 181 302 } 182 303 … … 188 309 Pipeline.RNA_SEQ.setAnnotation(dc, lib); 189 310 BioMaterialEvent creationEvent = lib.getCreationEvent(); 190 creationEvent.setSource(rna.getItem()); 311 BioMaterialEventSource rnaSrc = creationEvent.setSource(rna.getItem()); 312 // TODO -- used quantity from source 313 rnaSrc.setUsedQuantity(null); 191 314 192 315 // Library annotations -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/cmd/JsonFile.java
r6205 r6207 80 80 81 81 private FastqInfo fastqInfo; 82 private LysateInfo lysateInfo; 83 private RnaInfo rnaInfo; 84 private DnaInfo dnaInfo; 85 private FlowThroughInfo flowThroughInfo; 82 86 private LibraryInfo libInfo; 83 87 private PoolInfo poolInfo; … … 225 229 if (fastqInfo.valid) fastqInfo.loadFileInfo(session, rootDir); 226 230 231 lysateInfo = new LysateInfo(getRequiredSection("Lysate")); 232 dnaInfo = new DnaInfo(getRequiredSection("DNA")); 233 rnaInfo = new RnaInfo(getRequiredSection("RNA")); 234 flowThroughInfo = new FlowThroughInfo(getRequiredSection("FlowThrough")); 227 235 libInfo = new LibraryInfo(getRequiredSection("Library")); 228 236 poolInfo = new PoolInfo(getRequiredSection("Pool"), libInfo); … … 250 258 } 251 259 260 public LysateInfo getLysate() 261 { 262 return lysateInfo; 263 } 264 265 public RnaInfo getRna() 266 { 267 return rnaInfo; 268 } 269 270 public DnaInfo getDna() 271 { 272 return dnaInfo; 273 } 274 275 public FlowThroughInfo getFlowThroughInfo() 276 { 277 return flowThroughInfo; 278 } 279 252 280 public LibraryInfo getLibrary() 253 281 { -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/cmd/PlateWellValidator.java
r6201 r6207 24 24 */ 25 25 public static final PlateWellValidator PLATE_8x12 = new PlateWellValidator(8, 12); 26 27 /** 28 Validator fow Qiacube positions which are represented as 6 rows with 2 columns. 29 */ 30 public static final PlateWellValidator QIACUBE = new PlateWellValidator(6, 2); 26 31 27 32 private final Pattern pattern;
Note: See TracChangeset
for help on using the changeset viewer.