-
Notifications
You must be signed in to change notification settings - Fork 128
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 subsampling command with YAML config, basic weighted sampling #1444
Closed
Conversation
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
Lots of TODOs and nothing is actually _run_, but the config parsing and general structure is working
Priorities not working
For subsampling purposes we want to take the n closest strains _per focal sequence_, rather than computing the smallest hamming distance for each sample against any of the focal seqs.
Useful for reproducibility in tests.
There is a related TODO there.
Benefits: 1. Improves distinction between samples and outputs. 2. Removes the need to restrict a sample from being named "outputs". 3. Makes it easier to add future subsampling options such as total size.
A logfile would be inaccessible if it lives under a temporary directory. As an alternative, the temporary directory could be kept around, but I don't think we want to complicate existing workflows by having another layer of log files one level lower than Snakemake's.
Global --include/--exclude are necessary to support ncov's config.files.include/exclude
12 tasks
Update: putting this on hold while weighted sampling is being implemented within |
victorlin
added
the
revisit sometime
Useful to address but no bandwidth at the moment
label
May 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This builds on @jameshadfield's initial prototype. PR is largely incomplete, but I've been working on this for a while and want to open for discussion on where to take things next.
A summary in the form of Q&A:
Q: Why add this command when
augur filter
already has sampling capabilities?A subsampling-specific command is meant to extend beyond the current capabilities of
augur filter
with a more intuitive config interface (YAML file instead of command line arguments). We and other users have hit this limitation on most pathogen workflows - the new command aims to replace the subsampling baked within the Snakemake logic of those workflows.Q: What do you mean by basic weighted sampling?
Basic weighted sampling allows defining a top-level sample size and a list of intermediate samples with weights on how to distribute the sample size. It is inspired by the ncov workflow's subsampling schemes each having a target total size and intermediate sample weights (but only intermediate sample sizes can be encoded in the config schema).
This is maybe the simplest new feature that is enabled by the shift to a YAML config.
Q: What is an intermediate sample?
With the PR's implementation, it is an
augur filter
call much like how existing pathogen workflows make multipleaugur filter
calls and combine them using a final call.Q: What should I review in this PR?
Mostly looking for feedback on whether the config schema is intuitive, and if it seems flexible enough to future directions.
The PR's implementation is a bit hacky and leaves much to be desired (see "not in PR scope" section), but the shift to using YAML config should broaden the possibilities.
Q: What does the YAML config schema look like in practice?
See YAML configs from nextstrain/ncov#1102. There, I've tested that this new command can replace ncov's complex subsampling logic, so it should be straightforward to do the same in other pathogen workflows.
Not in PR scope
augur filter
to be called directly instead of through a subprocess. Once this is done, we should shift all subsampling-related development to this new command and only keep the subsampling-related options inaugur filter
around for backwards compatibility.Links