-
Notifications
You must be signed in to change notification settings - Fork 130
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
Add support for Nextclade GFFs to augur translate #1017
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pushd "$TESTDIR/../../" > /dev/null | ||
export AUGUR="${AUGUR:-../../bin/augur}" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Setup | ||
|
||
$ pushd "$TESTDIR" > /dev/null | ||
$ source _setup.sh | ||
|
||
Translate amino acids for genes using a GenBank file. | ||
|
||
$ ${AUGUR} translate \ | ||
> --tree translate/data/zika/tree.nwk \ | ||
> --ancestral-sequences translate/data/zika/nt_muts.json \ | ||
> --reference-sequence translate/data/zika/zika_outgroup.gb \ | ||
> --genes CA PRO \ | ||
> --output-node-data $TMP/aa_muts.json | ||
Validating schema of 'translate/data/zika/nt_muts.json'... | ||
Read in 3 features from reference sequence file | ||
amino acid mutations written to .* (re) | ||
$ python3 "../../scripts/diff_jsons.py" translate/data/zika/aa_muts_genbank.json $TMP/aa_muts.json | ||
{} |
31 changes: 31 additions & 0 deletions
31
tests/functional/translate/cram/translate-with-gff-and-gene-name.t
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Setup | ||
|
||
$ pushd "$TESTDIR" > /dev/null | ||
$ source _setup.sh | ||
|
||
Translate amino acids for genes using a GFF3 file where the gene names are stored in a qualifier named "gene_name". | ||
|
||
$ cat >$TMP/genemap.gff <<~~ | ||
> ##gff-version 3 | ||
> ##sequence-region PF13/251013_18 1 10769 | ||
> PF13/251013_18 GenBank gene 91 456 . + . gene_name="CA" | ||
> PF13/251013_18 GenBank gene 457 735 . + . gene_name="PRO" | ||
> ~~ | ||
|
||
$ ${AUGUR} translate \ | ||
> --tree translate/data/zika/tree.nwk \ | ||
> --ancestral-sequences translate/data/zika/nt_muts.json \ | ||
> --reference-sequence "$TMP/genemap.gff" \ | ||
> --output-node-data $TMP/aa_muts.json | ||
Validating schema of 'translate/data/zika/nt_muts.json'... | ||
Read in 2 features from reference sequence file | ||
amino acid mutations written to .* (re) | ||
|
||
Other than the sequence ids which will include a temporary path, the JSONs | ||
should be identical. | ||
|
||
$ python3 "../../scripts/diff_jsons.py" \ | ||
> --exclude-regex-paths "['seqid']" -- \ | ||
> translate/data/zika/aa_muts_gff.json \ | ||
> $TMP/aa_muts.json | ||
{} |
27 changes: 27 additions & 0 deletions
27
tests/functional/translate/cram/translate-with-gff-and-gene.t
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Setup | ||
|
||
$ pushd "$TESTDIR" > /dev/null | ||
$ source _setup.sh | ||
|
||
Translate amino acids for genes using a GFF3 file where the gene names are stored in a qualifier named "gene". | ||
|
||
$ cat >$TMP/genemap.gff <<~~ | ||
> ##gff-version 3 | ||
> ##sequence-region PF13/251013_18 1 10769 | ||
> PF13/251013_18 GenBank gene 91 456 . + . gene="CA" | ||
> PF13/251013_18 GenBank gene 457 735 . + . gene="PRO" | ||
> ~~ | ||
|
||
$ ${AUGUR} translate \ | ||
> --tree translate/data/zika/tree.nwk \ | ||
> --ancestral-sequences translate/data/zika/nt_muts.json \ | ||
> --reference-sequence "$TMP/genemap.gff" \ | ||
> --output-node-data $TMP/aa_muts.json | ||
Validating schema of 'translate/data/zika/nt_muts.json'... | ||
Read in 2 features from reference sequence file | ||
amino acid mutations written to .* (re) | ||
$ python3 "../../scripts/diff_jsons.py" \ | ||
> --exclude-regex-paths "['seqid']" -- \ | ||
> translate/data/zika/aa_muts_gff.json \ | ||
> $TMP/aa_muts.json | ||
{} |
23 changes: 23 additions & 0 deletions
23
tests/functional/translate/cram/translate-with-gff-and-locus-tag.t
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Setup | ||
|
||
$ pushd "$TESTDIR" > /dev/null | ||
$ source _setup.sh | ||
|
||
Translate amino acids for genes using a GFF3 file where the gene names are stored in a qualifier named "locus_tag". | ||
|
||
$ ${AUGUR} translate \ | ||
> --tree translate/data/tb/tree.nwk \ | ||
> --genes translate/data/tb/genes.txt \ | ||
> --vcf-reference translate/data/tb/ref.fasta \ | ||
> --ancestral-sequences translate/data/tb/nt_muts.vcf \ | ||
> --reference-sequence translate/data/tb/Mtb_H37Rv_NCBI_Annot.gff \ | ||
> --output-node-data $TMP/aa_muts.json \ | ||
> --alignment-output $TMP/translations.vcf \ | ||
> --vcf-reference-output $TMP/translations_reference.fasta | ||
Gene length of rrs_Rvnr01 is not a multiple of 3. will pad with N | ||
Read in 187 specified genes to translate. | ||
Read in 187 features from reference sequence file | ||
162 genes had no mutations and so have been be excluded. | ||
amino acid mutations written to .* (re) | ||
$ python3 "../../scripts/diff_jsons.py" translate/data/tb/aa_muts.json $TMP/aa_muts.json | ||
{} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(non-blocking)
It would be nice to have just one of these files (the same as tests/functional/filter/cram/_setup.sh), but this is fine for now.