CSM Import Raw NMR Class.
Import NMR experiment into csm_nmr_spectra objects. Optionally Run QC checks.
Leave arguments blank for pop-up selection boxes.
experimentInfo is a struct containing paths to the required files; the NMR Experiment Info file, the NMR Calibration Info file, and the Sample Metadata file.
These files are .xls files containing the data for import, ie, the path to the experiment folder, the calibration type, and extra sample metadata.
NMR Experiment Info template:
Sample ID, Experiment Number, Experiment Folder, Rack, Rack Position, Instrument, Acquisition Batch
NMR Calibration Info template:
Sample ID, Sample Type, Calibration Type, Calibration Ref Point, Calibration Search Min, Calibration Search Max
Sample Metadata template example:
Sample ID, Case/control, gender, age, etc
Will only import 1 pdata folder, as for small molecules this is all that is required.
Spectra objects are contained in the relevant map properties and are grouped by sample_type, ie 'plasma'.
eg. cpmg_plasma = imported.cpmg('plasma');
oneDWS_urine = imported.oneDWS('urine');
diffEdited_serum = imported.diffEdited('serum');
jres_plasma = imported.plasma('plasma');
Errors are saved to file, and can be found into the importErrors map using the same syntax as above.
imported_experiment = csm_import_raw_nmr()
imported_experiment = csm_import_raw_nmr( 'experiment_info', experiment_info, 'line_width_qc',line_width_qc, 'save_dir', save_dir, 'spectra_size', spectra_size, 'spectra_bounds', spectra_bounds, 'spectra_size_2D', spectra_size_2D, 'spectra_bounds_2D', spectra_bounds_2D, 'LW_peak', LW_peak 'LW_threshold', LW_threshold )
Variable | Type | Default Value | Description |
---|---|---|---|
experiment_info | struct | None | Structure for holding experimental information. |
experiment_info.experiment_path | str | None | Full path to experiment folder. |
experiment_info.nmr_experiment_info_path | str | None | Full path to nmr experiment info csv file. |
experiment_info.nmr_calibration_info_path | str | None | Full path to the nmr calibration info path. |
experiment_info.sample_metadata_path | str | None | Full path to sample metadata csv file. |
line_width_qc | bool | true. | Whether to run the LW QC |
save_dir | str | 'current working directory'+'_import_data'. | Full path of output dir |
spectra_size | 1*1 | 20000. | Number of points of ppm |
spectra_bounds | 1*2 | [-1 10]. | Range of ppm (min and max) |
spectra_size_2D | 1*1 | 20000. | Number of points of 2D ppm |
spectra_bounds_2D | 1*2 | [-1 10]. | Range of 2D ppm (min and max) |
LW_peak | str | 'TSP'. | Which peak to use for LW calc, uses 'lactate' for plasma and 'TSP' for urine |
LW_threshold | 1*1 | 1.4. | Linewidth threshold |
Variable | Type | Description |
---|---|---|
experiment_path | str | Full path to experiment. |
sample_metadata_path | str | Full path to sample metadata file. |
nmr_experiment_info_path | str | Full path to NMR experiment file. |
nmr_calibration_info_path | str | Full path to NMR calibration file. |
save_dir | str | Full path to save directory. |
log_file | str | Full path to log file. |
imported_bruker_metadata | csm_import_bruker_acquisition_data | Imported bruker acquisition data. |
imported_sample_metadata | csm_sample_metadata | Imported sample metadata. |
imported_nmr_calibration_info | csm_import_nmr_experiment_info | Imported NMR experiment info. |
imported_nmr_experiment_info | csm_import_nmr_calibration_info | Imported NMR calibration info. |
raw_spectra | containers.Map | Container of raw spectra. |
missing_bruker_experiments | cell | Missing bruker experiment data. |
missing_nmr_experiment_info | cell | Missing NMR experiment data. |
missing_nmr_calibration_info | cell | Missing NMR calibration data. |
missing_samples_in_spectra | cell | Missing samples in spectra data. |
missing_sample_metadata | cell | Missing sample metadata. |
exceptions | cell | Exceptions from import. |
spectrometer_frequency | 1*1 | The spectratrometer Frequency. |
spectra_size | 1*1 | Calculated size of the spectra. |
spectra_bounds | 1*2 | Upper and lower limits of the spectra. |
spectra_resolution | 1*1 | Resolution of the spectra. |
ppm_common | 1*n | PPM common scale. |
spectra_size_2D | 1*1 | Calculated size of the JRES 2D spectra. |
spectra_bounds_2D | 1*2 | 2D Upper and lower limits of the JRES 2D spectra. |
spectra_resolution_2D | 1*1 | Resolution of the JRES 2D spectra. |
ppm_common_2D | 1*n | PPM common scale of JRES 2D spectra. |
LW_peak | 1*1 | Linewidth peak. |
LW_threshold | 1*1 | Linewidth threshold. |
pulse_programs | cell | Cell array of the imported pulse programs. |
import_failed | containers.Map | Container of failed imports. |
import_errors | containers.Map | Container of import errors. |
pulse_program_lookup | containers.Map | Pulse program short name lookup. |
sample_types | cell | Cell array of imported sample types. |
cpmg | containers.Map | Container of final CPMG spectra. |
oneDWS | containers.Map | Container of final 1D Water Suppressed spectra. |
diff_edited | containers.Map | Container of diffusion edited spectra. |
jres | containers.Map | Container of final JRES spectra. |
peak_width_output_cpmg | containers.Map | Container of QC output. |
peak_width_output_oneDWS | containers.Map | Container of QC output. |
peak_width_output_jres | containers.Map | Container of QC output. |
peak_width_output_diff_edited | containers.Map | Container of QC output. |
Copyright Imperial College London 2019