-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1278: filter: Remove attempt at extracting variab…
…les from --query
- Loading branch information
Showing
4 changed files
with
62 additions
and
36 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
26 changes: 26 additions & 0 deletions
26
tests/functional/filter/cram/filter-query-and-exclude-ambiguous-dates-by.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,26 @@ | ||
Setup | ||
|
||
$ source "$TESTDIR"/_setup.sh | ||
|
||
Create metadata TSV file for testing. | ||
|
||
$ cat >metadata.tsv <<~~ | ||
> strain date region | ||
> SEQ_1 2020 Asia | ||
> SEQ_2 2020 Asia | ||
> SEQ_3 2020 Asia | ||
> SEQ_4 2020 North America | ||
> ~~ | ||
|
||
Confirm that `--exclude-ambiguous-dates-by` works for all year only ambiguous dates. | ||
|
||
$ ${AUGUR} filter \ | ||
> --metadata metadata.tsv \ | ||
> --query 'region=="Asia"' \ | ||
> --exclude-ambiguous-dates-by any \ | ||
> --empty-output-reporting silent \ | ||
> --output-strains filtered_strains.txt | ||
4 strains were dropped during filtering | ||
\t1 of these were filtered out by the query: "region=="Asia"" (esc) | ||
\t3 of these were dropped because of their ambiguous date in any (esc) | ||
0 strains passed all filters |
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,24 @@ | ||
Setup | ||
|
||
$ source "$TESTDIR"/_setup.sh | ||
|
||
Create metadata file for testing. | ||
|
||
$ cat >metadata.tsv <<~~ | ||
> strain column | ||
> SEQ_1 value1 | ||
> SEQ_2 value2 | ||
> SEQ_3 value3 | ||
> ~~ | ||
|
||
'column' should be query-able using the `.str` accessor. | ||
|
||
$ ${AUGUR} filter \ | ||
> --metadata metadata.tsv \ | ||
> --query "column.str.startswith('value')" \ | ||
> --output-strains filtered_strains.txt > /dev/null | ||
|
||
$ sort filtered_strains.txt | ||
SEQ_1 | ||
SEQ_2 | ||
SEQ_3 |