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

Busco #1239

Merged
merged 32 commits into from
May 6, 2022
Merged

Busco #1239

Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b412e6d
Busco module commit with nf-core v2.2 c1
priyanka-surana Jan 27, 2022
8fdd5ab
Merge branch 'nf-core:master' into busco
priyanka-surana Jan 27, 2022
e55664b
Merge branch 'master' into busco
priyanka-surana Feb 11, 2022
c20f836
Merge branch 'nf-core:master' into busco
priyanka-surana Feb 23, 2022
3cffa96
Merge branch 'master' of https://github.com/nf-core/modules into busco
priyanka-surana Feb 25, 2022
3e6be50
Adjusted Augustus Config Path settings. Suggested by @mahesh-panchal
priyanka-surana Feb 25, 2022
9a72548
Update busco module
mahesh-panchal May 3, 2022
ddbe6e8
Merge branch 'master' into busco
mahesh-panchal May 3, 2022
9eff38f
Update meta.yml
mahesh-panchal May 3, 2022
012f085
Prettier
mahesh-panchal May 3, 2022
57db283
Support batch fasta analysis
mahesh-panchal May 3, 2022
5f4781a
Merge branch 'master' into busco
mahesh-panchal May 3, 2022
636abad
Merge branch 'master' into busco
mahesh-panchal May 3, 2022
4be754b
It's a file, not a directory
muffato May 3, 2022
6351ec7
Update contributor list
muffato May 3, 2022
1c54c0b
Apply suggestions from code review
mahesh-panchal May 3, 2022
f02cd61
Update meta.yml
jvhagey May 3, 2022
3bb0711
Merge branch 'master' into busco
mahesh-panchal May 4, 2022
8df2021
Add more tests and capture summaries
mahesh-panchal May 4, 2022
73a8df9
Fix no genes found test and update test.yml
mahesh-panchal May 4, 2022
f65abe1
Prettier
mahesh-panchal May 4, 2022
5986a3e
Merge branch 'master' into busco
mahesh-panchal May 4, 2022
58ea709
Merge branch 'master' into busco
mahesh-panchal May 5, 2022
865ad34
Update meta.yml output files
mahesh-panchal May 5, 2022
3414d3a
Merge branch 'master' into busco
sateeshperi May 5, 2022
2542ae1
Update modules/busco/main.nf
mahesh-panchal May 5, 2022
1289626
Update modules/busco/main.nf
drpatelh May 5, 2022
faf45ed
Merge branch 'master' into busco
sateeshperi May 5, 2022
35c5828
Add --auto-lineage option and remove single_end
mahesh-panchal May 6, 2022
a9f23bb
Merge branch 'master' into busco
mahesh-panchal May 6, 2022
9fa6b6c
Update meta.yml
mahesh-panchal May 6, 2022
7a85760
remove 'auto' test
mahesh-panchal May 6, 2022
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
54 changes: 54 additions & 0 deletions modules/busco/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
process BUSCO {
tag "$meta.id"
label 'process_medium'

conda (params.enable_conda ? "bioconda::busco=5.2.2" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/busco:5.2.2--pyhdfd78af_0':
'quay.io/biocontainers/busco:5.2.2--pyhdfd78af_0' }"
mahesh-panchal marked this conversation as resolved.
Show resolved Hide resolved

input:
tuple val(meta), path(fasta)
val(mode)
path(augustus_config)
mahesh-panchal marked this conversation as resolved.
Show resolved Hide resolved
val(lineage)
mahesh-panchal marked this conversation as resolved.
Show resolved Hide resolved

output:
tuple val(meta), path("${meta.id}/run_*/full_table.tsv"), emit: tsv
tuple val(meta), path("${meta.id}/run_*/short_summary.txt"), emit: txt
mahesh-panchal marked this conversation as resolved.
Show resolved Hide resolved
path "versions.yml" , emit: versions

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
if (lineage) args += " --lineage_dataset $lineage"
"""
mahesh-panchal marked this conversation as resolved.
Show resolved Hide resolved
# Ensure the input is uncompressed
gzip -cdf $fasta > __UNCOMPRESSED_FASTA_FILE__
mahesh-panchal marked this conversation as resolved.
Show resolved Hide resolved

# Nextflow changes the container --entrypoint to /bin/bash (container default entrypoint: /usr/local/env-execute)
# Check for container variable initialisation script and source it.
if [ -f "/usr/local/env-activate.sh" ]; then
# . "/usr/local/env-activate.sh" # Errors out because of various unbound variables
export PATH='/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
export CONDA_PREFIX='/usr/local'
export CONDA_SHLVL='1'
export CONDA_DEFAULT_ENV='/usr/local'
export CONDA_PROMPT_MODIFIER=''
. "/usr/local/etc/conda/activate.d/activate-r-base.sh"
. "/usr/local/etc/conda/activate.d/augustus.sh"
. "/usr/local/etc/conda/activate.d/openjdk_activate.sh"
mahesh-panchal marked this conversation as resolved.
Show resolved Hide resolved
fi

# Copy the image's AUGUSTUS config directory if it was not provided to the module
[ ! -e augustus_config ] && cp -a /usr/local/config augustus_config
mahesh-panchal marked this conversation as resolved.
Show resolved Hide resolved

# Busco command
AUGUSTUS_CONFIG_PATH=augustus_config busco $args --augustus --mode $mode --cpu $task.cpus --in __UNCOMPRESSED_FASTA_FILE__ --out $meta.id
mahesh-panchal marked this conversation as resolved.
Show resolved Hide resolved

cat <<-END_VERSIONS > versions.yml
"${task.process}":
busco: \$( busco --version 2>&1 | sed 's/^BUSCO //' )
END_VERSIONS
"""
}
55 changes: 55 additions & 0 deletions modules/busco/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: busco
description: Benchmarking Universal Single Copy Orthologs
keywords:
- quality control
- genome
- transcriptome
- proteome
tools:
- busco:
description: BUSCO provides measures for quantitative assessment of genome assembly, gene set, and transcriptome completeness based on evolutionarily informed expectations of gene content from near-universal single-copy orthologs selected from OrthoDB.
homepage: https://busco.ezlab.org/
documentation: https://busco.ezlab.org/busco_userguide.html
tool_dev_url: https://gitlab.com/ezlab/busco
doi: "10.1007/978-1-4939-9173-0_14"
licence: ['MIT']

