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

Update summarize_barrnap.py #722

Merged
merged 4 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#717](https://github.com/nf-core/ampliseq/pull/717) - Fix edge case for sorting file names by using radix method
- [#718](https://github.com/nf-core/ampliseq/pull/718) - Require a minimum sequence length of 50bp for taxonomic classifcation after using ITSx
- [#721](https://github.com/nf-core/ampliseq/pull/721) - Fix error `unknown recognition error type: groovyjarjarantlr4.v4.runtime.LexerNoViableAltException` caused by a missing `\` in nf-core module `pigz/uncompress` (which had no consequences but was confusing)
- [#722](https://github.com/nf-core/ampliseq/pull/722) - When barrnap detects several genes select the lowest e-value

### `Dependencies`

Expand Down
6 changes: 4 additions & 2 deletions bin/summarize_barrnap.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# Takes a list of files with barrnap predictions (rrna.arc.gff, rrna.bac.gff, etc)
# for ASV sequences, extracts evalues for each prediction and summarize the results
# in a new file "summary.gff". Assumes that the same program/barrnap version is
# used for all predictions.
# used for all predictions. If there is more than one gene for a given domain,
# retains the lowest e-value (case of full rRNA operon sequences).

# import pandas as pd
import sys
Expand All @@ -27,7 +28,8 @@
method[asv] = rowparts[1]
if asv not in evalues:
evalues[asv] = dict()
evalues[asv][org] = rowparts[5]
if (org not in evalues[asv]) or (float(evalues[asv][org]) > float(rowparts[5])):
evalues[asv][org] = rowparts[5]
fh.close()

# Write results
Expand Down
Loading