pybarrnap

Python implementation of barrnap (Bacterial ribosomal RNA predictor)

https://github.com/moshi4/pybarrnap

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.5%) to scientific vocabulary

Keywords

bioinformatics genome-annotation genomics microbial-genomics microbiology python rna
Last synced: 4 months ago · JSON representation ·

Repository

Python implementation of barrnap (Bacterial ribosomal RNA predictor)

Basic Info
  • Host: GitHub
  • Owner: moshi4
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 21.1 MB
Statistics
  • Stars: 22
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 8
Topics
bioinformatics genome-annotation genomics microbial-genomics microbiology python rna
Created almost 2 years ago · Last pushed 12 months ago
Metadata Files
Readme License Citation

README.md

pybarrnap: Python implementation of barrnap

Python3 OS License Latest PyPI version Bioconda CI

Table of contents

Overview

pybarrnap is a python implementation of barrnap (Bacterial ribosomal RNA predictor). pybarrnap provides a CLI compatible with barrnap and also provides a python API for running rRNA prediction and retrieving predicted rRNA. pybarrnap default mode depends only on the python library and not on the external command-line tools nhmmer and bedtools. As an additional feature from barrnap, accurate mode is available by installing the external command-line tool cmscan(infernal).

[!NOTE] Barrnap v0.9 uses the HMM profile database created from older releases of Rfam and SILVA. On the other hand, pybarrnap default mode uses the HMM profile database created from the Rfam(14.10). Therefore, there will be some differences in results between Barrnap v0.9 and pybarrnap default mode.

Installation

Python 3.9 or later is required for installation. pybarrnap depends on pyhmmer and biopython python library. If accurate mode is required, please install infernal additionally.

Install PyPI package:

pip install pybarrnap

Install bioconda package:

conda install -c conda-forge -c bioconda pybarrnap

Use Docker (Image Registry):

docker run -it --rm ghcr.io/moshi4/pybarrnap:latest pybarrnap -h

CLI Usage

Basic Command

pybarrnap genome.fna > genome_rrna.gff

Options

$ pybarrnap --help
usage: pybarrnap [options] genome.fna[.gz] > genome_rrna.gff

Python implementation of barrnap (Bacterial ribosomal RNA predictor)

positional arguments:
  fasta              Input fasta file (or stdin)

optional arguments:
  -e , --evalue      E-value cutoff (default: 1e-06)
  -l , --lencutoff   Proportional length threshold to label as partial (default: 0.8)
  -r , --reject      Proportional length threshold to reject prediction (default: 0.25)
  -t , --threads     Number of threads (default: 1)
  -k , --kingdom     Target kingdom [bac|arc|euk|all] (default: 'bac')
                     kingdom='all' is available only when set with `--accurate` option
  -o , --outseq      Output rRNA hit seqs as fasta file (default: None)
  -i, --incseq       Include FASTA input sequences in GFF output (default: OFF)
  -a, --accurate     Use cmscan instead of pyhmmer.nhmmer (default: OFF)
  -q, --quiet        No print log on screen (default: OFF)
  -v, --version      Print version information
  -h, --help         Show this help message and exit

[!TIP] If --accurate option is set, cmscan(infernal) is used for rRNA search instead of pyhmmer.nhmmer. Although cmscan is slower than pyhmmer.nhmmer, it is expected to give more accurate results because it performs rRNA searches using RNA secondary structure profiles.

CLI Example

Click here to download examples dataset.

CLI Example 1

Print rRNA prediction result on screen

pybarrnap examples/bacteria.fna

CLI Example 2

Output rRNA predition result to file

pybarrnap examples/archaea.fna -k arc --outseq rrna.fna --incseq > rrna_incseq.gff

CLI Example 3

With pipe stdin

cat examples/fungus.fna | pybarrnap -q -k euk | grep 28S

API Usage

pybarrnap provides simple API for running rRNA prediction and retrieving predicted rRNA.

Open In Colab

