mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 11:08:17 +00:00
Support batch fasta analysis
This commit is contained in:
parent
012f085378
commit
57db28386e
2 changed files with 21 additions and 9 deletions
|
@ -8,10 +8,10 @@ process BUSCO {
|
||||||
'quay.io/biocontainers/busco:5.3.2--pyhdfd78af_0' }"
|
'quay.io/biocontainers/busco:5.3.2--pyhdfd78af_0' }"
|
||||||
|
|
||||||
input:
|
input:
|
||||||
tuple val(meta), path(fasta) // Required: meta map, and fasta sequence file
|
tuple val(meta), path(fasta, stageAs: 'tmp_input/*') // Required: meta map, and fasta sequence files
|
||||||
each lineage // Required: lineage to check against
|
each lineage // Required: lineage to check against
|
||||||
path busco_lineages_path // Recommended: path to busco lineages - downloads if not set
|
path busco_lineages_path // Recommended: path to busco lineages - downloads if not set
|
||||||
path config_file // Optional: busco configuration file
|
path config_file // Optional: busco configuration file
|
||||||
|
|
||||||
output:
|
output:
|
||||||
tuple val(meta), path("*-busco"), emit: busco_dir
|
tuple val(meta), path("*-busco"), emit: busco_dir
|
||||||
|
@ -50,11 +50,21 @@ process BUSCO {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Ensure the input is uncompressed
|
# Ensure the input is uncompressed
|
||||||
gzip -cdf $fasta > ${prefix}_uncompressed.fasta
|
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 ..
|
||||||
|
|
||||||
busco \\
|
busco \\
|
||||||
--cpu $task.cpus \\
|
--cpu $task.cpus \\
|
||||||
--in ${prefix}_uncompressed.fasta \\
|
--in "\$INPUT_SEQS" \\
|
||||||
--out ${prefix}-busco \\
|
--out ${prefix}-busco \\
|
||||||
--lineage_dataset $lineage \\
|
--lineage_dataset $lineage \\
|
||||||
$busco_lineage_dir \\
|
$busco_lineage_dir \\
|
||||||
|
@ -62,7 +72,7 @@ process BUSCO {
|
||||||
$args
|
$args
|
||||||
|
|
||||||
# clean up
|
# clean up
|
||||||
rm ${prefix}_uncompressed.fasta
|
rm -rf "\$INPUT_SEQS"
|
||||||
|
|
||||||
cat <<-END_VERSIONS > versions.yml
|
cat <<-END_VERSIONS > versions.yml
|
||||||
"${task.process}":
|
"${task.process}":
|
||||||
|
|
|
@ -9,7 +9,10 @@ workflow test_busco {
|
||||||
|
|
||||||
input = [
|
input = [
|
||||||
[ id:'test', single_end:false ], // meta map
|
[ id:'test', single_end:false ], // meta map
|
||||||
file( params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true)
|
[
|
||||||
|
file( params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true),
|
||||||
|
file( params.test_data['candidatus_portiera_aleyrodidarum']['genome']['genome_fasta'], checkIfExists: true)
|
||||||
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
BUSCO (
|
BUSCO (
|
||||||
|
@ -20,4 +23,3 @@ workflow test_busco {
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue