Skip to content

Commit

Permalink
fix SIRIUS annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
axelwalter committed Jun 18, 2024
1 parent 2f8d27b commit 24d3b1f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/python-tools/annotate-sirius.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ def get_params():
if file.exists():
df_tmp = pd.read_csv(file, sep="\t")
df_tmp["id"] = df_tmp["id"].apply(
lambda x: x.split("_")[3].split("-")[0]
)
for col in cols:
df[
f"{tool}_{result_directory.name}_{col.replace('NPC#', '').replace('ClassyFire#', '')}"
] = df[f"{result_directory.name}.mzML_IDs"].map(
df_tmp.set_index("id")[col].to_dict()
lambda x: x.split("_0_")[1].split("-")[0]
)
for col in cols:
df[
f"{tool}_{result_directory.name}_{col.replace('NPC#', '').replace('ClassyFire#', '')}"
] = df[f"{result_directory.name}.mzML_IDs"].map(
df_tmp.set_index("id")[col].to_dict()
)

df.to_parquet(params["in"][0])
df.to_csv(Path(params["in"][0]).with_suffix(".tsv"), sep="\t")

0 comments on commit 24d3b1f

Please sign in to comment.