-
Notifications
You must be signed in to change notification settings - Fork 11
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 #88 from Eco-Flow/agat_longest_isoform
WIP: Add longest and nf-core GFFREAD modules
- Loading branch information
Showing
15 changed files
with
465 additions
and
66 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
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
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,32 @@ | ||
process EXTRACT_SEQS { | ||
tag "$meta.id" | ||
label 'process_low' | ||
//label 'process_med_memory' | ||
|
||
container = 'community.wave.seqera.io/library/agat:1.4.1--304a47c62ae478b4' | ||
|
||
input: | ||
tuple val (meta), path(fasta) | ||
tuple val (meta), path(gff) | ||
|
||
output: | ||
tuple val (meta), path( "${meta.id}.prot.fasta" ), emit: prot_fasta | ||
path "versions.yml" , emit: versions | ||
|
||
script: | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
# Extract protein from filtered GFF and genome | ||
agat_sp_extract_sequences.pl \\ | ||
-g ${gff} \\ | ||
-f ${fasta} \\ | ||
-p -o ${prefix}.prot.fasta --clean_final_stop | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
Perl version: \$(perl --version | grep "version" | sed 's/.*(//g' | sed 's/[)].*//') | ||
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
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,7 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
dependencies: | ||
- "bioconda::py_fasta_validator=0.6" |
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,62 @@ | ||
process FASTAVALIDATOR { | ||
tag "$meta.id" | ||
label 'process_single' | ||
|
||
conda "${moduleDir}/environment.yml" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/py_fasta_validator:0.6--py37h595c7a6_0': | ||
'biocontainers/py_fasta_validator:0.6--py37h595c7a6_0' }" | ||
|
||
input: | ||
tuple val(meta), path(fasta) | ||
|
||
output: | ||
tuple val(meta), path('*.success.log') , emit: success_log , optional: true | ||
tuple val(meta), path('*.error.log') , emit: error_log , optional: true | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
py_fasta_validator \\ | ||
-f $fasta \\ | ||
2> "${prefix}.error.log" \\ | ||
|| echo "Errors from fasta_validate printed to ${prefix}.error.log" | ||
if [ \$(cat "${prefix}.error.log" | wc -l) -gt 0 ]; then | ||
echo "Validation failed..." | ||
cat \\ | ||
"${prefix}.error.log" | ||
else | ||
echo "Validation successful..." | ||
mv \\ | ||
"${prefix}.error.log" \\ | ||
fasta_validate.stderr | ||
echo "Validation successful..." \\ | ||
> "${prefix}.success.log" | ||
fi | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
py_fasta_validator: \$(py_fasta_validator -v | sed 's/.* version //') | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
echo "Validation successful..." \\ | ||
> "${prefix}.success.log" | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
py_fasta_validator: \$(py_fasta_validator -v | sed 's/.* 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,61 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||
name: "fastavalidator" | ||
description: | | ||
"Python C-extension for a simple validator for fasta files. The module emits the validated file or an | ||
error log upon validation failure." | ||
keywords: | ||
- fasta | ||
- validation | ||
- genome | ||
tools: | ||
- fasta_validate: | ||
description: | | ||
"Python C-extension for a simple C code to validate a fasta file. It only checks a few things, | ||
and by default only sets its response via the return code, | ||
so you will need to check that!" | ||
homepage: "https://github.com/linsalrob/py_fasta_validator" | ||
documentation: "https://github.com/linsalrob/py_fasta_validator" | ||
tool_dev_url: "https://github.com/linsalrob/py_fasta_validator" | ||
doi: "10.5281/zenodo.5002710" | ||
licence: ["MIT"] | ||
identifier: "" | ||
input: | ||
- - meta: | ||
type: map | ||
description: | | ||
Groovy Map containing file information | ||
e.g. [ id:'test' ] | ||
- fasta: | ||
type: file | ||
description: Input fasta file | ||
pattern: "*.fasta" | ||
output: | ||
- success_log: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing file information | ||
e.g. [ id:'test' ] | ||
- "*.success.log": | ||
type: file | ||
description: Log file for successful validation | ||
pattern: "*.success.log" | ||
- error_log: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing file information | ||
e.g. [ id:'test' ] | ||
- "*.error.log": | ||
type: file | ||
description: Log file for failed validation | ||
pattern: "*.error.log" | ||
- versions: | ||
- versions.yml: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
authors: | ||
- "@gallvp" | ||
maintainers: | ||
- "@gallvp" |
Oops, something went wrong.