Skip to content

Commit e3c0a18

Browse files
committed
Fix if CCS is directly in df
1 parent 10b7c32 commit e3c0a18

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

im2deep/calibration.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,11 @@ def get_charge(pf):
399399

400400
target_work["peptide_key"] = target_work["peptidoform"].apply(get_peptide_key)
401401
target_work["charge"] = target_work["peptidoform"].apply(get_charge)
402-
target_work["CCS"] = target_work["metadata"].apply(
403-
lambda x: x["CCS"] if "CCS" in x else np.nan
404-
)
402+
403+
if "CCS" not in target_work.columns and "metadata" in target_work.columns:
404+
target_work["CCS"] = target_work["metadata"].apply(
405+
lambda x: x["CCS"] if "CCS" in x else np.nan
406+
)
405407

406408
source_work["peptide_key"] = source_work["peptidoform"].apply(get_peptide_key)
407409
source_work["charge"] = source_work["peptidoform"].apply(get_charge)

0 commit comments

Comments
 (0)