Skip to content

Commit

Permalink
fix: typo in awk & print npassed
Browse files Browse the repository at this point in the history
  • Loading branch information
kelly-sovacool committed Dec 2, 2024
1 parent 39f17b2 commit 82a4d4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion workflow/rules/paired-end.smk
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ rule trim_pe:
-j {threads} -o {output.out1} -p {output.out2} \
{input.file1} {input.file2} \
> {log.stdout} 2> {log.stderr}
npassed=$(grep "passing filters" {log.stdout} | awk '{{print $1}}' | sed -s 's/,//g')
npassed=$(grep "passing filters" {log.stdout} | awk '{{print $5}}' | sed -s 's/,//g')
echo "number of reads passing filters: $npassed"
if [ $npassed -lt {params.min_reads} ]; then
echo "ERROR: too few reads are left after trimming."
exit 1
Expand Down
3 changes: 2 additions & 1 deletion workflow/rules/single-end.smk
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ rule trim_se:
-m {params.minlen} -b file:{params.fastawithadaptersetd} -j {threads} \
-o {output.outfq} {input.infq} \
> {log.stdout} 2> {log.stderr}
npassed=$(grep "passing filters" {log.stdout} | awk '{{print $1}}' | sed -s 's/,//g')
npassed=$(grep "passing filters" {log.stdout} | awk '{{print $5}}' | sed -s 's/,//g')
echo "number of reads passing filters: $npassed"
if [ $npassed -lt {params.min_reads} ]; then
echo "ERROR: too few reads are left after trimming."
exit 1
Expand Down

0 comments on commit 82a4d4b

Please sign in to comment.