Skip to content

Commit

Permalink
Merge pull request #1256: filter: Fix support for numerical IDs with …
Browse files Browse the repository at this point in the history
…both metadata and sequences
  • Loading branch information
victorlin committed Jul 10, 2023
2 parents a3146d7 + 7ff6a84 commit 5eae388
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Expand Up @@ -11,11 +11,13 @@

* parse: Fix a bug where `--fix-dates` was always applied, with a default of `--fix-dates=monthfirst`. Now, running without `--fix-dates` will leave dates as-is. [#1247][] (@victorlin)
* `augur.io.open_file`: Previously, the docs described a type restriction on `path_or_buffer` but it was not enforced. It has been updated to allow all I/O classes, and is enforced at run-time. [#1250][] (@victorlin)
* filter: Fix a bug where data files consisting of only numerical strain names would not work when both `--metadata` and `--sequences` are passed. [#1256][] (@victorlin)

[#1146]: https://github.com/nextstrain/augur/pull/1146
[#1240]: https://github.com/nextstrain/augur/pull/1240
[#1247]: https://github.com/nextstrain/augur/issues/1247
[#1250]: https://github.com/nextstrain/augur/pull/1250
[#1256]: https://github.com/nextstrain/augur/pull/1256

## 22.0.3 (14 June 2023)

Expand Down
1 change: 1 addition & 0 deletions augur/filter/_run.py
Expand Up @@ -65,6 +65,7 @@ def run(args):
sequence_index_path,
sep=SEQUENCE_INDEX_DELIMITER,
index_col=SEQUENCE_INDEX_ID_COLUMN,
dtype={SEQUENCE_INDEX_ID_COLUMN: "string"},
)

# Remove temporary index file, if it exists.
Expand Down
32 changes: 32 additions & 0 deletions tests/functional/filter/cram/filter-numerical-ids.t
@@ -0,0 +1,32 @@
Setup

$ source "$TESTDIR"/_setup.sh

Create a pair of files with numerical strain IDs.

$ cat >metadata.tsv <<~~
> strain col1
> 1 A
> 2 B
> 3 C
> ~~
$ cat >sequences.fasta <<~~
> >1
> AAAA
> >2
> AAAA
> >3
> AAAA
> ~~
Test that nothing is filtered out due to missing sequence data.
$ ${AUGUR} filter \
> --metadata metadata.tsv \
> --sequences sequences.fasta \
> --output-strains filtered_strains.txt \
> > /dev/null 2>&1
$ sort filtered_strains.txt
1
2
3

0 comments on commit 5eae388

Please sign in to comment.