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 igv/js module * add documentation in meta.yml * create test.yml according to new version of the library * fix browser description and pattern
- Loading branch information
Showing
6 changed files
with
180 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,66 @@ | ||
|
||
process IGV_JS { | ||
tag "$meta.id" | ||
label 'process_single' | ||
|
||
conda "conda-forge::sed=4.7" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/ubuntu:20.04' : | ||
'ubuntu:20.04' }" | ||
|
||
input: | ||
tuple val(meta), path(alignment), path(index) | ||
|
||
output: | ||
tuple val(meta), path("*_genome-browser.html") , emit: browser | ||
tuple val(meta), path(alignment) , emit: align_files | ||
tuple val(meta), path(index) , emit: index_files | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def browser_args = task.ext.args ?: '' | ||
def track_args = task.ext.args2 ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
cat <<IGV > ${prefix}_genome-browser.html | ||
<html> | ||
<head> | ||
<script src="https://cdn.jsdelivr.net/npm/igv@2.13.9/dist/igv.min.js"></script> <!-- https://github.com/igvteam/igv.js/ --> | ||
</head> | ||
<body> | ||
<div id="igv-div"></div> | ||
<script> | ||
var igvDiv = document.getElementById("igv-div"); | ||
var options = | ||
{ | ||
$browser_args, | ||
tracks: [ | ||
{ | ||
"name": "$prefix", | ||
"url": "$alignment", | ||
"indexURL": "$index", | ||
$track_args | ||
} | ||
] | ||
}; | ||
igv.removeAllBrowsers(); | ||
igv.createBrowser(igvDiv, options) | ||
.then(function(browser){ | ||
igv.browser = browser; | ||
}) | ||
</script> | ||
</body> | ||
</html> | ||
IGV | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
cat: \$(echo \$(cat --version 2>&1) | sed 's/^.*coreutils) //; s/ .*\$//') | ||
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,67 @@ | ||
name: "igv_js" | ||
description: igv.js is an embeddable interactive genome visualization component | ||
keywords: | ||
- igv | ||
- igv.js | ||
- js | ||
- genome browser | ||
tools: | ||
- "igv": | ||
description: | | ||
Create an embeddable interactive genome browser component. | ||
Output files are expected to be present in the same directory as teh genome browser html file. | ||
To visualise it, files have to be served. Check the documentation at: | ||
https://github.com/igvteam/igv-webapp for an example and | ||
https://github.com/igvteam/igv.js/wiki/Data-Server-Requirements for server requirements | ||
homepage: https://github.com/igvteam/igv.js | ||
documentation: https://github.com/igvteam/igv.js/wiki | ||
tool_dev_url: https://github.com/igvteam/igv.js | ||
doi: https://doi.org/10.1093/bioinformatics/btac830 | ||
licence: "['MIT']" | ||
|
||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- alignment: | ||
type: file | ||
description: Sorted BAM/CRAM file | ||
pattern: "*.{bam,cram}" | ||
|
||
- index: | ||
type: file | ||
description: Index of sorted BAM/CRAM file | ||
pattern: "*.{bai,crai}" | ||
|
||
output: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- browser: | ||
type: file | ||
description: Genome browser HTML file | ||
pattern: "*.{html}" | ||
|
||
- align_files: | ||
type: file | ||
description: Copy of the input sorted BAM/CRAM file | ||
pattern: "*.{bam,cram}" | ||
|
||
- index_files: | ||
type: file | ||
description: Copy of the input index of sorted BAM/CRAM file | ||
pattern: "*.{bai,crai}" | ||
|
||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
|
||
authors: | ||
- "@mirpedrol" |
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
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,16 @@ | ||
#!/usr/bin/env nextflow | ||
|
||
nextflow.enable.dsl = 2 | ||
|
||
include { IGV_JS } from '../../../../../modules/nf-core/igv/js/main.nf' | ||
|
||
workflow test_igv_js { | ||
|
||
input = [ | ||
[ id:'test', single_end:false ], // meta map | ||
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), | ||
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) | ||
] | ||
|
||
IGV_JS ( input ) | ||
} |
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,14 @@ | ||
process { | ||
|
||
publishDir = [ | ||
mode: "copy", | ||
path: { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }, | ||
] | ||
withName: 'IGV_JS' { | ||
ext.args = """genome: "hg38", | ||
locus: "chr22:4,514-4,554"""" | ||
ext.args2 = """"format": "bam", | ||
"type": "alignment"""" | ||
} | ||
} |
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,13 @@ | ||
- name: igv js test_igv_js | ||
command: nextflow run ./tests/modules/nf-core/igv/js -entry test_igv_js -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/igv/js/nextflow.config | ||
tags: | ||
- igv | ||
- igv/js | ||
files: | ||
- path: output/igv/test.paired_end.sorted.bam | ||
md5sum: 76396678f283516b159a1e9b538fc64c | ||
- path: output/igv/test.paired_end.sorted.bam.bai | ||
md5sum: 9ac6ecb9435822c44b37765f111e9013 | ||
- path: output/igv/test_genome-browser.html | ||
md5sum: 99f4962da2703eceaba71fd68f9be7e6 | ||
- path: output/igv/versions.yml |