From b2bb786038006e4a56d6821425d4e3f8228376bf Mon Sep 17 00:00:00 2001 From: Kevin Lewis Date: Thu, 8 Feb 2024 16:48:41 +0000 Subject: [PATCH] first try at adding stage2 preprocessing options --- .../vtlib/alignment_wtsi_stage2_template.json | 29 ++++++-------- data/vtlib/crammerge.json | 40 +++++++++++++++++++ 2 files changed, 52 insertions(+), 17 deletions(-) create mode 100644 data/vtlib/crammerge.json diff --git a/data/vtlib/alignment_wtsi_stage2_template.json b/data/vtlib/alignment_wtsi_stage2_template.json index 306b4f649..e623f5a22 100644 --- a/data/vtlib/alignment_wtsi_stage2_template.json +++ b/data/vtlib/alignment_wtsi_stage2_template.json @@ -95,24 +95,19 @@ ], "nodes":[ { - "id":"crammerge", - "type":"EXEC", - "use_STDIN": false, - "use_STDOUT": true, - "cmd": [ - "samtools", - "merge", - "-n", - "-O", "BAM", - "-l", "0", - {"select":"s2_input_format", "default":"cram", "select_range":[1], "cases":{ - "cram":["--input-fmt-option", "no_ref=1"], - "bam":["--input-fmt", "bam"] + "id":"preprocess_inputs", + "type":"VTFILE", + "name":{"subst":"s2_preprocess_inputs_method", "required":true, + "ifnull":{ + "select":"s2_ppi_switch", "default":"crammerge","select_range":[1], + "cases":{ + "crammerge":"crammerge.json", + "aviti":"elembio_nanoseq_2_pi.json"} }}, - "-", - {"subst":"incrams"} - ], - "description":"merge individual cram files from a sample into one bam file" + "subst_map":{"input_format":{"subst":"s2_input_format"}}, + "comment":"inputs: NONE; outputs: _stdout_ (bam), subst_map_parameters:[input_format]", + "node_prefix":"ppi_", + "description":"subgraph to preprocess inputs. Default: merge individual cram files from a sample into one bam file" }, { "id":"spatial_filter", diff --git a/data/vtlib/crammerge.json b/data/vtlib/crammerge.json new file mode 100644 index 000000000..3eeca9a51 --- /dev/null +++ b/data/vtlib/crammerge.json @@ -0,0 +1,40 @@ +{ +"version":"2.0", +"description":"run bwa mem to to align input bam to supplied reference genome", +"subgraph_io":{ + "ports":{ + "inputs":{ + }, + "outputs":{ + "_stdout_":"crammerge" + } + } +}, +"subst_params":[], +"nodes":[ + { + "id":"crammerge", + "type":"EXEC", + "use_STDIN": false, + "use_STDOUT": true, + "cmd": [ + "samtools", + "merge", + "-n", + "-O", "BAM", + "-l", "0", + {"select":"input_format", "default":"cram", "select_range":[1], "cases":{ + "cram":["--input-fmt-option", "no_ref=1"], + "bam":["--input-fmt", "bam"] + }}, + "-", + {"subst":"incrams", "required":true} + ], + "description":"merge individual cram files from a sample into one bam file" + } +], +"edges":[ + { "id":"bamtofastq_to_int_fq", "from":"bamtofastq", "to":"bwa_mem:fq" }, + { "id":"bwa_mem_to_s2b", "from":"bwa_mem", "to":"samtobam" } +] +}