From 7fbfd2d6cb92907e9c981d04f7bf5a408a3f8e7d Mon Sep 17 00:00:00 2001 From: MaxUlysse Date: Thu, 23 Jan 2020 11:36:21 +0100 Subject: [PATCH] add samtools faidx to index fasta file --- tools/samtools/faidx/main.nf | 16 ++++++++++++++ tools/samtools/faidx/meta.yml | 27 +++++++++++++++++++++++ tools/samtools/faidx/test/main.nf | 13 +++++++++++ tools/samtools/faidx/test/nextflow.config | 2 ++ 4 files changed, 58 insertions(+) create mode 100644 tools/samtools/faidx/main.nf create mode 100644 tools/samtools/faidx/meta.yml create mode 100644 tools/samtools/faidx/test/main.nf create mode 100644 tools/samtools/faidx/test/nextflow.config 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'