Skip to content

Commit

Permalink
Handle nans for missing calibrant ions
Browse files Browse the repository at this point in the history
  • Loading branch information
smcolby committed Jun 11, 2024
1 parent 93e24ad commit ae5b717
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions deimos/calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
},
}

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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


Expand Down

0 comments on commit ae5b717

Please sign in to comment.