```python from pybarrnap import Barrnap from pybarrnap.utils import loadexamplefasta_file

Get example fasta file path

fastafile = loadexamplefastafile("bacteria.fna")

Run pybarrnap rRNA prediction

barrnap = Barrnap( fasta_file, evalue=1e-6, lencutoff=0.8, reject=0.25, threads=1, kingdom="bac", accurate=False, quiet=False, ) result = barrnap.run()

Output rRNA GFF file

result.writegff("bacteriarrna.gff")

Output rRNA GFF file (Include input fasta sequence)

result.writegff("bacteriarrna_incseq.gff", incseq=True)

Output rRNA fasta file

result.writefasta("bacteriarrna.fna")

Get rRNA GFF text and print

print("\n========== Print rRNA GFF ==========") print(result.getgfftext())

Get rRNA features and print

print("\n========== Print rRNA features ==========") for rec in result.seq_records: for feature in rec.features: print(feature.id, feature.type, feature.location, feature.qualifiers)

Get rRNA sequences and print

print("\n========== Print rRNA sequences ==========") for rec in result.getrrnaseq_records(): print(f">{rec.id}\n{rec.seq}") ```

LICENSE

pybarrnap was reimplemented in python based on the perl implementation of Barrnap v0.9. HMM(Hidden Marcov Model) and CM(Covariance Model) profile database for pybarrnap was created from Rfam(14.10).

Owner

  • Name: moshi
  • Login: moshi4
  • Kind: user

Web Developer / Bioinformatics / GIS

Citation (CITATION.cff)

cff-version: 1.2.0
message: If you use this software, please cite it as below.
authors:
  - family-names: Shimoyama
    given-names: Yuki
title: "pybarrnap: Python implementation of barrnap"
date-released: 2024-01-24
url: https://github.com/moshi4/pybarrnap

GitHub Events

Total
  • Release event: 1
  • Watch event: 9
  • Delete event: 1
  • Push event: 2
  • Pull request event: 2
  • Create event: 2
Last Year
  • Release event: 1
  • Watch event: 9
  • Delete event: 1
  • Push event: 2
  • Pull request event: 2
  • Create event: 2

Committers

Last synced: almost 2 years ago

All Time
  • Total Commits: 3
  • Total Committers: 2
  • Avg Commits per committer: 1.5
  • Development Distribution Score (DDS): 0.333
Past Year
  • Commits: 3
  • Committers: 2
  • Avg Commits per committer: 1.5
  • Development Distribution Score (DDS): 0.333
Top Committers
Name Email Commits
moshi s****1@g****m 2
moshi 4****4 1

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 1
  • Total pull requests: 10
  • Average time to close issues: 4 days
  • Average time to close pull requests: 23 minutes
  • Total issue authors: 1
  • Total pull request authors: 2
  • Average comments per issue: 4.0
  • Average comments per pull request: 0.3
  • Merged pull requests: 10
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: less than a minute
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • althonos (1)
Pull Request Authors
  • moshi4 (14)
  • althonos (2)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 29 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 8
  • Total maintainers: 1
pypi.org: pybarrnap

Python implementation of barrnap (Bacterial ribosomal RNA predictor)

  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 29 Last month
Rankings
Dependent packages count: 10.0%
Average: 37.9%
Dependent repos count: 65.8%
Maintainers (1)
Last synced: 5 months ago

Dependencies

.github/workflows/ci.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/publish_to_pypi.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
pyproject.toml pypi
  • ipykernel >=6.13.0 develop
  • pytest >=7.1.2 develop
  • pytest-cov >=4.0.0 develop
  • ruff >=0.1.6 develop
  • biopython >=1.79
  • pyhmmer >=0.10.4
  • python ^3.8
.github/workflows/push_docker_image.yml actions
  • actions/checkout v4 composite
  • docker/build-push-action v5 composite
  • docker/login-action v3 composite
Dockerfile docker
  • python 3.11-slim build