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.
htseq/count module is implemented (nf-core#4085)
* htseq/count module is implemented * Update meta.yml bam.bai changed to .bai * Added meta2 * Implemented changes from review * update pytest runner * Update modules/nf-core/htseq/count/main.nf Co-authored-by: Nicolas Vannieuwkerke <[email protected]> --------- Co-authored-by: Maxime U Garcia <[email protected]> Co-authored-by: Nicolas Vannieuwkerke <[email protected]> Co-authored-by: mashehu <[email protected]>
- Loading branch information
1 parent
bde9f9d
commit e18a2de
Showing
6 changed files
with
171 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,49 @@ | ||
process HTSEQ_COUNT { | ||
tag "$meta.id" | ||
label 'process_medium' | ||
|
||
conda "bioconda::htseq=2.0.2" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/htseq:2.0.2--py310ha14a713_0': | ||
'biocontainers/htseq:2.0.2--py310ha14a713_0' }" | ||
|
||
input: | ||
tuple val(meta), path(input), path(index) | ||
tuple val(meta2), path(gtf) | ||
|
||
output: | ||
tuple val(meta), path("*.txt"), emit: txt | ||
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}" | ||
|
||
""" | ||
htseq-count \\ | ||
${input} \\ | ||
${gtf} \\ | ||
${args} \\ | ||
> ${prefix}.txt | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
htseq: \$(echo \$(htseq-count --version ) | sed 's/^.*htseq-count //; s/Using.*\$//' )) | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
touch ${prefix}.txt | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
: \$(echo \$(htseq-count --version ) | sed 's/^.*htseq-count //; s/Using.*\$//' )) | ||
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,53 @@ | ||
--- | ||
name: "htseq_count" | ||
description: count how many reads map to each feature | ||
keywords: | ||
- htseq | ||
- count | ||
- gtf | ||
- annotation | ||
tools: | ||
- "htseq/count": | ||
description: "HTSeq is a Python library to facilitate processing and analysis of data from high-throughput sequencing (HTS) experiments." | ||
homepage: "https://htseq.readthedocs.io/en/latest/" | ||
documentation: "https://htseq.readthedocs.io/en/latest/index.html" | ||
doi: "10.1093/bioinformatics/btu638" | ||
licence: "['GPL v3']" | ||
|
||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'test', single_end:false ]` | ||
- meta2: | ||
type: map | ||
description: | | ||
.gtf file information | ||
e.g. `[ id:'test' ]` | ||
- input: | ||
type: file | ||
description: Sorted BAM/CRAM/SAM file | ||
pattern: "*.{bam,cram,sam}" | ||
- index: | ||
type: file | ||
description: Contains indexed bam file | ||
pattern: "*.bai" | ||
- gtf: | ||
type: file | ||
description: Contains the features in the GTF format | ||
pattern: "*.gtf" | ||
|
||
output: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'test', single_end:false ]` | ||
- txt: | ||
type: file | ||
description: File containing feature counts output | ||
pattern: ".txt" | ||
|
||
authors: | ||
- "@zehrahazalsezer" |
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,40 @@ | ||
#!/usr/bin/env nextflow | ||
|
||
nextflow.enable.dsl = 2 | ||
|
||
include { HTSEQ_COUNT } from '../../../../../modules/nf-core/htseq/count/main.nf' | ||
|
||
workflow test_htseq_count_bam { | ||
|
||
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) | ||
|
||
] | ||
gtf = [ | ||
[ id:'test2'], // meta map | ||
file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true) | ||
] | ||
|
||
|
||
HTSEQ_COUNT (input,gtf) | ||
} | ||
|
||
workflow test_htseq_count_cram { | ||
|
||
input = [ | ||
[ id:'test', single_end:false ], // meta map | ||
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), | ||
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true) | ||
|
||
] | ||
gtf = [ | ||
[ id:'test2'], // meta map | ||
file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true) | ||
] | ||
|
||
|
||
HTSEQ_COUNT (input,gtf) | ||
} | ||
|
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,6 @@ | ||
process { | ||
|
||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } | ||
docker.registry = 'quay.io' | ||
|
||
} |
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,19 @@ | ||
- name: htseq count test_htseq_count_bam | ||
command: nextflow run ./tests/modules/nf-core/htseq/count -entry test_htseq_count_bam -c ./tests/config/nextflow.config | ||
tags: | ||
- htseq | ||
- htseq/count | ||
files: | ||
- path: output/htseq/test.txt | ||
md5sum: 5e37b2292f1d21945acb532afa5eb615 | ||
- path: output/htseq/versions.yml | ||
|
||
- name: htseq count test_htseq_count_cram | ||
command: nextflow run ./tests/modules/nf-core/htseq/count -entry test_htseq_count_cram -c ./tests/config/nextflow.config | ||
tags: | ||
- htseq | ||
- htseq/count | ||
files: | ||
- path: output/htseq/test.txt | ||
md5sum: 53f9b007bd72115e8b72a40f859bc896 | ||
- path: output/htseq/versions.yml |