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.
* add inital igvreports module * add full input and tests --------- Co-authored-by: Andrea Telatin <[email protected]>
- Loading branch information
1 parent
bd1ff1f
commit 59a0a8a
Showing
7 changed files
with
258 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,9 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json | ||
name: "igvreports" | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- "bioconda::igv-reports=1.12.0" |
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,48 @@ | ||
process IGVREPORTS { | ||
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/igv-reports:1.12.0--pyh7cba7a3_0': | ||
'biocontainers/igv-reports:1.12.0--pyh7cba7a3_0' }" | ||
|
||
input: | ||
tuple val(meta), path(sites) | ||
path genomeFasta //optional genome fasta file | ||
|
||
output: | ||
tuple val(meta), path("*.html") , emit: report | ||
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 fasta = genomeFasta ? "--fasta ${genomeFasta}" : "" | ||
""" | ||
create_report $sites \ | ||
$args \ | ||
$fasta \ | ||
--output ${meta.id}_report.html | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
igvreports: \$(python -c "import igv_reports; print(igv_reports.__version__)") | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
touch ${meta.id}_report.html | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
igvreports: \$(python -c "import igv_reports; print(igv_reports.__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,47 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||
name: "igvreports" | ||
description: A Python application to generate self-contained HTML reports for variant review and other genomic applications | ||
keywords: | ||
- vcf | ||
- variant | ||
- genomics | ||
tools: | ||
- "igvreports": | ||
description: "Creates self-contained html pages for visual variant review with IGV (igv.js)." | ||
homepage: "https://github.com/igvteam/igv-reports" | ||
documentation: "https://github.com/igvteam/igv-reports" | ||
tool_dev_url: "https://github.com/igvteam/igv-reports" | ||
doi: "10.1093/bioinformatics/btac830" | ||
licence: ["MIT"] | ||
|
||
input: | ||
# Only when we have meta | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- sites: | ||
type: file | ||
description: VCF, BED, MAF, BEDPE, or generic tab delimited file of genomic variant sites | ||
- genomeFasta: | ||
type: file | ||
description: Reference fasta file | ||
pattern: "*.{fasta,fa}" | ||
|
||
output: | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
- report: | ||
type: file | ||
description: html report with a table of genomic sites and an embedded IGV genome browser for viewing data for each site | ||
pattern: "*.{html}" | ||
|
||
authors: | ||
- "@souljamie" | ||
maintainers: | ||
- "@souljamie" |
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,107 @@ | ||
nextflow_process { | ||
|
||
name "Test Process IGVREPORTS" | ||
script "../main.nf" | ||
process "IGVREPORTS" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "igvreports" | ||
|
||
test("testvariantsWithFasta - vcf") { | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ [ id:'test'], // meta map | ||
file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) | ||
] | ||
input[1] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out.versions).match()}, | ||
{ | ||
with(process.out.report) { | ||
with(get(0)) { | ||
assert get(1).endsWith("_report.html") | ||
} | ||
} | ||
} | ||
) | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
test("testvariantsWithGenome - vcf") { | ||
config "./nextflow_genome.config" | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test'], // meta map | ||
file("https://raw.githubusercontent.com/igvteam/igv-reports/master/test/data/variants/variants.vcf") | ||
] | ||
// Need to specify the empty optional fasta input | ||
input[1] = [] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out.versions).match()}, | ||
{ | ||
with(process.out.report) { | ||
with(get(0)) { | ||
assert get(1).endsWith("_report.html") | ||
} | ||
} | ||
} | ||
) | ||
} | ||
|
||
} | ||
|
||
test("testvariantWithGenome - vcf - stub") { | ||
config "./nextflow_genome.config" | ||
|
||
options "-stub" | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test'], // meta map | ||
file("https://raw.githubusercontent.com/igvteam/igv-reports/master/test/data/variants/variants.vcf") | ||
] | ||
input[1] = [] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out.versions).match()}, | ||
{ | ||
with(process.out.report) { | ||
with(get(0)) { | ||
assert get(1).endsWith("_report.html") | ||
} | ||
} | ||
} | ||
) | ||
} | ||
|
||
} | ||
|
||
} |
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,7 @@ | ||
process { | ||
|
||
withName: IGVREPORTS { | ||
ext.args = '--genome hg38' | ||
} | ||
|
||
} |
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,2 @@ | ||
igvreports: | ||
- "modules/nf-core/igvreports/**" |