New Module: gstama/polyacleanup (#1468)

* 📦 NEW: Add gstama/polyacleanup

polyacleanup script remove remaining polyA tails from FLNC reads (Pacbio isoseq3)

* 🐛 FIX: Prettier: replace simple quote by double quote

* 🐛 FIX: Update TEMPLATE to nf-core 2.4

* 👌 IMPROVE: Compress outputs

Co-authored-by: Sateesh Peri <33637490+sateeshperi@users.noreply.github.com>
This commit is contained in:
Sébastien Guizard 2022-03-31 14:11:51 +01:00 committed by GitHub
parent eeda4136c0
commit 794f84534b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 134 additions and 0 deletions

View file

@ -0,0 +1,40 @@
process GSTAMA_POLYACLEANUP {
tag "$meta.id"
label 'process_low'
conda (params.enable_conda ? "bioconda::gs-tama=1.0.3" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/gs-tama:1.0.3--hdfd78af_0':
'quay.io/biocontainers/gs-tama:1.0.3--hdfd78af_0' }"
input:
tuple val(meta), path(fasta)
output:
tuple val(meta), path("*_tama.fa.gz") , emit: fasta
tuple val(meta), path("*_tama_polya_flnc_report.txt.gz"), emit: report
tuple val(meta), path("*_tama_tails.fa.gz") , emit: tails
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( "$fasta" == "${prefix}.fasta" | "$fasta" == "${prefix}.fa" ) error "Input and output names are the same, set prefix in module configuration"
"""
tama_flnc_polya_cleanup.py \\
-f $fasta \\
-p ${prefix} \\
$args
gzip ${prefix}.fa
gzip ${prefix}_polya_flnc_report.txt
gzip ${prefix}_tails.fa
cat <<-END_VERSIONS > versions.yml
"${task.process}":
gstama: \$( tama_collapse.py -version | grep 'tc_version_date_'|sed 's/tc_version_date_//g' )
END_VERSIONS
"""
}

View file

@ -0,0 +1,55 @@
name: gstama_polyacleanup
description: Helper script, remove remaining polyA sequences from Full Length Non Chimeric reads (Pacbio isoseq3)
keywords:
- gstama
- gstama/polyacleanup
- long-read
- isoseq
- tama
- trancriptome
- annotation
tools:
- gstama:
description: Gene-Switch Transcriptome Annotation by Modular Algorithms
homepage: https://github.com/sguizard/gs-tama
documentation: https://github.com/GenomeRIK/tama/wiki
tool_dev_url: https://github.com/sguizard/gs-tama
doi: "https://doi.org/10.1186/s12864-020-07123-7"
licence: ["GPL v3 License"]
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- fasta:
type: file
description: Full Length Non Chimeric reads in fasta format
pattern: "*.{fa,fasta}"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- fasta:
type: file
description: The Full Length Non Chimeric reads clened from remaining polyA tails. The sequences are in FASTA format compressed with gzip.
pattern: "*_tama.fa.gz"
- report:
type: file
description: A text file describing the number of polyA tails removed and their length. Compressed with gzip.
pattern: "*_tama_polya_flnc_report.txt.gz"
- tails:
type: file
description: A gzip compressed FASTA file of trimmed polyA tails.
pattern: "*_tama_tails.fa.gz"
authors:
- "@sguizard"

View file

@ -811,6 +811,10 @@ gstama/merge:
- modules/gstama/merge/** - modules/gstama/merge/**
- tests/modules/gstama/merge/** - tests/modules/gstama/merge/**
gstama/polyacleanup:
- modules/gstama/polyacleanup/**
- tests/modules/gstama/polyacleanup/**
gtdbtk/classifywf: gtdbtk/classifywf:
- modules/gtdbtk/classifywf/** - modules/gtdbtk/classifywf/**
- tests/modules/gtdbtk/classifywf/** - tests/modules/gtdbtk/classifywf/**

View file

@ -0,0 +1,15 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { GSTAMA_POLYACLEANUP } from '../../../../modules/gstama/polyacleanup/main.nf'
workflow test_gstama_polyacleanup {
input = [
[ id:'test' ], // meta map
file(params.test_data['homo_sapiens']['genome']['transcriptome_fasta'], checkIfExists: true)
]
GSTAMA_POLYACLEANUP ( input )
}

View file

@ -0,0 +1,6 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
ext.prefix = { "${meta.id}_tama" }
}

View file

@ -0,0 +1,14 @@
- name: gstama polyacleanup test_gstama_polyacleanup
command: nextflow run tests/modules/gstama/polyacleanup -entry test_gstama_polyacleanup -c tests/config/nextflow.config
tags:
- gstama
- gstama/polyacleanup
files:
- path: output/gstama/test_tama.fa.gz
md5sum: 9c768387478e5f966a42c369c0270b09
- path: output/gstama/test_tama_polya_flnc_report.txt.gz
md5sum: fe3606979ed11538aacd83159f4cff03
- path: output/gstama/test_tama_tails.fa.gz
md5sum: ba21256c0afe0bda71b3ee66b4c761bf
- path: output/gstama/versions.yml
md5sum: 07ebb812ae13a350d955fab7600b2542