Skip to content

Commit

Permalink
Merge pull request #66 from ao508/empty-cmo-ids
Browse files Browse the repository at this point in the history
Catch missing CMO patient IDs
  • Loading branch information
ao508 authored Jul 14, 2023
2 parents 9a595ac + fb33542 commit 51d4da2
Show file tree
Hide file tree
Showing 4 changed files with 545 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,14 @@ public void run() {
List<Object> updatedSamples = new ArrayList<>();
for (Object sample : samples) {
Map<String, Object> sampleMap = mapper.convertValue(sample, Map.class);
if (StringUtils.isBlank(sampleMap.get("cmoPatientId").toString())) {
// skip over samples with missing cmo patient id this should be
// getting caught by the request filter but we are taking extra precautions
// due to ongoing timeout exception investigations
LOG.warn("Sample is missing CMO patient ID that was not caught by the "
+ "request filter: " + mapper.writeValueAsString(sampleMap));
continue;
}
Map<String, Object> sampleStatusMap = mapper.convertValue(
sampleMap.get("status"), Map.class);
Status sampleStatus = new Status(Boolean.valueOf(
Expand Down Expand Up @@ -412,7 +420,8 @@ private Map<String, List<SampleMetadata>> getPatientSamplesMap(List<Object> samp
for (Object sample : samples) {
IgoSampleManifest igoSampleManifest = mapper.convertValue(sample, IgoSampleManifest.class);
// get or request existing patient samples and update patient sample mapping
if (!patientSamplesMap.containsKey(igoSampleManifest.getCmoPatientId())) {
if (!patientSamplesMap.containsKey(igoSampleManifest.getCmoPatientId())
&& !StringUtils.isBlank(igoSampleManifest.getCmoPatientId())) {
List<SampleMetadata> ptSamples = getExistingPatientSamples(
igoSampleManifest.getCmoPatientId());
patientSamplesMap.put(igoSampleManifest.getCmoPatientId(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
{
"requestId": "98765_X",
"requestName": "RNASeq-TruSeqPolyA",
"recipe": "RNASeq_PolyA",
"projectManagerName": "",
"piEmail": "",
"labHeadName": "Dana Scully",
"labHeadEmail": "email@address.com",
"investigatorName": "Fox Mulder",
"investigatorEmail": "email@address.com",
"dataAnalystName": "",
"dataAnalystEmail": "",
"otherContactEmails": "email@address.com",
"dataAccessEmails": "",
"qcAccessEmails": "",
"strand": "stranded-reverse",
"libraryType": "RNASeq-TruSeqPolyA",
"isCmoRequest": true,
"bicAnalysis": false,
"samples": [
{
"igoId": "98765_X_4",
"cmoSampleName": "",
"sampleName": "KG324li_base",
"cmoSampleClass": "Metastasis",
"cmoPatientId": "",
"investigatorSampleId": "KG324li_base",
"oncoTreeCode": "",
"tumorOrNormal": "Tumor",
"tissueLocation": "",
"specimenType": "CellLine",
"sampleOrigin": "Cell Pellet",
"preservation": "Frozen",
"collectionYear": "",
"sex": "",
"species": "Human",
"tubeId": "KG324li_base",
"cfDNA2dBarcode": null,
"baitSet": "null",
"qcReports": [],
"libraries": [
{
"barcodeId": null,
"barcodeIndex": null,
"libraryIgoId": null,
"libraryVolume": null,
"libraryConcentrationNgul": null,
"dnaInputNg": null,
"captureConcentrationNm": null,
"captureInputNg": null,
"captureName": null,
"runs": [
{
"runMode": null,
"runId": "RUNID_0456",
"flowCellId": "CELLID456",
"readLength": null,
"runDate": "2023-06-23",
"flowCellLanes": [],
"fastqs": [
"/igo/delivery/FASTQ/RUNID_0456/Project_98765_X/Sample_KG324li_base_IGO_98765_X_4/KG324li_base_IGO_98765_X_4_S14_L001_R1_001.fastq.gz",
"/igo/delivery/FASTQ/RUNID_0456/Project_98765_X/Sample_KG324li_base_IGO_98765_X_4/KG324li_base_IGO_98765_X_4_S14_L001_R2_001.fastq.gz",
"/igo/delivery/FASTQ/RUNID_0456/Project_98765_X/Sample_KG324li_base_IGO_98765_X_4/KG324li_base_IGO_98765_X_4_S14_L002_R1_001.fastq.gz",
"/igo/delivery/FASTQ/RUNID_0456/Project_98765_X/Sample_KG324li_base_IGO_98765_X_4/KG324li_base_IGO_98765_X_4_S14_L002_R2_001.fastq.gz"
]
}
]
}
],
"cmoSampleIdFields": {
"naToExtract": "RNA",
"normalizedPatientId": "",
"sampleType": "RNA",
"recipe": "RNASeq_PolyA"
},
"igoComplete": true
},
{
"igoId": "98765_X_3",
"cmoSampleName": "",
"sampleName": "KG090li_base",
"cmoSampleClass": "Metastasis",
"cmoPatientId": "",
"investigatorSampleId": "KG090li_base",
"oncoTreeCode": "",
"tumorOrNormal": "Tumor",
"tissueLocation": "",
"specimenType": "CellLine",
"sampleOrigin": "Cell Pellet",
"preservation": "Frozen",
"collectionYear": "",
"sex": "",
"species": "Human",
"tubeId": "KG090li_base",
"cfDNA2dBarcode": null,
"baitSet": "null",
"qcReports": [],
"libraries": [
{
"barcodeId": null,
"barcodeIndex": null,
"libraryIgoId": null,
"libraryVolume": null,
"libraryConcentrationNgul": null,
"dnaInputNg": null,
"captureConcentrationNm": null,
"captureInputNg": null,
"captureName": null,
"runs": [
{
"runMode": null,
"runId": "RUNID_0456",
"flowCellId": "CELLID456",
"readLength": null,
"runDate": "2023-06-23",
"flowCellLanes": [],
"fastqs": [
"/igo/delivery/FASTQ/RUNID_0456/Project_98765_X/Sample_KG090li_base_IGO_98765_X_3/KG090li_base_IGO_98765_X_3_S13_L001_R1_001.fastq.gz",
"/igo/delivery/FASTQ/RUNID_0456/Project_98765_X/Sample_KG090li_base_IGO_98765_X_3/KG090li_base_IGO_98765_X_3_S13_L001_R2_001.fastq.gz",
"/igo/delivery/FASTQ/RUNID_0456/Project_98765_X/Sample_KG090li_base_IGO_98765_X_3/KG090li_base_IGO_98765_X_3_S13_L002_R1_001.fastq.gz",
"/igo/delivery/FASTQ/RUNID_0456/Project_98765_X/Sample_KG090li_base_IGO_98765_X_3/KG090li_base_IGO_98765_X_3_S13_L002_R2_001.fastq.gz"
]
}
]
}
],
"cmoSampleIdFields": {
"naToExtract": "RNA",
"normalizedPatientId": "",
"sampleType": "RNA",
"recipe": "RNASeq_PolyA"
},
"igoComplete": true
},
{
"igoId": "98765_X_2",
"cmoSampleName": "",
"sampleName": "KG944N",
"cmoSampleClass": "Normal",
"cmoPatientId": "C-X95687",
"investigatorSampleId": "KG944N",
"oncoTreeCode": null,
"tumorOrNormal": "Normal",
"tissueLocation": "",
"specimenType": "CellLine",
"sampleOrigin": "Cell Pellet",
"preservation": "Frozen",
"collectionYear": "",
"sex": "",
"species": "Human",
"tubeId": "KG944N",
"cfDNA2dBarcode": null,
"baitSet": "null",
"qcReports": [],
"libraries": [
{
"barcodeId": null,
"barcodeIndex": null,
"libraryIgoId": null,
"libraryVolume": null,
"libraryConcentrationNgul": null,
"dnaInputNg": null,
"captureConcentrationNm": null,
"captureInputNg": null,
"captureName": null,
"runs": [
{
"runMode": null,
"runId": "RUNID_0456",
"flowCellId": "CELLID456",
"readLength": null,
"runDate": "2023-06-23",
"flowCellLanes": [],
"fastqs": [
"/igo/delivery/FASTQ/RUNID_0456/Project_98765_X/Sample_KG944N_IGO_98765_X_2/KG944N_IGO_98765_X_2_S12_L001_R1_001.fastq.gz",
"/igo/delivery/FASTQ/RUNID_0456/Project_98765_X/Sample_KG944N_IGO_98765_X_2/KG944N_IGO_98765_X_2_S12_L001_R2_001.fastq.gz",
"/igo/delivery/FASTQ/RUNID_0456/Project_98765_X/Sample_KG944N_IGO_98765_X_2/KG944N_IGO_98765_X_2_S12_L002_R1_001.fastq.gz",
"/igo/delivery/FASTQ/RUNID_0456/Project_98765_X/Sample_KG944N_IGO_98765_X_2/KG944N_IGO_98765_X_2_S12_L002_R2_001.fastq.gz"
]
}
]
}
],
"cmoSampleIdFields": {
"naToExtract": "RNA",
"normalizedPatientId": "",
"sampleType": "RNA",
"recipe": "RNASeq_PolyA"
},
"igoComplete": true
},
{
"igoId": "98765_X_1",
"cmoSampleName": "",
"sampleName": "KG882N",
"cmoSampleClass": "Normal",
"cmoPatientId": "",
"investigatorSampleId": "KG882N",
"oncoTreeCode": null,
"tumorOrNormal": "Normal",
"tissueLocation": "",
"specimenType": "CellLine",
"sampleOrigin": "Cell Pellet",
"preservation": "Frozen",
"collectionYear": "",
"sex": "",
"species": "Human",
"tubeId": "KG882N",
"cfDNA2dBarcode": null,
"baitSet": "null",
"qcReports": [],
"libraries": [
{
"barcodeId": null,
"barcodeIndex": null,
"libraryIgoId": null,
"libraryVolume": null,
"libraryConcentrationNgul": null,
"dnaInputNg": null,
"captureConcentrationNm": null,
"captureInputNg": null,
"captureName": null,
"runs": [
{
"runMode": null,
"runId": "RUNID_0456",
"flowCellId": "CELLID456",
"readLength": null,
"runDate": "2023-06-23",
"flowCellLanes": [],
"fastqs": [
"/igo/delivery/FASTQ/RUNID_0456/Project_98765_X/Sample_KG882N_IGO_98765_X_1/KG882N_IGO_98765_X_1_S11_L001_R1_001.fastq.gz",
"/igo/delivery/FASTQ/RUNID_0456/Project_98765_X/Sample_KG882N_IGO_98765_X_1/KG882N_IGO_98765_X_1_S11_L001_R2_001.fastq.gz",
"/igo/delivery/FASTQ/RUNID_0456/Project_98765_X/Sample_KG882N_IGO_98765_X_1/KG882N_IGO_98765_X_1_S11_L002_R1_001.fastq.gz",
"/igo/delivery/FASTQ/RUNID_0456/Project_98765_X/Sample_KG882N_IGO_98765_X_1/KG882N_IGO_98765_X_1_S11_L002_R2_001.fastq.gz"
]
}
]
}
],
"cmoSampleIdFields": {
"naToExtract": "RNA",
"normalizedPatientId": "",
"sampleType": "RNA",
"recipe": "RNASeq_PolyA"
},
"igoComplete": true
}
],
"pooledNormals": null,
"projectId": "98765"
}
2 changes: 2 additions & 0 deletions src/test/resources/data/mocked_request_data_details.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ mockRequest2aEmptySampleManifestValues incoming_requests/mocked_request2a_one_em
mockRequest1SamplesMissingFastQs incoming_requests/mocked_request1_sample_missing_fastqs.json Mock requset json with 2 samples missing fastqs
mockRequest1AllSamplesMissingFastQs incoming_requests/mocked_request1_all_samples_missing_fastqs.json Mock requset json with all samples missing fastqs
mockRequest1eNullStringBaitSet incoming_requests/mocked_request1e_null_string_baitset.json Mock requset json with "null" baitset values
mockRequest7SamplesMissingPids incoming_requests/mocked_request7_samples_missing_pids.json Mock request where 3 of 4 samples are missing CMO patient IDs.
mockValidatedRequest7SamplesMissingPids other_mocked_data/mocked_validated_request7_samples_missing_pids.json Request JSON after going through validation and sanity checks in request filter. Based on 'mockRequest7SamplesMissingPids'.
Loading

0 comments on commit 51d4da2

Please sign in to comment.