From ae5b717a1991ba0f9f5cff8f25590341edd41d31 Mon Sep 17 00:00:00 2001 From: Sean Colby Date: Tue, 11 Jun 2024 15:09:36 -0700 Subject: [PATCH] Handle nans for missing calibrant ions --- deimos/calibration.py | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/deimos/calibration.py b/deimos/calibration.py index ce54a6c..80ff771 100644 --- a/deimos/calibration.py +++ b/deimos/calibration.py @@ -17,13 +17,24 @@ 1221.990636, 1521.971475, ], - "ccs": [121.3, 153.7, 203, 243.6, 282.2, 317], + "ccs": [121.30, 153.73, 202.96, 243.64, 282.20, 316.96], "q": [1, 1, 1, 1, 1, 1], }, "neg": { - "mz": [301.998139, 601.978977, 1033.988109, 1333.968947, 1633.949786], - "ccs": [140, 180.8, 255.3, 284.8, 319], - "q": [1, 1, 1, 1, 1, 1], + "mz": [ + # 112.985587, + 301.998139, + 601.978977, + 1033.988109, + 1333.968947, + 1633.949786, + ], + "ccs": [ + # 108.23, + 140.04, 180.77, 255.34, 284.76, 319.03], + "q": [ + # 1, + 1, 1, 1, 1, 1], }, } @@ -301,7 +312,7 @@ def calibrate_ccs( def tunemix( features, mz=[112.985587, 301.998139, 601.978977, 1033.988109, 1333.968947, 1633.949786], - ccs=[108.4, 139.8, 179.9, 254.2, 283.6, 317.7], + ccs=[108.23, 140.04, 180.77, 255.34, 284.76, 319.03], q=[1, 1, 1, 1, 1, 1], buffer_mass=28.013, mz_tol=200e-6, @@ -487,6 +498,10 @@ def map_mz_to_ccs(mz, mode="pos", tol=15e-3): map_mz_to_ccs(x, mode=mode, tol=tol) for x in im_cal["theoretical"].values ] + # Drop missing + tof_cal = tof_cal.dropna(axis=0).reset_index(drop=True) + im_cal = im_cal.dropna(axis=0).reset_index(drop=True) + return tof_cal, im_cal