Skip to content

Commit

Permalink
update to tidy final reports
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinesands committed Aug 12, 2024
1 parent d0f639d commit 46423b7
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 12 deletions.
9 changes: 7 additions & 2 deletions Tests/test_targeteddataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -4749,8 +4749,13 @@ def setUp(self):
'quantiles': tmpDataset.Attributes['quantiles'],
'methodName': 'Bruker Quant-UR Data',
'externalID': [],
'sampleMetadataNotExported': ['Acqu Date', 'Acqu Time', 'Sample Type'],
'featureMetadataNotExported': ['comment'],
'sampleMetadataNotExported': ["AUNM", "BF1", "BYTORDP", "Computer", "File Path", "NC_proc", "NS", "O1",
"OFFSET", "OWNER", "P", "PROBHD", "PULPROG", "RG", "SF", "SFO1", "SI", "SW", "SW_p",
"TD", "XDIM", "Delta PPM", "ERETIC Integral","ERETIC Concentration (mM)",
"Line Width (Hz)", "Exclusion Details", "CalibrationFail", "LineWidthFail",
"WaterPeakFail", "SolventPeakFail", "BaselineFail", "Sample Base Name", "expno",
"Acqu Date", "Acqu Time", "Sample Type"],
'featureMetadataNotExported': ['comment', 'Exclusion Details'],
'analyticalMeasurements': {'Acquired Time': 'date', 'Acquisition batch': 'categorical', 'Assay data location': 'categorical',
'Assay data name': 'categorical', 'Assay protocol': 'categorical', 'AssayRole': 'categorical', 'Batch': 'categorical',
'Correction Batch': 'categorical', 'Dilution': 'continuous', 'Exclusion Details': 'categorical',
Expand Down
9 changes: 7 additions & 2 deletions nPYc/StudyDesigns/SOP/BrukerBI-LISA.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
"fileNamePattern":".*?results\\.xml$",
"externalID":[],
"rsdThreshold": 30,
"sampleMetadataNotExported":["Acqu Date", "Acqu Time", "Sample Type"],
"featureMetadataNotExported":["comment"],
"sampleMetadataNotExported" : ["AUNM", "BF1", "BYTORDP", "Computer", "File Path", "NC_proc", "NS", "O1",
"OFFSET", "OWNER", "P", "PROBHD", "PULPROG", "RG", "SF", "SFO1", "SI", "SW", "SW_p",
"TD", "XDIM", "Delta PPM", "ERETIC Integral","ERETIC Concentration (mM)",
"Line Width (Hz)", "Exclusion Details", "CalibrationFail", "LineWidthFail",
"WaterPeakFail", "SolventPeakFail", "BaselineFail", "Sample Base Name", "expno",
"Acqu Date", "Acqu Time", "Sample Type"],
"featureMetadataNotExported":["comment", "Exclusion Details"],
"analyticalMeasurements":{"Study" : "categorical", "Instrument" : "categorical", "Re-Run" : "categorical", "Suplemental Injections" : "categorical", "Matrix" : "categorical", "Well" : "categorical", "Plate" : "categorical", "Batch" : "categorical", "Dilution" : "continuous", "Measurement Date" : "date", "Measurement Time" : "date", "Acquired Time" : "date", "Run Order" : "continuous", "Correction Batch" : "categorical", "Assay data name": "categorical", "Assay data location": "categorical", "Sample position": "categorical", "Sample batch": "categorical", "Acquisition batch": "categorical", "Plot Sample Type": "categorical", "AssayRole": "categorical", "SampleType": "categorical", "Exclusion Details": "categorical", "Skipped": "categorical", "Assay protocol": "categorical"},
"excludeFromPlotting":["Sample File Name", "Sample Base Name", "Batch Termini", "Study Reference", "Long-Term Reference", "Method Reference", "Dilution Series", "Skipped", "Study Sample", "File Path", "Exclusion Details", "Assay protocol", "Status", "Measurement Date", "Measurement Time", "Data Present", "LIMS Present", "LIMS Marked Missing", "Assay data name", "Assay data location", "AssayRole", "SampleType", "Sample ID", "Plot Sample Type", "SubjectInfoData", "Detector Unit", "TargetLynx Sample ID", "MassLynx Row ID"],
"additionalQuantParamColumns":["LOD", "Lower Reference Percentile", "Lower Reference Value", "Upper Reference Percentile", "Upper Reference Value"]
Expand Down
9 changes: 7 additions & 2 deletions nPYc/StudyDesigns/SOP/BrukerBI-QUANT-PS.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
"fileNamePattern":".*?plasma_quant_report\\.xml$",
"externalID":[],
"rsdThreshold": 30,
"sampleMetadataNotExported":["Acqu Date", "Acqu Time", "Sample Type"],
"featureMetadataNotExported":["comment"],
"sampleMetadataNotExported" : ["AUNM", "BF1", "BYTORDP", "Computer", "File Path", "NC_proc", "NS", "O1",
"OFFSET", "OWNER", "P", "PROBHD", "PULPROG", "RG", "SF", "SFO1", "SI", "SW", "SW_p",
"TD", "XDIM", "Delta PPM", "ERETIC Integral","ERETIC Concentration (mM)",
"Line Width (Hz)", "Exclusion Details", "CalibrationFail", "LineWidthFail",
"WaterPeakFail", "SolventPeakFail", "BaselineFail", "Sample Base Name", "expno",
"Acqu Date", "Acqu Time", "Sample Type"],
"featureMetadataNotExported":["comment", "Exclusion Details"],
"analyticalMeasurements":{"Study" : "categorical", "Instrument" : "categorical", "Re-Run" : "categorical", "Suplemental Injections" : "categorical", "Matrix" : "categorical", "Well" : "categorical", "Plate" : "categorical", "Batch" : "categorical", "Dilution" : "continuous", "Measurement Date" : "date", "Measurement Time" : "date", "Acquired Time" : "date", "Run Order" : "continuous", "Correction Batch" : "categorical", "Assay data name": "categorical", "Assay data location": "categorical", "Sample position": "categorical", "Sample batch": "categorical", "Acquisition batch": "categorical", "Plot Sample Type": "categorical", "AssayRole": "categorical", "SampleType": "categorical", "Exclusion Details": "categorical", "Skipped": "categorical", "Assay protocol": "categorical"},
"excludeFromPlotting":["Sample File Name", "Sample Base Name", "Batch Termini", "Study Reference", "Long-Term Reference", "Method Reference", "Dilution Series", "Skipped", "Study Sample", "File Path", "Exclusion Details", "Assay protocol", "Status", "Measurement Date", "Measurement Time", "Data Present", "LIMS Present", "LIMS Marked Missing", "Assay data name", "Assay data location", "AssayRole", "SampleType", "Sample ID", "Plot Sample Type", "SubjectInfoData", "Detector Unit", "TargetLynx Sample ID", "MassLynx Row ID"],
"additionalQuantParamColumns":["LOD", "Lower Reference Percentile", "Lower Reference Value", "Upper Reference Percentile", "Upper Reference Value"]
Expand Down
9 changes: 7 additions & 2 deletions nPYc/StudyDesigns/SOP/BrukerQuant-UR.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
"fileNamePattern":".*?urine_quant_report_b\\.xml$",
"externalID":[],
"rsdThreshold": 30,
"sampleMetadataNotExported":["Acqu Date", "Acqu Time", "Sample Type"],
"featureMetadataNotExported":["comment"],
"sampleMetadataNotExported" : ["AUNM", "BF1", "BYTORDP", "Computer", "File Path", "NC_proc", "NS", "O1",
"OFFSET", "OWNER", "P", "PROBHD", "PULPROG", "RG", "SF", "SFO1", "SI", "SW", "SW_p",
"TD", "XDIM", "Delta PPM", "ERETIC Integral","ERETIC Concentration (mM)",
"Line Width (Hz)", "Exclusion Details", "CalibrationFail", "LineWidthFail",
"WaterPeakFail", "SolventPeakFail", "BaselineFail", "Sample Base Name", "expno",
"Acqu Date", "Acqu Time", "Sample Type"],
"featureMetadataNotExported":["comment", "Exclusion Details"],
"analyticalMeasurements":{"Study" : "categorical", "Instrument" : "categorical", "Re-Run" : "categorical", "Suplemental Injections" : "categorical", "Matrix" : "categorical", "Well" : "categorical", "Plate" : "categorical", "Batch" : "categorical", "Dilution" : "continuous", "Measurement Date" : "date", "Measurement Time" : "date", "Acquired Time" : "date", "Run Order" : "continuous", "Correction Batch" : "categorical", "Assay data name": "categorical", "Assay data location": "categorical", "Sample position": "categorical", "Sample batch": "categorical", "Acquisition batch": "categorical", "Plot Sample Type": "categorical", "AssayRole": "categorical", "SampleType": "categorical", "Exclusion Details": "categorical", "Skipped": "categorical", "Assay protocol": "categorical"},
"excludeFromPlotting":["Sample File Name", "Sample Base Name", "Batch Termini", "Study Reference", "Long-Term Reference", "Method Reference", "Dilution Series", "Skipped", "Study Sample", "File Path", "Exclusion Details", "Assay protocol", "Status", "Measurement Date", "Measurement Time", "Data Present", "LIMS Present", "LIMS Marked Missing", "Assay data name", "Assay data location", "AssayRole", "SampleType", "Sample ID", "Plot Sample Type", "SubjectInfoData", "Detector Unit", "TargetLynx Sample ID", "MassLynx Row ID"],
"additionalQuantParamColumns":["LOD", "Lower Reference Percentile", "Lower Reference Value", "Upper Reference Percentile", "Upper Reference Value"]
Expand Down
8 changes: 4 additions & 4 deletions nPYc/StudyDesigns/SOP/GenericNMRurine.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"Long-Term Reference", "Study Sample", "Status", "Exclusion Details", "LIMS Present", "LIMS Marked Missing",
"path", "Assay data name", "Assay data location", "Assay protocol", "titleFileContent", "SF"],
"sampleMetadataNotExported" : ["AUNM", "BF1", "BYTORDP", "Computer", "File Path", "NC_proc", "NS", "O1",
"OFFSET", "OWNER", "P", "PROBHD", "PULPROG", "RG", "SF", "SFO1", "SI", "SW", "SW_p",
"OFFSET", "OWNER", "P", "PROBHD", "PULPROG", "RG", "SF", "SFO1", "SI", "SW", "SW_p",
"TD", "XDIM", "Delta PPM", "ERETIC Integral","ERETIC Concentration (mM)",
"Line Width (Hz)", "Exclusion Details", "CalibrationFail", "LineWidthFail",
"WaterPeakFail", "BaselineFail", "Sample Base Name", "expno"],
"featureMetadataNotExported":[]
"Line Width (Hz)", "Exclusion Details", "CalibrationFail", "LineWidthFail",
"WaterPeakFail", "SolventPeakFail", "BaselineFail", "Sample Base Name", "expno"],
"featureMetadataNotExported": ["Exclusion Details"]
}
4 changes: 4 additions & 0 deletions nPYc/reports/_finalReportPeakPantheR.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ def _finalReportPeakPantheR(dataset, destinationPath=None):
if hasattr(sampleSummary['Acquired'], 'Already Excluded'):
sampleSummary['Acquired'].rename(columns={'Already Excluded': 'Excluded'}, inplace=True)

