-
Notifications
You must be signed in to change notification settings - Fork 735
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from cibinsb/arima_filter_five_end
created module Arima filter_five_end.pl
- Loading branch information
Showing
6 changed files
with
156 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,44 @@ | ||
|
||
process ARIMA_FILTERFIVEEND { | ||
tag "$meta.id" | ||
label 'process_medium' | ||
def version = '0.001-c24' | ||
|
||
if (params.enable_conda) { | ||
exit 1, "Conda environments cannot be used when using the arima filter_five_end_v1 tool. Please use docker or singularity containers." | ||
} | ||
container "quay.io/sanger-tol/arima:${version}" | ||
|
||
input: | ||
tuple val(meta), path(read) | ||
|
||
output: | ||
tuple val(meta), path("*.bam"), emit: bam | ||
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}" | ||
if (meta.single_end) { | ||
""" | ||
samtools view -h ${read} | filter_five_end.pl | samtools view -Sb $args -@ $task.cpus -o ${prefix}_filtered.bam - | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' ) | ||
arima: ${version} | ||
END_VERSIONS | ||
""" | ||
} else { | ||
""" | ||
samtools view -h ${read[0]} | filter_five_end.pl | samtools view -Sb $args -@ $task.cpus -o ${prefix}_1_filtered.bam - | ||
samtools view -h ${read[1]} | filter_five_end.pl | samtools view -Sb $args -@ $task.cpus -o ${prefix}_2_filtered.bam - | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' ) | ||
arima: ${version} | ||
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,54 @@ | ||
name: arima_filterfiveend | ||
description: Filter BAM files using Arima filter_five_end.pl | ||
keywords: | ||
- bam | ||
- filter | ||
- filterfiveend | ||
- samtools | ||
tools: | ||
- arima: | ||
description: A wrapper tool around Arima Genomics's filter_five_end.pl to filter BAM files. | ||
homepage: https://arimagenomics.com | ||
documentation: https://github.com/ArimaGenomics/mapping_pipeline/blob/master/Arima_Mapping_UserGuide_A160156_v02.pdf | ||
tool_dev_url: https://github.com/ArimaGenomics/mapping_pipeline | ||
licence: MIT | ||
|
||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- reads: | ||
type: file | ||
description: | | ||
List of input BAM files of size 1 and 2 for single-end and paired-end data, | ||
respectively. | ||
- bam: | ||
type: file | ||
description: BAM/CRAM/SAM file | ||
pattern: "*.{bam,cram,sam}" | ||
|
||
output: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- reads: | ||
type: file | ||
description: | | ||
List of input adapter trimmed FastQ files of size 1 and 2 for | ||
single-end and paired-end data, respectively. | ||
pattern: "*.{_filtered.bam}" | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
- bam: | ||
type: file | ||
description: Sorted BAM/CRAM/SAM file | ||
pattern: "*.{bam,cram,sam}" | ||
|
||
authors: | ||
- "@cibinsb" |
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,26 @@ | ||
#!/usr/bin/env nextflow | ||
|
||
nextflow.enable.dsl = 2 | ||
|
||
include { ARIMA_FILTERFIVEEND } from '../../../../modules/arima/filterfiveend/main.nf' | ||
|
||
workflow test_arima_filterfiveend_single_end { | ||
|
||
input = [ | ||
[ id:'test', single_end:true ], // meta map | ||
file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true) | ||
] | ||
|
||
ARIMA_FILTERFIVEEND ( input ) | ||
} | ||
|
||
workflow test_arima_filterfiveend_paired_end { | ||
|
||
input = [ | ||
[ id:'test', single_end:false ], // meta map | ||
[file(params.test_data['bacteroides_fragilis']['illumina']['test1_paired_end_bam'], checkIfExists: true), | ||
file(params.test_data['bacteroides_fragilis']['illumina']['test2_paired_end_bam'], checkIfExists: true)] | ||
] | ||
|
||
ARIMA_FILTERFIVEEND ( 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,5 @@ | ||
process { | ||
|
||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } | ||
|
||
} |
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,23 @@ | ||
- name: arima filterfiveend test_arima_filterfiveend_single_end | ||
command: nextflow run tests/modules/arima/filterfiveend -entry test_arima_filterfiveend_single_end -c tests/config/nextflow.config | ||
tags: | ||
- arima | ||
- arima/filterfiveend | ||
files: | ||
- path: output/arima/test_filtered.bam | ||
md5sum: 1f31e75a195da133180d8201597d2841 | ||
- path: output/arima/versions.yml | ||
md5sum: dcb824f6fc3ab7d5a20afcf2508aa099 | ||
|
||
- name: arima filterfiveend test_arima_filterfiveend_paired_end | ||
command: nextflow run tests/modules/arima/filterfiveend -entry test_arima_filterfiveend_paired_end -c tests/config/nextflow.config | ||
tags: | ||
- arima | ||
- arima/filterfiveend | ||
files: | ||
- path: output/arima/test_1_filtered.bam | ||
md5sum: 92cd899240cee1ec731ea071023fa56a | ||
- path: output/arima/test_2_filtered.bam | ||
md5sum: 65df90c6d00fbdfc849d2b72fdfbe1c8 | ||
- path: output/arima/versions.yml | ||
md5sum: a2d3a97555e1ad30e0c157aef66d25ed |