Skip to content

Commit 5e8be86

Browse files
committed
Improve error on edge case
Raise an error when there is no tr column.
1 parent ef71cbc commit 5e8be86

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ideeplc/data_initialize.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ def data_initialize(
5353
"CSV file must contain a 'modifications' column with peptide modifications."
5454
)
5555
raise ValueError("Missing 'modifications' column in the CSV file.")
56+
if 'tr' not in df.columns:
57+
LOGGER.error("CSV file must contain a 'tr' column with retention times.")
58+
raise ValueError("Missing 'tr' column in the CSV file.")
5659

5760
reformed_peptides = [
5861
reform_seq(seq, mod) for seq, mod in zip(df["seq"], df["modifications"])

0 commit comments

Comments
 (0)