Skip to main content

A Python port of ABRicate, a tool for mass screening of contigs for antibiotic resistance and virulence genes.

Project description

💊 PyABRicate Stars

Pure Python port and interface to ABRicate, a tool for mass screening of contigs for antimicrobial resistance or virulence genes.

Actions Coverage License PyPI Bioconda AUR Wheel Python Versions Python Implementations Source Mirror GitHub issues Docs Changelog Downloads

🗺️ Overview

ABRicate is a Perl command-line tool wrapping BLAST+ to perform screening of contigs for antimicrobial resistance or virulence genes. It comes bundled with multiple databases: NCBI, CARD, ARG-ANNOT, Resfinder, MEGARES, EcOH, PlasmidFinder, Ecoli_VF and VFDB.

pyabricate is a pure-Python, batteries-included port of ABRicate, using the NCBI C++ Toolkit interface wrapped in pyncbitk to provide BLAST+ rather than using the BLAST+ binaries. It bundles the ABRIcate databases so that no additional data or dependencies are needed.

🔧 Installing

This project is supported on Python 3.7 and later.

PyABRicate can be installed directly from PyPI, which hosts some pure-Python wheels that also bundle the ABRicate databases.

$ pip install pyabricate

💡 Example

The command line of the original abricate script can be executed with a similar interface from a shell, and produces the same sort of table output:

$ pyabricate assembly.fa --mincov 50 --minid 50 --db ncbi
assembly.fa	LGJG01000041	35416	35844	-	fosB-251804940	1-429/429	===============	0/0	100.00	100.00	ncbi	NG_047889.1	FosB family fosfomycin resistance bacillithiol transferase
	FOSFOMYCIN
assembly.fa	LGJG01000040	190796	191281	+	dfrC	1-486/486	===============	0/0	100.00	99.59	ncbi	NG_047752.1	trimethoprim-resistant dihydrofolate reductase DfrC
	TRIMETHOPRIM
assembly.fa	LGJG01000038	62786	64543	-	blaR1	1-1758/1758	===============	0/0	100.00	92.83	ncbi	NG_047539.1	beta-lactam sensor/signal transducer BlaR1
	BETA-LACTAM
assembly.fa	LGJG01000038	64650	65495	+	blaZ	1-846/846	===============	0/0	100.00	96.81	ncbi	NG_055999.1	penicillin-hydrolyzing class A beta-lactamase BlaZ
	BETA-LACTAM
assembly.fa	LGJG01000038	62416	62796	-	blaI_of_Z	1-381/381	===============	0/0	100.00	95.28	ncbi	NG_047499.1	penicillinase repressor BlaI
	BETA-LACTAM

However, pyabricate also features an API which can be used to programmatically annotate any sequence:

import pyabricate

database = pyabricate.Database.from_name("ncbi")
abricate = pyabricate.ResistanceGeneFinder(database, min_coverage=50, min_identity=50)
sequence = "ATATTA..." # sequence in string format

for hit in abricate.find_genes(sequence):
    print(
        hit.gene.name, # resistance / virulence gene
        hit.alignment[0].start, # start coordinate in query sequence
        hit.alignment[0].stop,  # stop coordinate in query sequence
        hit.percent_coverage,
        hit.percent_identity
    )

The returned Hit objects contain all the information needed to build the table output in an object-oriented interface. ResistanceGeneFinder.find_genes accepts sequences as Python strings, which can be loaded with any other library such as Biopython.

💭 Feedback

⚠️ Issue Tracker

Found a bug ? Have an enhancement request ? Head over to the GitHub issue tracker if you need to report or ask something. If you are filing in on a bug, please include as much information as you can about the issue, and try to recreate the same bug in a simple, easily reproducible situation.

🏗️ Contributing

Contributions are more than welcome! See CONTRIBUTING.md for more details.

📋 Changelog

This project adheres to Semantic Versioning and provides a changelog in the Keep a Changelog format.

⚖️ License

This library is provided under the GNU General Public License 3.0 or later. ABRicate was developed by Torsten Seemann and is redistributed under the terms of the GNU General Public License 2.0, see vendor/abricate/LICENSE.

This project is in no way not affiliated, sponsored, or otherwise endorsed by the original ABRIcate authors. It was developed by Martin Larralde during his PhD at the Leiden University Medical Center in the Zeller team.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyabricate-0.1.0.tar.gz (9.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyabricate-0.1.0-py3-none-any.whl (4.1 MB view details)

Uploaded Python 3

File details

Details for the file pyabricate-0.1.0.tar.gz.

File metadata

  • Download URL: pyabricate-0.1.0.tar.gz
  • Upload date:
  • Size: 9.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyabricate-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6c06e642d1bc671df95bfc73a0b01b62ab02e5828a844391449d59a9e09c3b83
MD5 b1e34d0e3cbd708a8d30252b37dd544d
BLAKE2b-256 57b9b0ca134b5fcfef8657b5f499058742d0e026ae2ee5e2040cce85a4fd008d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyabricate-0.1.0.tar.gz:

Publisher: test.yml on althonos/pyabricate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyabricate-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyabricate-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyabricate-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f7475d7775d4dbceeed45ea88297764431de1fa631f9e904bdb821253a3a734
MD5 e036f55fa9d7610dc2e1825223b96892
BLAKE2b-256 73d92dee96078c89ef96ff2d50285fd733a6b9464861a7d3adb2b4b609c4faa3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyabricate-0.1.0-py3-none-any.whl:

Publisher: test.yml on althonos/pyabricate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page