Skip to content

Commit

Permalink
move initial collate step upstream (allows subssampling to be retaine…
Browse files Browse the repository at this point in the history
…d in realignment)
  • Loading branch information
dozy committed Mar 4, 2020
1 parent cfdaa9c commit c1a1865
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 45 deletions.
61 changes: 48 additions & 13 deletions data/vtlib/alignment_wtsi_stage2_template.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,39 @@
{
"id":"spatial_filter_stats",
"type":"OUTFILE",
"name":{"subst":"spatial_filter_stats", "required":true, "ifnull":{"subst_constructor":{"vals":[ {"subst":"outdatadir"}, "/", {"subst":"rpt"}, ".spatial_filter.stats" ], "postproc":{"op":"concat","pad":""}}}} },
"name":{"subst":"spatial_filter_stats", "required":true, "ifnull":{"subst_constructor":{"vals":[ {"subst":"outdatadir"}, "/", {"subst":"rpt"}, ".spatial_filter.stats" ], "postproc":{"op":"concat","pad":""}}}}
},
{
"id":"collate",
"type":"EXEC",
"use_STDIN": true,
"use_STDOUT": true,
"comment": "if realignment_switch is set to 1, will use samtools collate otherwise biobambam collate. Unless the collate_or_namesort parameter has been set directly",
"cmd":{
"select":"collate_or_namesort", "select_range":[1], "default":{"select":"realignment_switch", "select_range":[1], "default":0,"cases":["collate","stcollate"]},
"cases":{
"collate": ["bamcollate2", "collate=1", "level=0"],
"namesort": [
{"subst":"samtools_executable", "required":true, "ifnull":"samtools"}, "sort", "-n",
"-l", {"subst":"name_sort_compression","required":true,"ifnull":["0"]},
{"subst":"name_sort_mpt_flag","ifnull":{"subst_constructor":{"vals":["-m", {"subst":"coord_sort_mem_per_thread","required":false}]}}},
"--threads", {"subst":"name_sort_threads","required":true,"ifnull":4},
{"subst":"name_sort_extra_flags", "required":false},
"-"
],
"stcollate": [
{"subst":"samtools_executable", "required":true, "ifnull":"samtools"}, "collate", "-O",
"-l", {"subst":"stcollate_compression","required":true,"ifnull":["0"]},
{"subst":"stcollate_tfn_flag","ifnull":{"subst_constructor":{"vals":["-n", {"subst":"stcollate_tmpfilenum","required":false}]}}},
"--threads", {"subst":"stcollate_threads","required":true,"ifnull":4},
{"subst":"stcollate_extra_flags", "required":false},
"-",
{"subst":"stcollate_tmp_prefix", "required":false, "ifnull":"./coltmp"}
]
}
},
"comment":"ensure BAM records are gathered by template i.e. queryname"
},
{
"id":"subsample_fqc",
"type":"VTFILE",
Expand Down Expand Up @@ -155,20 +187,22 @@
]
}
]},
"--output",
{"packflag":[
{"port":"phix_bam_out","direction":"out"},
{"select":"no_target_alignment", "default":0, "select_range":[1],
"cases":[
[",", {"port":"target_bam_out","direction":"out"}],
[]
]
}
]},
[
"--output",
{"packflag":[
{"port":"phix_bam_out","direction":"out"},
{"select":"no_target_alignment", "default":0, "select_range":[1],
"cases":[
[",", {"port":"target_bam_out","direction":"out"}],
[]
]
}
]}
],
{"select":"no_target_alignment", "default":0, "select_range":[1],
"cases":[
[],
[ "-n", {"port":"target_bam_out","direction":"out"} ]
[ {"select":"realignment_switch", "default":0, "select_range":[1], "cases":[ "-n", "-o" ]}, {"port":"target_bam_out","direction":"out"} ]
]
},
"-m", {"port":"af_metrics","direction":"out"}
Expand Down Expand Up @@ -209,7 +243,8 @@
"edges":[
{ "id":"src_to_bc2", "from":"crammerge", "to":"spatial_filter" },
{ "id":"apply_filter_to_sfqc", "from":"spatial_filter:apply_stats", "to":"spatial_filter_stats" },
{ "id":"sf_to_bc2", "from":"spatial_filter", "to":"subsample_fqc" },
{ "id":"sf_to_collate", "from":"spatial_filter", "to":"collate" },
{ "id":"collate_to_ss", "from":"collate", "to":"subsample_fqc" },
{ "id":"ssfqc_to_tgtaln", "from":"subsample_fqc:straight_through1", "to":"target_alignment" },
{ "id":"target_alignment_to_alignment_filter", "from":"target_alignment:aligned_to_target", "to":"alignment_filter:target_bam_in" },
{ "id":"iab_to_alignment_filter", "from":"target_alignment:aligned_to_phix", "to":"alignment_filter:phix_bam_in" },
Expand Down
33 changes: 1 addition & 32 deletions data/vtlib/target_alignment.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"subgraph_io":{
"ports":{
"inputs":{
"_stdin_":"bamcollate2"
"_stdin_":"tee3"
},
"outputs":{
"aligned_to_target":"bam12auxmerge",
Expand Down Expand Up @@ -32,36 +32,6 @@
}
],
"nodes":[
{
"id":"bamcollate2",
"type":"EXEC",
"use_STDIN": true,
"use_STDOUT": true,
"comment": "if realignment_switch is set to 1, will use samtools collate otherwise biobambam collate. Unless the collate_or_namesort parameter has been set directly",
"cmd":{
"select":"collate_or_namesort", "select_range":[1], "default":{"select":"realignment_switch", "select_range":[1], "default":0,"cases":["collate","stcollate"]},
"cases":{
"collate": ["bamcollate2", "collate=1", "level=0"],
"namesort": [
{"subst":"samtools_executable", "required":true, "ifnull":"samtools"}, "sort", "-n",
"-l", {"subst":"name_sort_compression","required":true,"ifnull":["0"]},
{"subst":"name_sort_mpt_flag","ifnull":{"subst_constructor":{"vals":["-m", {"subst":"coord_sort_mem_per_thread","required":false}]}}},
"--threads", {"subst":"name_sort_threads","required":true,"ifnull":4},
{"subst":"name_sort_extra_flags", "required":false},
"-"
],
"stcollate": [
{"subst":"samtools_executable", "required":true, "ifnull":"samtools"}, "collate", "-O",
"-l", {"subst":"stcollate_compression","required":true,"ifnull":["0"]},
{"subst":"stcollate_tfn_flag","ifnull":{"subst_constructor":{"vals":["-n", {"subst":"stcollate_tmpfilenum","required":false}]}}},
"--threads", {"subst":"stcollate_threads","required":true,"ifnull":4},
{"subst":"stcollate_extra_flags", "required":false},
"-"
]
}
},
"comment":"ensure BAM records are gathered by template i.e. queryname"
},
{
"id":"tee3",
"type":"VTFILE",
Expand Down Expand Up @@ -186,7 +156,6 @@
}
],
"edges":[
{ "id":"bc2_to_t3", "from":"bamcollate2", "to":"tee3" },
{ "id":"phixaln_to_amp", "from":"tee3:amp", "to":"auxmerge_prep" },
{ "id":"amp_to_auxmrg", "from":"auxmerge_prep", "to":"bam12auxmerge:no_aln_bam" },
{ "id":"tgtaln_to_prealn", "from":"tee3:prealn", "to":"pre_alignment" },
Expand Down

0 comments on commit c1a1865

Please sign in to comment.