-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[utils] only allow GFFs with one record
Also catches the edge case where a GFF has no valid rows. The printed error messages should be helpful enough to identify the GFF formatting error(s).
- Loading branch information
1 parent
d03ce41
commit 4b670f3
Showing
2 changed files
with
79 additions
and
27 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
Setup | ||
|
||
$ export AUGUR="${AUGUR:-$TESTDIR/../../../../bin/augur}" | ||
$ export SCRIPTS="$TESTDIR/../../../../scripts" | ||
$ export ANC_DATA="$TESTDIR/../../ancestral/data/simple-genome" | ||
$ export DATA="$TESTDIR/../data/simple-genome" | ||
|
||
These tests are intended to test variants of GFF formatting | ||
|
||
|
||
GFF file with no valid rows | ||
|
||
$ head -n 3 $DATA/reference.source.gff > "reference.empty.gff" | ||
|
||
$ ${AUGUR} translate \ | ||
> --tree $ANC_DATA/tree.nwk \ | ||
> --ancestral-sequences $ANC_DATA/nt_muts.ref-seq.json \ | ||
> --reference-sequence "reference.empty.gff" \ | ||
> --output-node-data "aa_muts.json" > /dev/null | ||
ERROR: Reference 'reference.empty.gff' contains no valid data rows. .+ (re) | ||
[2] | ||
|
||
GFF file with an extra record | ||
|
||
$ cp $DATA/reference.source.gff "reference.double.gff" | ||
|
||
$ echo -e "additional\tRefSeq\tsource\t1\t10\t.\t+\t.\tID=additional" >> "reference.double.gff" | ||
|
||
$ ${AUGUR} translate \ | ||
> --tree $ANC_DATA/tree.nwk \ | ||
> --ancestral-sequences $ANC_DATA/nt_muts.ref-seq.json \ | ||
> --reference-sequence "reference.double.gff" \ | ||
> --output-node-data "aa_muts.json" | ||
ERROR: Reference 'reference.double.gff' contains multiple seqids .+ (re) | ||
[2] |