input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- fasta:
type: file
description: Nucleic or amino acid sequence file in FASTA format
pattern: "*.{fasta}"
- mode:
type: value
description: Sets the assessment MODE – genome, proteins, transcriptome
- augustus_config:
type: directory
description: AUGUSTUS config directory

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"
- tsv:
type: file
description: Full summary table
pattern: "*.{tsv}"
- txt:
type: file
description: Short summary text
pattern: "*.{txt}"

authors:
- "@priyanka-surana"
- "@charles-plessy"
4 changes: 4 additions & 0 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@ bowtie2/build:
- modules/bowtie2/build/**
- tests/modules/bowtie2/build_test/**

busco:
- modules/busco/**
- tests/modules/busco/**

bwa/aln:
- modules/bwa/aln/**
- tests/modules/bwa/aln/**
Expand Down
15 changes: 15 additions & 0 deletions tests/modules/busco/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env nextflow

nextflow.enable.dsl = 2

include { BUSCO as BUSCO_BACTE } from '../../../modules/busco/main.nf'

// This tests genome decompression, empty input channels and data download
workflow test_busco {
mahesh-panchal marked this conversation as resolved.
Show resolved Hide resolved
input = [ [ id:'test' ], file(params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true) ]
BUSCO_BACTE ( input,
"genome",
[],
[] )
}

5 changes: 5 additions & 0 deletions tests/modules/busco/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {

publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }

}
10 changes: 10 additions & 0 deletions tests/modules/busco/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- name: busco test_busco
command: nextflow run ./tests/modules/busco -entry test_busco -c ./tests/config/nextflow.config -c ./tests/modules/busco/nextflow.config
tags:
- busco
files:
- path: output/busco/test/run_bacteroidales_odb10/full_table.tsv
md5sum: 8d7b401d875ecd9291b01bf4485bf080
- path: output/busco/test/run_bacteroidales_odb10/short_summary.txt
contains: ['Complete BUSCOs (C)']
muffato marked this conversation as resolved.
Show resolved Hide resolved