Skip to content

Commit

Permalink
added more info to output stats
Browse files Browse the repository at this point in the history
  • Loading branch information
najoshi committed Jul 26, 2014
1 parent 822f169 commit 7667f14
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/trim_paired.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ int paired_main(int argc, char *argv[]) {
int gzip_output = 0;
int combo_all=0;
int combo_s=0;
int total=0;

while (1) {
int option_index = 0;
Expand Down Expand Up @@ -375,6 +376,7 @@ int paired_main(int argc, char *argv[]) {

p1cut = sliding_window(fqrec1, qualtype, paired_length_threshold, paired_qual_threshold, no_fiveprime, trunc_n, debug);
p2cut = sliding_window(fqrec2, qualtype, paired_length_threshold, paired_qual_threshold, no_fiveprime, trunc_n, debug);
total += 2;

if (debug) printf("p1cut: %d,%d\n", p1cut->five_prime_cut, p1cut->three_prime_cut);
if (debug) printf("p2cut: %d,%d\n", p2cut->five_prime_cut, p2cut->three_prime_cut);
Expand Down Expand Up @@ -478,6 +480,9 @@ int paired_main(int argc, char *argv[]) {
}

if (!quiet) {
if (infn1 && infn2) fprintf(stdout, "\nPE forwrd file: %s\nPE reverse file: %s\n", infn1, infn2);
if (infnc) fprintf(stdout, "\nPE interleaved file: %s\n", infnc);
fprintf(stdout, "\nTotal input FastQ records: %d (%d pairs)\n", total, (total / 2));
fprintf(stdout, "\nFastQ paired records kept: %d (%d pairs)\n", kept_p, (kept_p / 2));
if (pec) fprintf(stdout, "FastQ single records kept: %d\n", (kept_s1 + kept_s2));
else fprintf(stdout, "FastQ single records kept: %d (from PE1: %d, from PE2: %d)\n", (kept_s1 + kept_s2), kept_s1, kept_s2);
Expand Down
4 changes: 3 additions & 1 deletion src/trim_single.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ int single_main(int argc, char *argv[]) {
int no_fiveprime = 0;
int trunc_n = 0;
int gzip_output = 0;
int total=0;

while (1) {
int option_index = 0;
Expand Down Expand Up @@ -192,6 +193,7 @@ int single_main(int argc, char *argv[]) {
while ((l = kseq_read(fqrec)) >= 0) {

p1cut = sliding_window(fqrec, qualtype, single_length_threshold, single_qual_threshold, no_fiveprime, trunc_n, debug);
total++;

if (debug) printf("P1cut: %d,%d\n", p1cut->five_prime_cut, p1cut->three_prime_cut);

Expand All @@ -215,7 +217,7 @@ int single_main(int argc, char *argv[]) {
free(p1cut);
}

if (!quiet) fprintf(stdout, "\nFastQ records kept: %d\nFastQ records discarded: %d\n\n", kept, discard);
if (!quiet) fprintf(stdout, "\nSE input file: %s\n\nTotal FastQ records: %d\nFastQ records kept: %d\nFastQ records discarded: %d\n\n", infn, total, kept, discard);

kseq_destroy(fqrec);
gzclose(se);
Expand Down

0 comments on commit 7667f14

Please sign in to comment.