Merge pull request #12 from MaxUlysse/dev

Add some modules
This commit is contained in:
Maxime Garcia 2020-02-10 17:10:35 +01:00 committed by GitHub
commit f62fad63ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 239 additions and 7 deletions

16
tools/bwa/index/main.nf Normal file
View file

@ -0,0 +1,16 @@
process bwa_index {
tag {fasta}
container 'quay.io/biocontainers/bwa:0.7.17--hed695b0_7'
input:
path(fasta)
output:
path("${fasta}.*")
script:
"""
bwa index ${fasta}
"""
}

25
tools/bwa/index/meta.yml Normal file
View file

@ -0,0 +1,25 @@
name: bwa index
description: create indexes for BWA from a fasta file
keywords:
- index
tools:
- bwa:
description: |
BWA is a software package for mapping DNA sequences against a large reference genome, such as the human genome.
homepage: http://bio-bwa.sourceforge.net/
documentation: http://www.htslib.org/doc/samtools.html
arxiv: arXiv:1303.3997
input:
-
- input:
type: file
description: Input fasta file
pattern: *.{fasta,fa}
output:
-
- index:
type: file
description: bwa indexes file
pattern: *.{fasta,fa}.{amb,ann,bwt,pac,sa}
authors:
- @maxulysse

View file

@ -0,0 +1,16 @@
#!/usr/bin/env nextflow
nextflow.preview.dsl = 2
include '../../../nf-core/module_testing/check_process_outputs.nf' params(params)
include '../main.nf' params(params)
// Define input channels
input = '../../../test-datasets/tools/bwa/index/input/reference.fasta'
Channel
.from(input)
.set { ch_input }
// Run the workflow
workflow {
fastqc(ch_input)
// .check_output()
}

View file

@ -0,0 +1,2 @@
docker.enabled = true
params.outdir = './results'

19
tools/gatk/dict/main.nf Normal file
View file

@ -0,0 +1,19 @@
process gatk_dict {
tag {fasta}
container 'quay.io/biocontainers/gatk4-spark:4.1.4.1--1'
input:
path(fasta)
output:
path("${fasta.baseName}.dict")
script:
"""
gatk --java-options "-Xmx${task.memory.toGiga()}g" \
CreateSequenceDictionary \
--REFERENCE ${fasta} \
--OUTPUT ${fasta.baseName}.dict
"""
}

25
tools/gatk/dict/meta.yml Normal file
View file

@ -0,0 +1,25 @@
name: gatk dict
description: create a dictionary file from a fasta file
keywords:
- dictionary
tools:
- gatk:
description: |
The GATK toolkit offers a wide variety of tools with a primary focus on variant discovery and genotyping, developed in the Data Sciences Platform at the Broad Institute.
homepage: https://gatk.broadinstitute.org/hc/en-us
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
doi: 10.1158/1538-7445.AM2017-3590
input:
-
- input:
type: file
description: Input fasta file
pattern: *.{fasta,fa}
output:
-
- dict:
type: file
description: gatk dictionary file
pattern: *.{fasta,fa}.{dict}
authors:
- @maxulysse

View file

@ -0,0 +1,13 @@
#!/usr/bin/env nextflow
nextflow.preview.dsl = 2
include '../../../nf-core/module_testing/check_process_outputs.nf' params(params)
include '../main.nf' params(params)
// Define input channels
input = '../../../test-datasets/tools/bwa/index/input/reference.fasta'
// Run the workflow
workflow {
gatk_dict(input)
// .check_output()
}

View file

@ -0,0 +1,2 @@
docker.enabled = true
params.outdir = './results'

View file

@ -0,0 +1,16 @@
process htslib_tabix {
tag {vcf}
container 'quay.io/biocontainers/tabix:0.2.6--ha92aebf_0'
input:
path(vcf)
output:
path("${vcf}.tbi")
script:
"""
tabix -p vcf ${vcf}
"""
}

View file

@ -0,0 +1,26 @@
name: htslib tabix
description: create tabix index from a bgzip vcf file
keywords:
- index
- tabix
tools:
- bwa:
description: |
Generic indexer for TAB-delimited genome position files.
homepage: https://www.htslib.org/
documentation: https://www.htslib.org/doc/tabix.1.html
doi: 10.1093/bioinformatics/btq671
input:
-
- input:
type: file
description: Input vcf.gz file
pattern: *.{vcf.gz}
output:
-
- index:
type: file
description: tabix index file
pattern: *.{vcf.gz.tbi}
authors:
- @maxulysse

View file

@ -0,0 +1,13 @@
#!/usr/bin/env nextflow
nextflow.preview.dsl = 2
include '../../../nf-core/module_testing/check_process_outputs.nf' params(params)
include '../main.nf' params(params)
// Define input channels
input = '../../../test-datasets/tools/file.vcf.gz'
// Run the workflow
workflow {
tabix_index(ch_read_files)
// .check_output()
}

View file

@ -0,0 +1,2 @@
docker.enabled = true
params.outdir = './results'

View file

@ -0,0 +1,16 @@
process samtools_faidx {
tag {fasta}
container 'quay.io/biocontainers/samtools:1.9--h10a08f8_12'
input:
path(fasta)
output:
path("${fasta}.fai")
script:
"""
samtools faidx ${fasta}
"""
}

View file

@ -0,0 +1,27 @@
name: samtools faidx
description: index a fasta file
keywords:
- faidx
tools:
- samtools:
description: |
SAMtools is a set of utilities for interacting with and post-processing
short DNA sequence read alignments in the SAM, BAM and CRAM formats, written by Heng Li.
These files are generated as output by short read aligners like BWA.
homepage: http://www.htslib.org/
documentation: hhttp://www.htslib.org/doc/samtools.html
doi: 10.1093/bioinformatics/btp352
input:
-
- input:
type: file
description: Input fasta file
pattern: *.{fasta,fa}
output:
-
- faidx:
type: file
description: samtools index fasta file
pattern: *.fasta.fai
authors:
- @maxulysse

View file

@ -0,0 +1,13 @@
#!/usr/bin/env nextflow
nextflow.preview.dsl = 2
include '../../../nf-core/module_testing/check_process_outputs.nf' params(params)
include '../main.nf' params(params)
// Define input channels
input = '../../../test-datasets/tools/bwa/index/input/reference.fasta'
// Run the workflow
workflow {
samtools_faidx(input)
// .check_output()
}

View file

@ -0,0 +1,2 @@
docker.enabled = true
params.outdir = './results'

View file

@ -7,15 +7,14 @@ process samtools_index {
path(bam)
output:
path "*.sorted.bam"
path "*.bai"
script:
def suff_mem = ("${(task.memory.toBytes() - 6000000000) / task.cpus}" > 2000000000) ? 'true' : 'false'
def avail_mem = (task.memory && suff_mem) ? "-m" + "${(task.memory.toBytes() - 6000000000) / task.cpus}" : ''
"""
samtools sort $bam \\
-@ ${task.cpus} ${avail_mem} \\
-o ${bam.baseName}.sorted.bam
samtools index $bam \\
-@ ${task.cpus} ${avail_mem}
samtools --version &> v_samtools.txt
"""

View file

@ -1,7 +1,7 @@
name: samtools sort
description: Sort a BAM or CRAM file
name: samtools index
description: index a BAM or CRAM file
keywords:
- sort
- index
tools:
- samtools:
description: |