Skip to content

Commit

Permalink
feat: Add verticall pairwise module
Browse files Browse the repository at this point in the history
  • Loading branch information
jvfe committed Jul 10, 2023
1 parent 054703d commit b759d63
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 5 deletions.
52 changes: 52 additions & 0 deletions modules/local/verticall.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
process VERTICALL {
tag "$cluster"
label 'process_high'

conda "bioconda::verticall=0.4.1"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/verticall:0.4.1--pyhdfd78af_0':
'quay.io/biocontainers/verticall:0.4.1--pyhdfd78af_0' }"

input:
tuple val(cluster), path(assemblies), val(reference)
path assembly_files

output:
tuple val(cluster), path("verticall_${prefix}.tsv"), emit: tsv
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${cluster}"
"""
mkdir assemblies_dir
for s in \$(cut -f2 -d"\t" $assemblies); do cp \$s assemblies_dir/; done
verticall \\
pairwise \\
$args \\
-i assemblies_dir/ \\
--threads $task.cpus \\
-o verticall_${prefix}.tsv \\
-r assemblies_dir/$reference
cat <<-END_VERSIONS > versions.yml
"${task.process}":
verticall: \$(echo \$(verticall --version 2>&1) | sed "s/^Verticall v//g")
END_VERSIONS
"""
stub:
prefix = task.ext.prefix ?: "${cluster}"
"""
touch verticall_${prefix}.tsv
cat <<-END_VERSIONS > versions.yml
"${task.process}":
verticall: \$(echo \$(verticall --version 2>&1) | sed "s/^Verticall v//g")
END_VERSIONS
"""
}
11 changes: 6 additions & 5 deletions recombination.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include { GET_RECOMB_INPUT } from './modules/local/get_recomb_input'
include { VERTICALL } from './modules/local/verticall'


workflow {
Expand Down Expand Up @@ -35,7 +36,7 @@ workflow {

GET_RECOMB_INPUT.out.csv
.splitCsv(header: true)
.map { row -> tuple(row.Cluster, file(row.samplesheet), row.Reference, file(row.reference_path)) }
.map { row -> tuple(row.Cluster, file(row.samplesheet), row.Reference, row.reference_path) }
.set { recomb_input }

assemblies
Expand All @@ -45,10 +46,10 @@ workflow {
.collect { meta, path -> path }
.set { unduplicated_assemblies }

// SKA (
// ska_input.map { c, s, r, rf -> tuple(c,s,rf) },
// unduplicated_assemblies
// )
VERTICALL (
recomb_input.map { c, s, r, rf -> tuple(c,s,rf) },
assemblies.collect { meta, path -> path }
)



Expand Down

0 comments on commit b759d63

Please sign in to comment.