Skip to content

Conversation

@tsibley
Copy link

@tsibley tsibley commented Feb 25, 2015

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).

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.
@tsibley tsibley changed the title [4/4] -n / -N options: Only consider Ns between the sliding window cut sites [4/4] -n / -N options: Only consider Ns between the sliding window cut sites (+ tests!) Feb 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants