Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions modules/goalign/cleanseqs/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
process GOALIGN_CLEANSEQS {
tag "goalign-cleanseqs:${aln}";
label 'process_low'

conda (params.enable_conda ? "bioconda::goalign=0.3.5" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/goalign:0.3.5--h65a6115_0':
'quay.io/biocontainers/goalign:0.3.5--h65a6115_0' }"

input:
path(aln)

output:
path("*.{fasta,fas,fa,phy}"), emit: aln
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = "${aln.getName()}_clean"
"""
goalign \\
clean \\
seqs \\
-t ${task.cpus} \\
$args \\
-o ${prefix}.${aln.getExtension()} \\
-i $aln
Copy link

@fredericlemoine fredericlemoine Jul 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If input format is phylip, the option -p/--phylip should be specified. Otherwise, if --auto-detect is given, goalign tries to detect the input format in the following order: 1) fasta, 2) nexus, 3) phylip, 4) clustal .


cat <<-END_VERSIONS > versions.yml
"${task.process}":
goalign: \$(echo \$(goalign version))
END_VERSIONS
"""
}
32 changes: 32 additions & 0 deletions modules/goalign/cleanseqs/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "goalign_cleanseqs"
description: Filter out poor sequences from a multisequence alignment
keywords:
- multiple sequence alignment
- quality control
tools:
- "goalign":
description: "goalign is a set of command line tools to manipulate multiple alignments"
homepage: "https://github.com/evolbioinfo/goalign"
documentation: "https://github.com/evolbioinfo/goalign/blob/master/docs/index.md"
tool_dev_url: "https://github.com/evolbioinfo/goalign"
doi: "10.1093/nargab/lqab075"
licence: "['GPL v2']"

input:
- aln:
type: file
description: MultiFASTA/Phylip alignment file
pattern: "*.{fasta,phy}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with goalign, but should this be *.{fasta,fas,fa,phy}?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tools also supports compressed inputs, so it should account for those too


output:
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- aln:
type: file
description: MultiFASTA/Phylip alignment file
pattern: "*.{fasta,phy}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pattern: "*.{fasta,phy}"
pattern: "*.{fasta,fas,fa,phy}"

This is what's in the output.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is true, plus as mentioned below, it can be gzipped. So, I have changed the output file to mirror the input file's extension:

 path("*.${aln.getExtension()}"), emit: aln


authors:
- "@andersgs"
4 changes: 4 additions & 0 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,10 @@ goat/taxonsearch:
- modules/nf-core/goat/taxonsearch/**
- tests/modules/nf-core/goat/taxonsearch/**

goalign/cleanseqs:
- modules/goalign/cleanseqs/**
- tests/modules/goalign/cleanseqs/**

graphmap2/align:
- modules/nf-core/graphmap2/align/**
- tests/modules/nf-core/graphmap2/align/**
Expand Down
12 changes: 12 additions & 0 deletions tests/modules/goalign/cleanseqs/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env nextflow

nextflow.enable.dsl = 2

include { GOALIGN_CLEANSEQS } from '../../../../modules/goalign/cleanseqs/main.nf'

workflow test_goalign_cleanseqs {

input = file(params.test_data['sarscov2']['genome']['all_sites_fas'], checkIfExists: true)

GOALIGN_CLEANSEQS ( input )
}
5 changes: 5 additions & 0 deletions tests/modules/goalign/cleanseqs/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
ext.args = "--cutoff 0.05"
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }

}
12 changes: 12 additions & 0 deletions tests/modules/goalign/cleanseqs/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- name: "goalign cleanseqs"
command: nextflow run ./tests/modules/goalign/cleanseqs -entry test_goalign_cleanseqs -c ./tests/config/nextflow.config -c ./tests/modules/goalign/cleanseqs/nextflow.config
tags:
- "goalign"
#
- "goalign/cleanseqs"
#
files:
- path: "output/goalign/all_sites.fas_clean.fas"
md5sum: f7b946d6d5000f83baa401addd7bb26a
- path: output/goalign/versions.yml
md5sum: 2dc17f26bc12547017e2a7eb66ae503f