forked from nf-core/modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* first version * improvments * whitespaces * whitespaces * whitespaces * prettier --------- Co-authored-by: zxBIB Grochowalski,Lukasz (GCBDS) EXTERNAL <[email protected]>
- Loading branch information
1 parent
5703812
commit 74b91ef
Showing
6 changed files
with
248 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
name: "leviosam2_index" | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- "bioconda::leviosam2=0.4.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
process LEVIOSAM2_INDEX { | ||
tag "$meta.id" | ||
label 'process_low' | ||
|
||
conda "${moduleDir}/environment.yml" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/leviosam2:0.4.2--h4ac6f70_0': | ||
'biocontainers/leviosam2:0.4.2--h4ac6f70_0' }" | ||
|
||
input: | ||
tuple val(meta), path(fai) | ||
path(chain) | ||
|
||
output: | ||
tuple val(meta), path("*.clft"), emit: clft | ||
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}" | ||
|
||
""" | ||
leviosam2 \\ | ||
index \\ | ||
-c ${chain} \\ | ||
-p ${prefix} \\ | ||
-F ${fai} | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
leviosam2: \$(leviosam2 --version) | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
touch ${prefix}.clft | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
leviosam2: \$(leviosam2 --version) | ||
END_VERSIONS | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
name: "leviosam2_index" | ||
description: Index chain files for lift over | ||
keywords: | ||
- leviosam2 | ||
- index | ||
- lift | ||
tools: | ||
- "leviosam2": | ||
description: "Fast and accurate coordinate conversion between assemblies" | ||
homepage: "https://github.com/milkschen/leviosam2/blob/main/workflow/README.md" | ||
documentation: "https://github.com/milkschen/leviosam2/blob/main/workflow/README.md" | ||
licence: ["MIT"] | ||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'reference' ]` | ||
- fai: | ||
type: file | ||
description: FAI (FASTA index) file of the target reference | ||
pattern: "*.{fai}" | ||
- chain: | ||
type: file | ||
description: Chain file to index. | ||
pattern: "*.{chain}" | ||
output: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'reference' ]` | ||
- clft: | ||
type: file | ||
description: Clft file of indexed chain | ||
pattern: "*.{clft}" | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
authors: | ||
- "@lgrochowalski" | ||
maintainers: | ||
- "@lgrochowalski" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
nextflow_process { | ||
|
||
name "Test Process LEVIOSAM2_INDEX" | ||
script "../main.nf" | ||
process "LEVIOSAM2_INDEX" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "leviosam2" | ||
tag "leviosam2/index" | ||
tag "gunzip" | ||
|
||
test("index") { | ||
setup { | ||
run("GUNZIP") { | ||
script "../../../gunzip/main.nf" | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test' ], | ||
file(params.test_data['homo_sapiens']['genome']['genome_chain_gz'], checkIfExists: true) | ||
] | ||
""" | ||
} | ||
|
||
} | ||
} | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test' ], | ||
file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) | ||
] | ||
input[1] = GUNZIP.out.gunzip.map{ meta, gunzip -> gunzip } | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
test("index - stub") { | ||
|
||
options "-stub" | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test' ], // meta map | ||
file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) | ||
] | ||
input[1] = file(params.test_data['homo_sapiens']['genome']['genome_chain_gz'], checkIfExists: true) | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
leviosam2/index: | ||
- "modules/nf-core/leviosam2/index/**" | ||
- "modules/nf-core/gunzip/**" |