Fixes for https://github.com/sdrogers/vimms/issues/174. Also in general, this fix allows all controllers to dump their scans, their associated scan parameters, and any metadata we provide for that scan. Useful when we need to know which scan params produce which scans.
Changes:
When making an MS1 or MS2 scan, we can now pass an additional metadata field, e.g. below we store metadata from the target (t) and the adduct used to make this MS2 scan.
metadata = {}
if t.adduct is not None:
metadata['adduct'] = t.adduct
if t.metadata is not None:
metadata.update(t.metadata) # copy the rest of metadata from target
dda_scan_params = self.get_ms2_scan_params(t.mz, 1e3, precursor_scan_id, self.isolation_width, \
self.mz_tol, self.rt_tol)
self.mz_tol, self.rt_tol, metadata=metadata)
The metadata is not used for any computation. It is just stored as part of the scan_params object for that scan, so it can be dumped with the rest of the scan parameters.
Call the method dump_scans in the base controller to dump all scan information, including everything in the scan params as CSV format, e.g. for printing
controller.dump_scans(print)
You can also dump to file by passing a suitable function to dump_scans, e.g.
def csv_to_file(output):
with open(fname, 'a') as out:
out.write(output)
Example output from targeted controller: [simulated_targeted_std1_Positive_scans.zip](https://github.com/sdrogers/vimms/files/5277029/simulated_targeted_std1_Positive_scans.zip)
Fixes for https://github.com/sdrogers/vimms/issues/174. Also in general, this fix allows all controllers to dump their scans, their associated scan parameters, and any metadata we provide for that scan. Useful when we need to know which scan params produce which scans.
Changes:
When making an MS1 or MS2 scan, we can now pass an additional
metadata
field, e.g. below we store metadata from the target (t
) and the adduct used to make this MS2 scan.The metadata is not used for any computation. It is just stored as part of the scan_params object for that scan, so it can be dumped with the rest of the scan parameters.
Call the method
dump_scans
in the base controller to dump all scan information, including everything in the scan params as CSV format, e.g. for printingYou can also dump to file by passing a suitable function to
dump_scans
, e.g.fname = 'output.csv' controller.dump_scans(csv_to_file)