-
Notifications
You must be signed in to change notification settings - Fork 97
[4/4] -n / -N options: Only consider Ns between the sliding window cut sites (+ tests!) #41
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
Open
tsibley
wants to merge
13
commits into
najoshi:master
Choose a base branch
from
MullinsLab:looser-N-handling
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or 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
Standardizes on --truncate-n. This preserves the --trunc-n long name previously mentioned in the SE usage. It removes the --discard-n long name only ever used internally, but never documented.
This will help keep them in sync when updating options.
No functional change, only whitespace (compare with git diff -w).
The usage docs now indicate option arguments and are easier to read. If the usage was specifically requested with --help, then it is printed to stdout instead of stderr. This is useful for the common idiom of asking for help and piping to a pager like less or more (without redirecting stderr).
Silences warnings about //-style comments and long strings. Since kseq.h uses inline functions, a feature of C99, it's not useful pretending to be C89 compat (GCC's default).
This is a stricter version of --truncate-n which may use sequence fragments up until the first N provided they pass the length filter.
A fixed window size provides a stricter control on average base qualities for datasets with a wide range of read lengths.
Conflicts: src/sickle.h src/sliding.c src/trim_paired.c src/trim_single.c I adjusted the files above so that they would merge nicely with the changes added by the fixed-window branch. The lines affected were the short option specs and calls into sliding_window().
Otherwise Ns that might otherwise be trimmed off will cause unnecessary read dropping. For example using --truncate-n, if an N occurs early in the sequence, it's possible for the 3' cut site to be set closer to the 5' end than the 5' cut site, which results in a dropped read due to negative length.
Perl's testing infrastructure is mature, well proven, and easy to extend. I've listed all the dependencies for completeness in test/cpanfile, used by `make install-test-deps`, but only one dep (Capture::Tiny) is not distributed with core Perl.
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.
Otherwise Ns that might otherwise be trimmed off will cause unnecessary read dropping. For example using
--truncate-n, if an N occurs early in the sequence, it's possible for the 3' cut site to be set closer to the 5' end than the 5' cut site, which results in a dropped read due to negative length.Note: this depends on my previous PRs #40, #35, and #36 and so contains those branches merged in as well. Only the last two commits on the branch are the ones specific to this PR.
This PR slightly changes the N handling (I believe for the better) and also adds a very basic automated test suite for the changes. Note that there GNU autotools is not used.
@najoshi I've tagged my four PRs as one through four since they build upon each other. If you wanted to merge them all in one shot, you'd just need to merge this PR. If you want to merge them individually, you should merge them in numbered order, though you'll have to resolve some conflicts between 2 and 3 yourself (which I've done already in this PR).