diff --git a/modules/tiddit/sv/main.nf b/modules/tiddit/sv/main.nf index cff3dbfb..d0d5362e 100644 --- a/modules/tiddit/sv/main.nf +++ b/modules/tiddit/sv/main.nf @@ -8,16 +8,15 @@ process TIDDIT_SV { 'quay.io/biocontainers/tiddit:3.0.0--py39h59fae87_1' }" input: - tuple val(meta), path(input) + tuple val(meta), path(input), path(index) path fasta path fai path bwa_index output: - tuple val(meta), path("*.vcf") , emit: vcf - tuple val(meta), path("*.ploidy.tab") , emit: ploidy - tuple val(meta), path("*.signals.tab"), emit: signals - path "versions.yml" , emit: versions + tuple val(meta), path("*.vcf") , emit: vcf + tuple val(meta), path("*.ploidies.tab"), emit: ploidy + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -27,7 +26,11 @@ process TIDDIT_SV { def prefix = task.ext.prefix ?: "${meta.id}" def reference = fasta ? "--ref $fasta" : "" """ - INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'` + for i in `ls ${bwa_index}` + do + ln -s ${bwa_index}/\$i ${fasta}.\${i##*.} + done + tiddit \\ --sv \\ @@ -38,7 +41,7 @@ process TIDDIT_SV { cat <<-END_VERSIONS > versions.yml "${task.process}": - tiddit: \$(echo \$(tiddit 2>&1) | sed 's/^.*TIDDIT-//; s/ .*\$//') + tiddit: \$(echo \$(tiddit 2>&1) | sed 's/^.*tiddit-//; s/ .*\$//') END_VERSIONS """ @@ -51,7 +54,7 @@ process TIDDIT_SV { cat <<-END_VERSIONS > versions.yml "${task.process}": - tiddit: \$(echo \$(tiddit 2>&1) | sed 's/^.*TIDDIT-//; s/ .*\$//') + tiddit: \$(echo \$(tiddit 2>&1) | sed 's/^.*tiddit-//; s/ .*\$//') END_VERSIONS """ } diff --git a/tests/modules/tiddit/sv/main.nf b/tests/modules/tiddit/sv/main.nf index 72113427..2c09404e 100644 --- a/tests/modules/tiddit/sv/main.nf +++ b/tests/modules/tiddit/sv/main.nf @@ -5,10 +5,11 @@ nextflow.enable.dsl = 2 include { BWA_INDEX } from '../../../../modules/bwa/index/main.nf' include { TIDDIT_SV } from '../../../../modules/tiddit/sv/main.nf' -workflow test_tiddit_sv { +workflow test_tiddit_sv_bam { input = [ [ id:'test' ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ] + [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], + [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] ] fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) @@ -18,24 +19,3 @@ workflow test_tiddit_sv { TIDDIT_SV ( input, fasta, fai , BWA_INDEX.out.index) } - -workflow test_tiddit_sv_no_ref { - input = [ - [ id:'test' ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ] - ] - - TIDDIT_SV ( input, [], [] ) -} - -workflow test_tiddit_sv_cram { - input = [ - [ id:'test' ], // meta map - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true) ] - ] - - fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - fai = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) - - TIDDIT_SV ( input, fasta, fai ) -} diff --git a/tests/modules/tiddit/sv/test.yml b/tests/modules/tiddit/sv/test.yml index 40ea5b4d..732b8434 100644 --- a/tests/modules/tiddit/sv/test.yml +++ b/tests/modules/tiddit/sv/test.yml @@ -1,25 +1,10 @@ -- name: tiddit sv - command: nextflow run ./tests/modules/tiddit/sv -entry test_tiddit_sv -c ./tests/config/nextflow.config -c ./tests/modules/tiddit/sv/nextflow.config +- name: tiddit sv test_tiddit_sv_bam + command: nextflow run ./tests/modules/tiddit/sv -entry test_tiddit_sv_bam -c ./tests/config/nextflow.config -c ./tests/modules/tiddit/sv/nextflow.config tags: - tiddit - tiddit/sv files: - - path: output/tiddit/test.ploidy.tab - md5sum: 45e050b0e204f0a5a3a99627cc440eaa - - path: output/tiddit/test.signals.tab - md5sum: dab4b2fec4ddf8eb1c23005b0770150e + - path: output/tiddit/test.ploidies.tab + md5sum: 6319d3611f7b6b94425a184d274b3dfc - path: output/tiddit/test.vcf - md5sum: bdce14ae8292bf3deb81f6f255baf859 - -- name: tiddit sv no ref - command: nextflow run ./tests/modules/tiddit/sv -entry test_tiddit_sv_no_ref -c ./tests/config/nextflow.config -c ./tests/modules/tiddit/sv/nextflow.config - tags: - - tiddit - - tiddit/sv - files: - - path: output/tiddit/test.ploidy.tab - md5sum: 45e050b0e204f0a5a3a99627cc440eaa - - path: output/tiddit/test.signals.tab - md5sum: dab4b2fec4ddf8eb1c23005b0770150e - - path: output/tiddit/test.vcf - md5sum: 3d0e83a8199b2bdb81cfe3e6b12bf64b + md5sum: 41d3f8746f0420f894104321b7e64f67