Skip to content

Commit

Permalink
extend samtool -F filter to remove supplementary reads before subsamp…
Browse files Browse the repository at this point in the history
…ling (for realignment)

add informational messages showing reads_count and calculated frac to log (stderr output)
  • Loading branch information
dozy committed Mar 4, 2020
1 parent 6ca9c1d commit 80ab4d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data/vtlib/subsample.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"use_STDOUT": true,
"cmd":[
"bash -c '",
{"subst_constructor":{"vals":["tmfs=\"", {"subst":"tag_metrics_files", "required":true}, "\""],"postproc":{"op":"concat","pad":""}}}, "; if [ ! -z \"${tmfs}\" ]; then for tag_metrics_file in ${tmfs}; do reads_count=`jq", {"subst":"jqkey", "ifnull":{"subst_constructor":{"vals":["'\"'\"'.reads_count.\"", {"subst":"s2_tag_index", "required":true}, "\"'\"'\"'"],"postproc":{"op":"concat","pad":""}}}}, "${tag_metrics_file}`; reads_count=`echo ${reads_count} | tr -cd [:digit:]`; reads_count_total=$((${reads_count_total}+${reads_count})); done; if [[ $reads_count_total -eq 0 ]]; then reads_count_total=1; fi; frac=`echo \"10000/${reads_count_total}\" | bc -l`; fi;",
{"subst_constructor":{"vals":["tmfs=\"", {"subst":"tag_metrics_files", "required":true}, "\""],"postproc":{"op":"concat","pad":""}}}, "; if [ ! -z \"${tmfs}\" ]; then for tag_metrics_file in ${tmfs}; do reads_count=`jq", {"subst":"jqkey", "ifnull":{"subst_constructor":{"vals":["'\"'\"'.reads_count.\"", {"subst":"s2_tag_index", "required":true}, "\"'\"'\"'"],"postproc":{"op":"concat","pad":""}}}}, "${tag_metrics_file}`; reads_count=`echo ${reads_count} | tr -cd [:digit:]`; reads_count_total=$((${reads_count_total}+${reads_count})); >&2 printf \"reads_count_total: %d\\n\" ${reads_count_total}; done; if [[ $reads_count_total -eq 0 ]]; then reads_count_total=1; fi; frac=`echo \"10000/${reads_count_total}\" | bc -l`; fi; >&2 printf \"frac: %0.2f\\n\" ${frac};",
"if [ ! -z $frac ]; then",
"samtools",
"view",
Expand All @@ -60,7 +60,7 @@
"use_STDOUT": true,
"cmd":[ "samtools",
"fastq",
"-F", "0x200",
"-F", "0xB00",
{"select":"s2_se_pe", "default":"pe", "select_range":[1], "cases":{
"pe":["-1", {"port":"ss_fq1", "direction":"out"},"-2", {"port":"ss_fq2", "direction":"out"}],
"se":["-0", {"port":"ss_fq1", "direction":"out"}]
Expand Down

0 comments on commit 80ab4d3

Please sign in to comment.