Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions modules/nextflow/psltools/convert/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
Copyright (c) 2026 The Hiller Lab at the Senckenberg Gessellschaft für Naturforschung
Distributed under the terms of the Apache License, Version 2.0.
*/

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PSLTOOLS_CONVERT — Convert PSL to BED
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

process PSLTOOLS_CONVERT {
tag "$meta.id"
label 'process_low'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'' :
'ghcr.io/alejandrogzi/psltools:latest' }"

input:
tuple val(meta), path(psl)

output:
tuple val(meta), path("*.bed") , optional: true, emit: bed
tuple val(meta), path("*.bed.gz") , optional: true, emit: bed_gz
path "versions.yml" , emit: versions

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

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def type = task.ext.type ?: '12'
def gzip = task.ext.gzip ? "--gzip" : ""
"""
psltools convert \\
$args \\
$gzip \\
--psl $psl \\
--out ${prefix}.bed \\
--type $type

cat <<-END_VERSIONS > versions.yml
"${task.process}":
psltools: \$( psltools --version | sed 's/psltools //g' )
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.bed
touch ${prefix}.bed.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
psltools: \$( psltools --version | sed 's/psltools //g' )
END_VERSIONS
"""
}
58 changes: 58 additions & 0 deletions modules/nextflow/psltools/filter/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
Copyright (c) 2026 The Hiller Lab at the Senckenberg Gessellschaft für Naturforschung
Distributed under the terms of the Apache License, Version 2.0.
*/

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PSLTOOLS_FILTER — Filter PSL files by score, strand, or other criteria.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

process PSLTOOLS_FILTER {
tag "$meta.id"
label 'process_low'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'' :
'ghcr.io/alejandrogzi/psltools:latest' }"

input:
tuple val(meta), path(psl)

output:
tuple val(meta), path("*.psl") , optional: true, emit: psl
tuple val(meta), path("*.psl.gz") , optional: true, emit: psl_gz
path "versions.yml" , emit: versions

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

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
psltools filter \\
$args \\
--psl $psl \\
--out-psl ${prefix}.filtered.psl

cat <<-END_VERSIONS > versions.yml
"${task.process}":
psltools: \$( psltools --version | sed 's/psltools //g' )
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.psl
touch ${prefix}.psl.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
psltools: \$( psltools --version | sed 's/psltools //g' )
END_VERSIONS
"""
}
60 changes: 60 additions & 0 deletions modules/nextflow/psltools/merge/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
Copyright (c) 2026 The Hiller Lab at the Senckenberg Gessellschaft für Naturforschung
Distributed under the terms of the Apache License, Version 2.0.
*/

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PSLTOOLS_MERGE — Merge PSL files into a single PSL file.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

process PSLTOOLS_MERGE {
tag "$meta.id"
label 'process_low'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'' :
'ghcr.io/alejandrogzi/psltools:latest' }"

input:
tuple val(meta), path(psls)

output:
tuple val(meta), path("*.psl") , optional: true, emit: psl
tuple val(meta), path("*.psl.gz") , optional: true, emit: psl_gz
path "versions.yml" , emit: versions

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

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
ls *.psl > psl.list

psltools merge \\
$args \\
--file psl.list \\
--out-psl ${prefix}.merged.psl

cat <<-END_VERSIONS > versions.yml
"${task.process}":
psltools: \$( psltools --version | sed 's/psltools //g' )
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.merged.psl
touch ${prefix}.merged.psl.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
psltools: \$( psltools --version | sed 's/psltools //g' )
END_VERSIONS
"""
}
58 changes: 58 additions & 0 deletions modules/nextflow/psltools/score/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
Copyright (c) 2026 The Hiller Lab at the Senckenberg Gessellschaft für Naturforschung
Distributed under the terms of the Apache License, Version 2.0.
*/

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PSLTOOLS_SCORE — Score PSL files by summing the values of the alignment scores.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

process PSLTOOLS_SCORE {
tag "$meta.id"
label 'process_low'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'' :
'ghcr.io/alejandrogzi/psltools:latest' }"

input:
tuple val(meta), path(psl)

output:
tuple val(meta), path("*.tsv") , optional: true, emit: tsv
tuple val(meta), path("*.tsv.gz") , optional: true, emit: tsv_gz
path "versions.yml" , emit: versions

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

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
psltools score \\
$args \\
--psl $psl \\
--out ${prefix}.scores.tsv

cat <<-END_VERSIONS > versions.yml
"${task.process}":
psltools: \$( psltools --version | sed 's/psltools //g' )
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.tsv
touch ${prefix}.tsv.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
psltools: \$( psltools --version | sed 's/psltools //g' )
END_VERSIONS
"""
}
58 changes: 58 additions & 0 deletions modules/nextflow/psltools/sort/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
Copyright (c) 2026 The Hiller Lab at the Senckenberg Gessellschaft für Naturforschung
Distributed under the terms of the Apache License, Version 2.0.
*/

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PSLTOOLS_SORT — Sort PSL files by chromosome, start, or other criteria.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

process PSLTOOLS_SORT {
tag "$meta.id"
label 'process_low'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'' :
'ghcr.io/alejandrogzi/psltools:latest' }"

input:
tuple val(meta), path(psl)

output:
tuple val(meta), path("*.psl") , optional: true, emit: psl
tuple val(meta), path("*.psl.gz") , optional: true, emit: psl_gz
path "versions.yml" , emit: versions

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

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
psltools sort \\
$args \\
--psl $psl \\
--out ${prefix}.scores.psl

cat <<-END_VERSIONS > versions.yml
"${task.process}":
psltools: \$( psltools --version | sed 's/psltools //g' )
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.psl
touch ${prefix}.psl.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
psltools: \$( psltools --version | sed 's/psltools //g' )
END_VERSIONS
"""
}
58 changes: 58 additions & 0 deletions modules/nextflow/psltools/split/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
Copyright (c) 2026 The Hiller Lab at the Senckenberg Gessellschaft für Naturforschung
Distributed under the terms of the Apache License, Version 2.0.
*/

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PSLTOOLS_SPLIT — Split PSL files into multiple PSL files.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

process PSLTOOLS_SPLIT {
tag "$meta.id"
label 'process_low'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'' :
'ghcr.io/alejandrogzi/psltools:latest' }"

input:
tuple val(meta), path(psl)

output:
tuple val(meta), path("*.psl") , optional: true, emit: psl
tuple val(meta), path("*.psl.gz") , optional: true, emit: psl_gz
path "versions.yml" , emit: versions

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

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
psltools split \\
$args \\
--psl $psl \\
--out-prefix ${prefix}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
psltools: \$( psltools --version | sed 's/psltools //g' )
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.psl
touch ${prefix}.psl.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
psltools: \$( psltools --version | sed 's/psltools //g' )
END_VERSIONS
"""
}
Loading
Loading