From 04dfb653354a91928a7417bf201da2eddf99167d Mon Sep 17 00:00:00 2001 From: louperelo <44900284+louperelo@users.noreply.github.com> Date: Mon, 5 Sep 2022 16:51:21 +0200 Subject: [PATCH] Deepbgcdownload (#2010) * deepbgc_download first version * with test.yml * Apply suggestions from code review Co-authored-by: James A. Fellows Yates * Apply suggestions from code review * delete trailing whitespace main.nf Co-authored-by: James A. Fellows Yates --- modules/deepbgc/download/main.nf | 31 +++++++++++++++++ modules/deepbgc/download/meta.yml | 34 +++++++++++++++++++ tests/config/pytest_modules.yml | 4 +++ tests/modules/deepbgc/download/main.nf | 10 ++++++ .../modules/deepbgc/download/nextflow.config | 5 +++ tests/modules/deepbgc/download/test.yml | 30 ++++++++++++++++ 6 files changed, 114 insertions(+) create mode 100644 modules/deepbgc/download/main.nf create mode 100644 modules/deepbgc/download/meta.yml create mode 100644 tests/modules/deepbgc/download/main.nf create mode 100644 tests/modules/deepbgc/download/nextflow.config create mode 100644 tests/modules/deepbgc/download/test.yml diff --git a/modules/deepbgc/download/main.nf b/modules/deepbgc/download/main.nf new file mode 100644 index 00000000..228fbb39 --- /dev/null +++ b/modules/deepbgc/download/main.nf @@ -0,0 +1,31 @@ +process DEEPBGC_DOWNLOAD { + tag "download" + label 'process_low' + + conda (params.enable_conda ? "bioconda::deepbgc=0.1.30" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/deepbgc:0.1.30--pyhb7b1952_1': + 'quay.io/biocontainers/deepbgc:0.1.30--pyhb7b1952_1' }" + + output: + path "deepbgc_db" , emit: db + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + + """ + export DEEPBGC_DOWNLOADS_DIR='./deepbgc_db' + + deepbgc \\ + download + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + deepbgc: \$(echo \$(deepbgc info 2>&1 /dev/null/ | grep 'version' | cut -d " " -f3) ) + END_VERSIONS + """ +} diff --git a/modules/deepbgc/download/meta.yml b/modules/deepbgc/download/meta.yml new file mode 100644 index 00000000..5089142d --- /dev/null +++ b/modules/deepbgc/download/meta.yml @@ -0,0 +1,34 @@ +name: "deepbgc_download" +description: database to detect BGCs in bacterial and fungal genomes using deep learning +keywords: + - database + - download + - BGC + - Biosynthetic Gene Cluster + - deep learning + - neural network + - random forrest + - genomes + - bacteria + - fungi +tools: + - "deepbgc": + description: "DeepBGC - Biosynthetic Gene Cluster detection and classification" + homepage: "https://github.com/Merck/deepbgc" + documentation: "https://github.com/Merck/deepbgc" + tool_dev_url: "https://github.com/Merck/deepbgc" + doi: "10.1093/nar/gkz654" + licence: "['MIT']" + +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - deepbgc_db: + type: directory + description: contains files of reference db from 'deepbgc download' + pattern: "*db" + +authors: + - "@louperelo" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 7926be69..7640b018 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -599,6 +599,10 @@ deeparg/predict: - modules/deeparg/predict/** - tests/modules/deeparg/predict/** +deepbgc/download: + - modules/deepbgc/download/** + - tests/modules/deepbgc/download/** + deeptools/bamcoverage: - modules/deeptools/bamcoverage/** - tests/modules/deeptools/bamcoverage/** diff --git a/tests/modules/deepbgc/download/main.nf b/tests/modules/deepbgc/download/main.nf new file mode 100644 index 00000000..ecf3c9b6 --- /dev/null +++ b/tests/modules/deepbgc/download/main.nf @@ -0,0 +1,10 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { DEEPBGC_DOWNLOAD } from '../../../../modules/deepbgc/download/main.nf' + +workflow test_deepbgc_download { + + DEEPBGC_DOWNLOAD ( ) +} diff --git a/tests/modules/deepbgc/download/nextflow.config b/tests/modules/deepbgc/download/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/deepbgc/download/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/deepbgc/download/test.yml b/tests/modules/deepbgc/download/test.yml new file mode 100644 index 00000000..bae68f67 --- /dev/null +++ b/tests/modules/deepbgc/download/test.yml @@ -0,0 +1,30 @@ +- name: deepbgc download test_deepbgc_download + command: nextflow run ./tests/modules/deepbgc/download -entry test_deepbgc_download -c ./tests/config/nextflow.config -c ./tests/modules/deepbgc/download/nextflow.config + tags: + - deepbgc + - deepbgc/download + files: + - path: output/deepbgc/deepbgc_db/0.1.0/classifier/product_activity.pkl + md5sum: 90f0c010460e9df882cb057664a49f30 + - path: output/deepbgc/deepbgc_db/0.1.0/classifier/product_class.pkl + md5sum: f78a2eda240403d2f40643d42202f3ac + - path: output/deepbgc/deepbgc_db/0.1.0/detector/clusterfinder_geneborder.pkl + md5sum: ca4be7031ae9f70780f17c616a4fa5b5 + - path: output/deepbgc/deepbgc_db/0.1.0/detector/clusterfinder_original.pkl + md5sum: 2ca2429bb9bc99a401d1093c376b37aa + - path: output/deepbgc/deepbgc_db/0.1.0/detector/clusterfinder_retrained.pkl + md5sum: 65679a3b61c562ff4b84bdb574bb6d93 + - path: output/deepbgc/deepbgc_db/0.1.0/detector/deepbgc.pkl + md5sum: 7e9218be79ba45bc9adb23bed3845dc1 + - path: output/deepbgc/deepbgc_db/common/Pfam-A.31.0.clans.tsv + md5sum: a0a4590ffb2b33b83ef2b28f6ead886b + - path: output/deepbgc/deepbgc_db/common/Pfam-A.31.0.hmm + md5sum: 79a3328e4c95b13949a4489b19959fc5 + - path: output/deepbgc/deepbgc_db/common/Pfam-A.31.0.hmm.h3f + md5sum: cbca323cf8dd4e5e7c109114ec444162 + - path: output/deepbgc/deepbgc_db/common/Pfam-A.31.0.hmm.h3i + md5sum: 5242332a3f6a60cd1ab634cd9331afd6 + - path: output/deepbgc/deepbgc_db/common/Pfam-A.31.0.hmm.h3m + md5sum: 1fe946fa2b3bcde1d4b2bad732bce612 + - path: output/deepbgc/deepbgc_db/common/Pfam-A.31.0.hmm.h3p + md5sum: 27b98a1ded123b6a1ef72db01927017c