Skip to content

Commit

Permalink
fixup: docs for newreference behavior
Browse files Browse the repository at this point in the history
This is a fixup to an earlier commit:

8cd6a13

This updates the docs to reflect that the script will NOT just throw a warning, but actually error out
if the gene is not found in the GenBank file. This was flagged by comment:

nextstrain/dengue#47 (comment)
  • Loading branch information
j23414 committed May 8, 2024
1 parent a1788ce commit 335c7f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/newreference.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ def new_reference(referencefile, outgenbank, outfasta, gene):
startofgene = int(list(feature.location)[0])
endofgene = int(list(feature.location)[-1])+1

# If user provides a --gene 'some name' is not found, print a warning and use the entire genome.
# Otherwise do not print a warning.
# If user provides a --gene 'some name' that is not found, error out as this may indicate that
# the gene name is misspelled or the user may be using the wrong GenBank file.
if(gene is not None and startofgene is None and endofgene is None):
print(f"ERROR: No '{gene}' was found under 'gene' or 'CDS' features in the GenBank file.", file=sys.stderr)
sys.exit(1)
Expand Down

0 comments on commit 335c7f5

Please sign in to comment.