Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Annosine #1

Merged
merged 3 commits into from
Apr 3, 2024
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ jobs:
NFT_DIFF: "pdiff"
NFT_DIFF_ARGS: "--line-numbers --width 120 --expand-tabs=2"
run: |
PROFILE=${{ matrix.profile }}
NFT_WORKDIR=~ \
nf-test test \
--profile=$PROFILE \
Expand Down
22 changes: 22 additions & 0 deletions cleanNXF.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

rm -rf .nextflow*
echo "Cleaned .nextflow..."
rm -rf .nextflow.pid
echo "Cleaned .nextflow.pid..."
for i in $(ls work | grep -v "conda");
do
rm -rf "work/$i"
done
echo "Cleaned work..."

rm -rf output
echo "Cleaned output..."

rm -rf .pytest_cache
echo "Cleaned .pytest_cache..."

rm -rf .nf-test
echo "Cleaned .nf-test..."

rm -rf ./.nf-test.log
9 changes: 9 additions & 0 deletions modules/edta-components/annosine/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
name: "annosine"
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- "bioconda::annosine2=2.0.7"
58 changes: 58 additions & 0 deletions modules/edta-components/annosine/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
process ANNOSINE {
tag "$meta.id"
label 'process_high'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/annosine2:2.0.7--pyh7cba7a3_0':
'biocontainers/annosine2:2.0.7--pyh7cba7a3_0' }"

input:
tuple val(meta), path(fasta)
val mode

output:
tuple val(meta), path("*.fa") , emit: fa , optional: true
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}"
def VERSION = '2.0.7' // WARN: Manually update when changing Bioconda assets
if ( "$fasta" == "${prefix}.fa" ) error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!"
"""
AnnoSINE_v2 \\
$args \\
--threads $task.cpus \\
$mode \\
$fasta \\
$prefix

mv \\
$prefix/Seed_SINE.fa \\
${prefix}.fa \\
|| echo 'AnnoSINE_v2 did not find SINE sequences. See log for details!'

cat <<-END_VERSIONS > versions.yml
"${task.process}":
annosine: $VERSION
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = '2.0.7' // WARN: Manually update when changing Bioconda assets
if ( "$fasta" == "${prefix}.fa" ) error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!"
"""
touch ${prefix}.fa

cat <<-END_VERSIONS > versions.yml
"${task.process}":
annosine: $VERSION
END_VERSIONS
"""
}
50 changes: 50 additions & 0 deletions modules/edta-components/annosine/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "annosine"
description: Accelerating de novo SINE annotation in plant and animal genomes
keywords:
- genomics
- SINE
- annotation
- plant
tools:
- "annosine":
description: "AnnoSINE_v2 - SINE Annotation Tool for Plant and Animal Genomes"
homepage: "https://github.com/liaoherui/AnnoSINE_v2"
documentation: "https://github.com/liaoherui/AnnoSINE_v2"
tool_dev_url: "https://github.com/liaoherui/AnnoSINE_v2"
doi: "10.1101/2024.03.01.582874"
licence: ["MIT"]

input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- fasta:
type: file
description: Input genome assembly
pattern: "*.{fasta,fa,fsa}"
- mode:
type: integer
description: Run mode

output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- fa:
type: file
description: Non-redundant SINE library with serial number
pattern: "*.fa"
authors:
- "@GallVp"
maintainers:
- "@GallVp"
61 changes: 61 additions & 0 deletions modules/edta-components/annosine/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
nextflow_process {

name "Test Process ANNOSINE"
script "../main.nf"
process "ANNOSINE"

tag "modules"
tag "modules_nfcore"
tag "annosine"

test("actinidia_chinensis-genome_21_fasta_gz") {

config './nextflow.config'

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['actinidia_chinensis']['genome']['genome_21_fasta_gz'], checkIfExists: true)
]
input[1] = 3
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}

test("actinidia_chinensis-genome_21_fasta_gz-stub") {

options '-stub'

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['actinidia_chinensis']['genome']['genome_21_fasta_gz'], checkIfExists: true)
]
input[1] = 3
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}

}
72 changes: 72 additions & 0 deletions modules/edta-components/annosine/tests/main.nf.test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions modules/edta-components/annosine/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: ANNOSINE {
ext.args = '-a 2 -rpm 0 --copy_number 1 --shift 200'
}
}
2 changes: 2 additions & 0 deletions modules/edta-components/annosine/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
annosine:
- "modules/edta-components/annosine/**"
4 changes: 2 additions & 2 deletions tests/config/test_data.config
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ params {
kofamscan_ko_list_gz = "${params.test_data_base}/data/genomics/sarscov2/genome/db/kofamscan/ko_list.gz"

metamaps_db = "${params.test_data_base}/data/genomics/sarscov2/genome/db/metamaps_db.tar.gz"

ncbi_taxmap_zip = "${params.test_data_base}/data/genomics/sarscov2/genome/db/maltextract/ncbi_taxmap.zip"
taxon_list_txt = "${params.test_data_base}/data/genomics/sarscov2/genome/db/maltextract/taxon_list.txt"

Expand Down Expand Up @@ -655,7 +655,7 @@ params {
'genome' {
samplesheet = "${params.test_data_base}/data/genomics/eukaryotes/saccharomyces_cerevisiae/samplesheet.csv"
genome_gfp_gtf = "${params.test_data_base}/data/genomics/eukaryotes/saccharomyces_cerevisiae/genome_gfp.gtf"
kallisto_results = "${params.test_data_base}/data/genomics/eukaryotes/saccharomyces_cerevisiae/kallisto_results.tar.gz"
kallisto_results = "${params.test_data_base}/data/genomics/eukaryotes/saccharomyces_cerevisiae/kallisto_results.tar.gz"
salmon_results = "${params.test_data_base}/data/genomics/eukaryotes/saccharomyces_cerevisiae/salmon_results.tar.gz"
}
}
Expand Down
Loading