diff --git a/tools/bwa/index/main.nf b/tools/bwa/index/main.nf new file mode 100644 index 00000000..0c943bb4 --- /dev/null +++ b/tools/bwa/index/main.nf @@ -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} + """ +} \ No newline at end of file diff --git a/tools/bwa/index/meta.yml b/tools/bwa/index/meta.yml new file mode 100644 index 00000000..d03c71a2 --- /dev/null +++ b/tools/bwa/index/meta.yml @@ -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 diff --git a/tools/bwa/index/test/main.nf b/tools/bwa/index/test/main.nf new file mode 100644 index 00000000..6acb4d61 --- /dev/null +++ b/tools/bwa/index/test/main.nf @@ -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() +} diff --git a/tools/bwa/index/test/nextflow.config b/tools/bwa/index/test/nextflow.config new file mode 100644 index 00000000..c137a138 --- /dev/null +++ b/tools/bwa/index/test/nextflow.config @@ -0,0 +1,2 @@ +docker.enabled = true +params.outdir = './results' diff --git a/tools/gatk/dict/main.nf b/tools/gatk/dict/main.nf new file mode 100644 index 00000000..49edf5a1 --- /dev/null +++ b/tools/gatk/dict/main.nf @@ -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 + """ +} \ No newline at end of file diff --git a/tools/gatk/dict/meta.yml b/tools/gatk/dict/meta.yml new file mode 100644 index 00000000..bc9e18b6 --- /dev/null +++ b/tools/gatk/dict/meta.yml @@ -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 \ No newline at end of file diff --git a/tools/gatk/dict/test/main.nf b/tools/gatk/dict/test/main.nf new file mode 100644 index 00000000..41c1862c --- /dev/null +++ b/tools/gatk/dict/test/main.nf @@ -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() +} diff --git a/tools/gatk/dict/test/nextflow.config b/tools/gatk/dict/test/nextflow.config new file mode 100644 index 00000000..c137a138 --- /dev/null +++ b/tools/gatk/dict/test/nextflow.config @@ -0,0 +1,2 @@ +docker.enabled = true +params.outdir = './results' diff --git a/tools/htslib/tabix/main.nf b/tools/htslib/tabix/main.nf new file mode 100644 index 00000000..e228bb02 --- /dev/null +++ b/tools/htslib/tabix/main.nf @@ -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} + """ +} diff --git a/tools/htslib/tabix/meta.yml b/tools/htslib/tabix/meta.yml new file mode 100644 index 00000000..027780c3 --- /dev/null +++ b/tools/htslib/tabix/meta.yml @@ -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 \ No newline at end of file diff --git a/tools/htslib/tabix/test/main.nf b/tools/htslib/tabix/test/main.nf new file mode 100644 index 00000000..6fd80089 --- /dev/null +++ b/tools/htslib/tabix/test/main.nf @@ -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() +} diff --git a/tools/htslib/tabix/test/nextflow.config b/tools/htslib/tabix/test/nextflow.config new file mode 100644 index 00000000..c137a138 --- /dev/null +++ b/tools/htslib/tabix/test/nextflow.config @@ -0,0 +1,2 @@ +docker.enabled = true +params.outdir = './results' diff --git a/tools/samtools/faidx/main.nf b/tools/samtools/faidx/main.nf new file mode 100644 index 00000000..458a5ab8 --- /dev/null +++ b/tools/samtools/faidx/main.nf @@ -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} + """ +} diff --git a/tools/samtools/faidx/meta.yml b/tools/samtools/faidx/meta.yml new file mode 100644 index 00000000..1e402057 --- /dev/null +++ b/tools/samtools/faidx/meta.yml @@ -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 \ No newline at end of file diff --git a/tools/samtools/faidx/test/main.nf b/tools/samtools/faidx/test/main.nf new file mode 100644 index 00000000..f01ab6c9 --- /dev/null +++ b/tools/samtools/faidx/test/main.nf @@ -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() +} diff --git a/tools/samtools/faidx/test/nextflow.config b/tools/samtools/faidx/test/nextflow.config new file mode 100644 index 00000000..c137a138 --- /dev/null +++ b/tools/samtools/faidx/test/nextflow.config @@ -0,0 +1,2 @@ +docker.enabled = true +params.outdir = './results' diff --git a/tools/samtools/index/main.nf b/tools/samtools/index/main.nf index acf1af41..7b065fa9 100644 --- a/tools/samtools/index/main.nf +++ b/tools/samtools/index/main.nf @@ -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 """ diff --git a/tools/samtools/index/meta.yml b/tools/samtools/index/meta.yml index 3cd7a402..e665789b 100644 --- a/tools/samtools/index/meta.yml +++ b/tools/samtools/index/meta.yml @@ -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: |