Skip to content

Commit

Permalink
Merge pull request #226 from skrakau/fix_busco_issue
Browse files Browse the repository at this point in the history
Fix handling of BUSCO output with auto lineage selection
  • Loading branch information
skrakau authored Jul 28, 2021
2 parents 481a002 + c5cd2f7 commit 2fecf1f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- [#218](https://github.com/nf-core/mag/pull/218) - Update to nf-core 2.0.1 `TEMPLATE` (DSL2)

### `Fixed`

- [#226](https://github.com/nf-core/mag/pull/226) - Fix handling of `BUSCO` output when run in auto lineage selection mode and selected specific lineage is the same as the generic one.

## v2.0.0 - 2021/06/01

### `Added`
Expand Down
17 changes: 10 additions & 7 deletions modules/local/busco.nf
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,18 @@ process BUSCO {
echo "Domain and specific lineage could be selected by BUSCO."
cp BUSCO/short_summary.specific.\${db_name_spec}.BUSCO.txt short_summary.specific_lineage.\${db_name_spec}.${bin}.txt
db_name_gen=""
summaries_gen=(BUSCO/short_summary.generic.*.BUSCO.txt)
if [ \${#summaries_gen[@]} -ne 1 ]; then
echo "ERROR: none or multiple 'BUSCO/short_summary.generic.*.BUSCO.txt' files found. Expected one."
exit 1
if [ \${#summaries_gen[@]} -lt 1 ]; then
echo "No 'BUSCO/short_summary.generic.*.BUSCO.txt' file found. Assuming selected domain and specific lineages are the same."
cp BUSCO/short_summary.specific.\${db_name_spec}.BUSCO.txt short_summary.domain.\${db_name_spec}.${bin}.txt
db_name_gen=\${db_name_spec}
else
[[ \$summaries_gen =~ BUSCO/short_summary.generic.(.*).BUSCO.txt ]];
db_name_gen="\${BASH_REMATCH[1]}"
echo "Used generic lineage dataset: \${db_name_gen}"
cp BUSCO/short_summary.generic.\${db_name_gen}.BUSCO.txt short_summary.domain.\${db_name_gen}.${bin}.txt
fi
[[ \$summaries_gen =~ BUSCO/short_summary.generic.(.*).BUSCO.txt ]];
db_name_gen="\${BASH_REMATCH[1]}"
echo "Used generic lineage dataset: \${db_name_gen}"
cp BUSCO/short_summary.generic.\${db_name_gen}.BUSCO.txt short_summary.domain.\${db_name_gen}.${bin}.txt
for f in BUSCO/run_\${db_name_gen}/busco_sequences/single_copy_busco_sequences/*faa; do
cat BUSCO/run_\${db_name_gen}/busco_sequences/single_copy_busco_sequences/*faa | gzip >${bin}_buscos.\${db_name_gen}.faa.gz
Expand Down

0 comments on commit 2fecf1f

Please sign in to comment.