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 22 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
83 changes: 83 additions & 0 deletions modules/busco/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
process BUSCO {
tag "$meta.id"
label 'process_medium'

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

input:
tuple val(meta), path(fasta, stageAs: 'tmp_input/*') // Required: meta map, and fasta sequence files
each lineage // Required: lineage to check against
muffato marked this conversation as resolved.
Show resolved Hide resolved
path busco_lineages_path // Recommended: path to busco lineages - downloads if not set
path config_file // Optional: busco configuration file
mahesh-panchal marked this conversation as resolved.
Show resolved Hide resolved

output:
tuple val(meta), path("*-busco.batch_summary.txt"), emit: batch_summary
tuple val(meta), path("short_summary.*.txt") , emit: short_summaries_txt, optional: true
tuple val(meta), path("short_summary.*.json") , emit: short_summaries_json, optional: true
tuple val(meta), path("*-busco") , emit: busco_dir
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}-${lineage}"
def busco_config = config_file ? "--config $config_file" : ''
def busco_lineage_dir = busco_lineages_path ? "--offline --download_path ${busco_lineages_path}" : ''
"""
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
set +u # Otherwise, errors out because of various unbound variables
. "/usr/local/env-activate.sh"
set -u
fi

# If the augustus config directory is not writable, then copy to writeable area
if [ ! -w "\${AUGUSTUS_CONFIG_PATH}" ]; then
# Create writable tmp directory for augustus
AUG_CONF_DIR=\$( mktemp -d -p \$PWD )
cp -r \$AUGUSTUS_CONFIG_PATH/* \$AUG_CONF_DIR
export AUGUSTUS_CONFIG_PATH=\$AUG_CONF_DIR
echo "New AUGUSTUS_CONFIG_PATH=\${AUGUSTUS_CONFIG_PATH}"
fi

# Ensure the input is uncompressed
INPUT_SEQS=input_seqs
mkdir "\$INPUT_SEQS"
cd "\$INPUT_SEQS"
for FASTA in ../tmp_input/*; do
if [ "\${FASTA##*.}" == 'gz' ]; then
gzip -cdf "\$FASTA" > \$( basename "\$FASTA" .gz )
else
ln -s "\$FASTA" .
fi
done
cd ..

jvhagey marked this conversation as resolved.
Show resolved Hide resolved
busco \\
--cpu $task.cpus \\
--in "\$INPUT_SEQS" \\
--out ${prefix}-busco \\
--lineage_dataset $lineage \\
mahesh-panchal marked this conversation as resolved.
Show resolved Hide resolved
$busco_lineage_dir \\
$busco_config \\
$args

# clean up
rm -rf "\$INPUT_SEQS"

# Move files to avoid staging/publishing issues
mv ${prefix}-busco/batch_summary.txt ${prefix}-busco.batch_summary.txt
mv ${prefix}-busco/*/short_summary.*.{json,txt} . || echo "Short summaries were not available: No genes were found."

cat <<-END_VERSIONS > versions.yml
"${task.process}":
busco: \$( busco --version 2>&1 | sed 's/^BUSCO //' )
END_VERSIONS
"""
}
57 changes: 57 additions & 0 deletions modules/busco/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
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,fna,fa,fasta.gz,fna.gz,fa.gz}"
- lineage:
type: value
description: The BUSCO lineage to use.
- busco_lineages_path:
type: directory
description: Path to local BUSCO lineages directory.
- config_file:
type: file
description: Path to BUSCO config file.

output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- busco_dir:
type: directory
description: BUSCO lineage specific output
pattern: "*-busco"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"

authors:
- "@priyanka-surana"
- "@charles-plessy"
- "@mahesh-panchal"
muffato marked this conversation as resolved.
Show resolved Hide resolved
- "@muffato"
- "@jvhagey"
4 changes: 4 additions & 0 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ bracken/bracken:
- modules/bracken/bracken/**
- tests/modules/bracken/bracken/**

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

bwa/aln:
- modules/bwa/aln/**
- tests/modules/bwa/aln/**
Expand Down
Loading