Skip to content

Conversation

@tsibley
Copy link

@tsibley tsibley commented Oct 24, 2014

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 #34, #35, and #36 and so contains those commits as well. Only the last two commits on the branch are the ones specific to this PR.

Many options which required an argument were declared as taking an
optional argument.  The option handling loop, however, did not expect
optional arguments.  For example, passing "--qual-threshold 30" rather
than "--qual-threshold=30" or "-q 30" led to a segfault when atoi() was
passed NULL (optarg).  There were other affected options as well.

This commit correctly declares the required/optional/none status of
option arguments and matches that short-form option spec.

Presumably this was confusion between the entire option being optional
and the option's argument being optional.  The required option checking
is done outside of getopt.
This will help keep them in sync when updating options.
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).
A fixed window size provides a stricter control on average base
qualities for datasets with a wide range of read lengths.
This is a stricter version of --truncate-n which may use sequence
fragments up until the first N provided they pass the length filter.
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 closed this Feb 25, 2015
@tsibley tsibley deleted the looser-N-handling-v2 branch February 25, 2015 19:39
@tsibley
Copy link
Author

tsibley commented Feb 25, 2015

Closing this PR in favor of #41, which is updated to be based upon your new work and mine.

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.

1 participant