# Drop rows where no samples present for that datatype
sampleSummary['Acquired'].drop(sampleSummary['Acquired'].index[sampleSummary['Acquired']['Total'].values == 0],
axis=0, inplace=True)

sampleSummary['isFinalReport'] = True
if 'StudySamples Exclusion Details' in sampleSummary:
sampleSummary['studySamplesExcluded'] = True
Expand Down
4 changes: 4 additions & 0 deletions nPYc/reports/_generateReportMS.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ def _finalReport(dataset, destinationPath=None, pcaModel=None, reportType='final
# Tidy table for final report format
sampleSummary['Acquired'].drop('Marked for Exclusion', inplace=True, axis=1)

# Drop rows where no samples present for that datatype
sampleSummary['Acquired'].drop(sampleSummary['Acquired'].index[sampleSummary['Acquired']['Total'].values == 0],
axis=0, inplace=True)

sampleSummary['isFinalReport'] = True
if 'StudySamples Exclusion Details' in sampleSummary:
sampleSummary['studySamplesExcluded'] = True
Expand Down
3 changes: 3 additions & 0 deletions nPYc/reports/_generateReportNMR.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ def _finalReport(dataset, destinationPath=None, pcaModel=None):
# Tidy table for final report format
sampleSummary['Acquired'].drop('Marked for Exclusion', inplace=True, axis=1)

# Drop rows where no samples present for that datatype
sampleSummary['Acquired'].drop(sampleSummary['Acquired'].index[sampleSummary['Acquired']['Total'].values == 0], axis=0, inplace=True)

sampleSummary['isFinalReport'] = True
if 'StudySamples Exclusion Details' in sampleSummary:
sampleSummary['studySamplesExcluded'] = True
Expand Down
6 changes: 6 additions & 0 deletions nPYc/reports/_generateReportTargeted.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,9 @@ def _finalReportMS(tData, item, destinationPath, pcaModel=None, withAccPrec=True
# Tidy table for final report format
sampleSummary['Acquired'].drop('Marked for Exclusion', inplace=True, axis=1)

# Drop rows where no samples present for that datatype
sampleSummary['Acquired'].drop(sampleSummary['Acquired'].index[sampleSummary['Acquired']['Total'].values == 0], axis=0, inplace=True)

sampleSummary['isFinalReport'] = True
if 'StudySamples Exclusion Details' in sampleSummary:
sampleSummary['studySamplesExcluded'] = True
Expand Down Expand Up @@ -864,6 +867,9 @@ def _finalReportNMR(tData, item, destinationPath, pcaModel=None, withAccPrec=Tru
# Tidy table for final report format
sampleSummary['Acquired'].drop('Marked for Exclusion', inplace=True, axis=1)

# Drop rows where no samples present for that datatype
sampleSummary['Acquired'].drop(sampleSummary['Acquired'].index[sampleSummary['Acquired']['Total'].values == 0], axis=0, inplace=True)

sampleSummary['isFinalReport'] = True
if 'StudySamples Exclusion Details' in sampleSummary:
sampleSummary['studySamplesExcluded'] = True
Expand Down

0 comments on commit 46423b7

Please sign in to comment.