Skip to content

feat: added cauris mutations #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

boasvdp
Copy link
Contributor

@boasvdp boasvdp commented May 16, 2025

No description provided.

@boasvdp boasvdp requested a review from wolthuisr May 16, 2025 13:57
df_input[["type", "locus_tag", "mutation_name"]] = df_input["BCSQ"].str.split(

# split on comma to separate multiple entries on single line
df_input['BCSQ'] = df_input['BCSQ'].str.split(",")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sometimes bcftools csq outputs multiple aa changes on a single line, separated by a comma. This is now accounted for

# Get number of columns. Ususally 7 or 9 with the second to last containing aa mutation
# This differs per reference
nr_col = df_input_long["BCSQ"].str.split("|", expand=True).shape[1]
aa_mutation_col = nr_col -2
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assumption: aa mutation is listed in second to last column. This holds true for both reference genome annotations we use, but should be checked when implementing new reference genome annotations

@@ -190,7 +204,7 @@ def filter_for_known_mutations(
Dataframe with only known mutations
"""
df_known_mutations = df_resistance_with_impact_renamed[
df_resistance_with_impact_renamed["impact"].notnull()
df_resistance_with_impact_renamed["impact"].notnull() | df_resistance_with_impact_renamed["drug"].notnull()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also output a mutations as "known" if only the drug column has info, but impact column is empty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant