Skip to content
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

Fix missing groups for included strains #1000

Merged
merged 1 commit into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions augur/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1547,6 +1547,11 @@ def run(args):
# during the first pass, but we want to minimize overall memory
# usage at the moment.
seq_keep = set(metadata.index.values) & valid_strains

# Prevent force-included strains from being considered in this
# second pass, as in the first pass.
seq_keep = seq_keep - all_sequences_to_include

group_by_strain, skipped_strains = get_groups_for_subsampling(
seq_keep,
metadata,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Setup

$ pushd "$TESTDIR" > /dev/null
$ source _setup.sh

Do not consider force-included strains for subsampling.
In this test, we force-include two old strains that are the only representatives of their month/year date group (December 2015).
We don't filter these strains, so they could be considered for subsampling, but Augur removes them from consideration because they have been force-included.

$ cat >$TMP/include_old_strains.txt <<~~
> PRVABC59
> COL/FLR_00008/2015
> ~~

$ ${AUGUR} filter \
> --metadata filter/data/metadata.tsv \
> --include $TMP/include_old_strains.txt \
> --group-by month year \
> --subsample-max-sequences 10 \
> --output-metadata $TMP/metadata-filtered.tsv > /dev/null
$ rm -f $TMP/metadata-filtered.tsv