Skip to content
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

[translate] GFF files parsed differently if --genes supplied #1349

Closed
jameshadfield opened this issue Dec 4, 2023 · 0 comments · Fixed by #1351
Closed

[translate] GFF files parsed differently if --genes supplied #1349

jameshadfield opened this issue Dec 4, 2023 · 0 comments · Fixed by #1351
Assignees
Labels
bug Something isn't working

Comments

@jameshadfield
Copy link
Member

Current Behaviour

The code behaves differently if feature_names is supplied (via the --genes argument).

augur/augur/utils.py

Lines 165 to 180 in 7cb3848

if feature_names is not None:
if "gene" in feat.qualifiers and feat.qualifiers["gene"][0] in feature_names:
fname = feat.qualifiers["gene"][0]
elif "gene_name" in feat.qualifiers and feat.qualifiers["gene_name"][0] in feature_names:
fname = feat.qualifiers["gene_name"][0]
elif "locus_tag" in feat.qualifiers and feat.qualifiers["locus_tag"][0] in feature_names:
fname = feat.qualifiers["locus_tag"][0]
else:
fname = None
else:
if "gene" in feat.qualifiers:
fname = feat.qualifiers["gene"][0]
elif "gene_name" in feat.qualifiers:
fname = feat.qualifiers["gene_name"][0]
else:
fname = feat.qualifiers["locus_tag"][0]

Specifically, the existence of one of {locus_tag, gene_name, gene} is required if --genes are not specified. This applies to the source entry as well.

Expected behavior

--genes should only perform filtering of features, not change how they are parsed.

@jameshadfield jameshadfield added the bug Something isn't working label Dec 4, 2023
@jameshadfield jameshadfield self-assigned this Dec 4, 2023
jameshadfield added a commit that referenced this issue Dec 5, 2023
TODO: Update CHANGES.md with PR number

See comment added in code which details the previous behaviour. While
silently skipping genes without the necessary attributes isn't the best
solution in my opinion, it's at least now consistent (and also
consistent with how we handle GenBank parsing).

Closes #1349
jameshadfield added a commit that referenced this issue Dec 5, 2023
See comment added in code which details the previous behaviour. While
silently skipping genes without the necessary attributes isn't the best
solution in my opinion, it's at least now consistent (and also
consistent with how we handle GenBank parsing).

Closes #1349
jameshadfield added a commit that referenced this issue Dec 5, 2023
See comment added in code which details the previous behaviour. While
silently skipping genes without the necessary attributes isn't the best
solution in my opinion, it's at least now consistent (and also
consistent with how we handle GenBank parsing).

Closes #1349
jameshadfield added a commit that referenced this issue Dec 11, 2023
See comment added in code which details the previous behaviour. While
silently skipping genes without the necessary attributes isn't the best
solution in my opinion, it's at least now consistent (and also
consistent with how we handle GenBank parsing).

Closes #1349
jameshadfield added a commit that referenced this issue Dec 20, 2023
See comment added in code which details the previous behaviour. While
silently skipping genes without the necessary attributes isn't the best
solution in my opinion, it's at least now consistent (and also
consistent with how we handle GenBank parsing).

Closes #1349
jameshadfield added a commit that referenced this issue Dec 20, 2023
See comment added in code which details the previous behaviour. While
silently skipping genes without the necessary attributes isn't the best
solution in my opinion, it's at least now consistent (and also
consistent with how we handle GenBank parsing).

Closes #1349
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant