Skip to content

Commit

Permalink
add --strict mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bjmt committed Jun 11, 2024
1 parent f66574b commit 98ec5d0
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 1 deletion.
6 changes: 6 additions & 0 deletions doc/quaqc.1
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,12 @@ Set \f[C]--use-nomate\f[R], \f[C]--use-dups\f[R],
This relaxes the filtering parameters, allowing a greater number of
reads to be counted for QC.
.TP
\f[B]--strict\f[R]
Set \f[C]--min-flen=50\f[R], \f[C]--max-flen=150\f[R], and
\f[C]--mapq=40\f[R].
This restricts the filtering parameters to keep only the highest quality
reads.
.TP
\f[B]--nfr\f[R]
Set \f[C]--no-se\f[R], \f[C]--max-flen=120\f[R], and
\f[C]--tss-tn5\f[R].
Expand Down
5 changes: 5 additions & 0 deletions doc/quaqc.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ accomplished using `samtools` in the following manner during alignment:
relaxes the filtering parameters, allowing a greater number of reads to be
counted for QC.

**\--strict**
: Set `--min-flen=50`, `--max-flen=150`, and `--mapq=40`. This
restricts the filtering parameters to keep only the highest quality
reads.

**\--nfr**
: Set `--no-se`, `--max-flen=120`, and `--tss-tn5`. These filters enrich for
reads found within nucleosome free regions (NFR), as well as shifting the
Expand Down
1 change: 1 addition & 0 deletions src/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ int init_json(const params_t *params) {
fjson_write(fjson, " \"fast_mode\": %s,\n", strbool(params->fast));
fjson_write(fjson, " \"low_mem_mode\": %s,\n", strbool(params->low_mem));
fjson_write(fjson, " \"lenient_mode\": %s,\n", strbool(params->lenient));
fjson_write(fjson, " \"strict_mode\": %s,\n", strbool(params->strict));
fjson_write(fjson, " \"nfr_mode\": %s,\n", strbool(params->nfr));
fjson_write(fjson, " \"nbr_mode\": %s,\n", strbool(params->nbr));
fjson_write(fjson, " \"footprint_mode\": %s,\n", strbool(params->footprint));
Expand Down
15 changes: 15 additions & 0 deletions src/quaqc.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ enum opts_enum {
TSS_QLEN,
TN5_SHIFT,
LENIENT,
STRICT,
NFR,
NBR,
NO_SE,
Expand Down Expand Up @@ -152,6 +153,7 @@ static struct option opts_long[] = {
{ "tss-tn5", no_argument, 0, TN5_SHIFT },
{ "use-all", no_argument, 0, USE_ALL },
{ "lenient", no_argument, 0, LENIENT },
{ "strict", no_argument, 0, STRICT },
{ "nfr", no_argument, 0, NFR },
{ "nbr", no_argument, 0, NBR },
{ "footprint", no_argument, 0, FOOTPRINT },
Expand Down Expand Up @@ -229,6 +231,7 @@ static void help(void) {
" -f, --fast --omit-gc --omit-depth (~15%% shorter runtime)\n"
/* " -L, --low-mem --max-depth=1 --max-qhist=1 --max-fhist=1 --tss-size=1\n" */ // hide for now
" --lenient --use-nomate --use-dups --use-dovetails --mapq=10\n"
" --strict --min-flen=50 --max-flen=150 --mapq=40\n"
" --nfr --no-se --max-flen=120 --tss-tn5\n"
" --nbr --no-se --min-flen=150 --max-flen=1000 --tss-qlen=0\n"
" --footprint --tss-qlen=1 --tss-size=501 --tss-tn5\n"
Expand Down Expand Up @@ -889,6 +892,12 @@ static int quaqc_main(int argc, char *argv[]) {
}
params->lenient = true;
break;
case STRICT:
if (params->strict) {
quit("--strict has already been set.");
}
params->strict = true;
break;
case NFR:
if (params->nfr) {
quit("--nfr has already been set.");
Expand Down Expand Up @@ -1067,6 +1076,12 @@ static int quaqc_main(int argc, char *argv[]) {
params->use_dovetail = true;
}

if (params->strict) {
params->flen_min = 50;
params->flen_max = 150;
params->mapq = 40;
}

if (params->nbr && params->nfr) {
quit("--nfr and --nbr cannot be set simultaneously.");
}
Expand Down
2 changes: 1 addition & 1 deletion src/quaqc.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ typedef struct params_t {
hts_pos_t qlen_min, flen_min, qlen_max, flen_max;
int threads, depth_max, qhist_max, fhist_max, tss_size, tss_qlen;
bool use_2nd, use_chi, use_nomate, use_dups, use_all;
bool lenient, nfr, nbr, use_dovetail;
bool lenient, strict, nfr, nbr, use_dovetail;
bool no_se, no_out, save, tn5_shift, omit_gc, omit_depth;
bool fast, qerr, v, vv, footprint, low_mem, chip;
} params_t;
Expand Down

0 comments on commit 98ec5d0

Please sign in to comment.