Skip to main content

Amira

Introduction

Amira is an AMR gene detection tool designed to work directly from bacterial long read sequences. Amira makes it easy to reliably identify the AMR genes in a bacterial sample, reduces the time taken to get meaningful results and allows more accurate detection of AMR genes than assembly.

Overview

Amira leverages the full length of long read sequences to differentiate multi-copy genes by their local genomic context. This is done by first identifying the genes on each sequencing read and using the gene calls to construct a de Bruijn graph (DBG) in gene space. Following error correction, the reads containing different copies of multi-copy AMR genes can be clustered together based on their path in the graph, then assembled to obtain the nucleotide sequence.

Prerequisites

Amira requires Python and three additional non-Python tools for optimal functionality:

  • Python >=3.9,<3.13.
  • Poetry to manage the Python dependencies.
  • Pandora to identify the genes on each sequencing read.
  • minimap2 for sequence alignment.
  • racon for allele polishing.

Installation

Follow these steps to install Amira and its dependencies.

From source

Step 1: Clone the Amira Repository

Open a terminal and run the following command to clone the repository and navigate into it:

git clone https://github.com/Danderson123/Amira && cd Amira

Step 2: Install Poetry

Amira’s dependencies are managed with Poetry. Install Poetry by running:

pip install poetry

Step 3: Install Python Dependencies

Once Poetry is installed, use it to set up Amira’s dependencies:

poetry install

Step 4: Install Non-Python Dependencies

Amira requires Pandora, minimap2 and racon. Follow the links below for instructions on building binaries for each tool:

After installation, make a note of the paths to these binaries as they will be required when running Amira.

From PyPI

Amira can be installed from PyPI by running:

pip install amira-amr

Amira can then be run with:

amira --help

Running Amira

Amira can be run on the output of Pandora directly, or from JSON files listing the genes and gene positions on each sequencing read. Below are instructions and an example command for running Amira with the JSON files.

Running from JSON

To run Amira from the JSON files, you can use this command. You will need to replace <PATH TO RACON BINARY> with the absolute path to the racon binary you made earlier and replace <PATH TO MINIMAP2 BINARY> with the path to the minimap2 binary.

python3 amira/__main__.py --pandoraJSON <PATH TO GENE CALL JSON> --gene-positions <PATH TO GENE POSITION JSON> --pandoraConsensus <PATH TO PANDORA CONSENSUS FASTQ> --readfile <PATH TO READ FASTQ> --output <OUTPUT DIRECTORY> --gene-path <AMR GENE REFERENCE FASTA> --phenotypes <ALLELE-PHENOTYPE MAPPING JSON> --racon-path <PATH TO RACON BINARY> --minimap2-path <PATH TO MINIMAP2 BINARY> --debug --cores <CPUS> --sample-reads --filter-contaminants

JSON example

Some example JSON data can be downloaded from here. Amira can then be run using this command:

python3 amira/__main__.py --pandoraJSON test_data/gene_calls_with_gene_filtering.json --gene-positions test_data/gene_positions_with_gene_filtering.json --pandoraConsensus test_data/pandora.consensus.fq.gz --readfile test_data/SRR23044220_1.fastq.gz --output amira_output --gene-path AMR_alleles_unified.fa --phenotypes AMR_calls.json --racon-path <PATH TO RACON BINARY> --minimap2-path <PATH TO MINIMAP2 BINARY> --debug --cores <CPUS> --sample-reads --filter-contaminants

Running with Pandora

Pandora uses species-specific reference pan-genomes (panRGs) to identify the genes on each sequencing read. For Escherichia coli, a pre-built panRG can be downloaded from here. After installing Pandora, you can call the genes on your sequencing reads using this command:

pandora map -t <THREADS> --min-gene-coverage-proportion 0.5 --max-covg 10000 -o pandora_map_output <PANRG PATH> <PATH TO READ FASTQ>

Amira can then be run directly on the output of Pandora using this command:

python3 amira/__main__.py --pandoraSam pandora_map_output/*.sam --pandoraConsensus pandora_map_output/pandora.consensus.fq.gz --readfile <PATH TO READ FASTQ> --output amira_output --gene-path AMR_alleles_unified.fa --minimum-length-proportion 0.5 --maximum-length-proportion 1.5 --cores <CPUS> --phenotypes AMR_calls.json --filter-contaminants --sample-reads

Additional options

For additional options and configurations, run:

python3 amira/__main__.py --help

Citation

TBD

Contributing

If you’d like to contribute to Amira, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix (git checkout -b feature-name).
  3. Commit your changes (git commit -m "Description of feature").
  4. Push to the branch (git push origin feature-name).
  5. Submit a pull request.

License

This project is licensed under the Apache License 2.0 License. See the LICENSE file for details.

Contact

For questions, feedback, or issues, please open an issue on GitHub or contact Daniel Anderson.

Additional Resources

Metadata

Release files for amira-amr 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for amira-amr 0.4.1
File Size Uploaded Provenance Actions
amira_amr-0.4.1.tar.gz 57.7 kB Without provenance Details for amira_amr-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for amira-amr 0.4.1
File Interpreter ABI Platform Actions
amira_amr-0.4.1-py3-none-any.whl Python 3 none any Details for amira_amr-0.4.1-py3-none-any.whl

Total release size: 118.1 kB

Release files / amira_amr-0.4.1.tar.gz

Download URL amira_amr-0.4.1.tar.gz
Size 57.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6e7842b86700a0ba93c4405d36a77793f2f23babbe7f742b17d7114921945035
BLAKE2b-256 checksum
How to use checksums
31a8e2d832150713c3f13ef84fea087390e36755b1a2d5d9318ce085060e15f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.5 CPython/3.11.0 Linux/6.5.0-1025-azure

Release files / amira_amr-0.4.1-py3-none-any.whl

Download URL amira_amr-0.4.1-py3-none-any.whl
Size 60.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb8dbe58fc3a12bafb3d964e7fbd1257a38735d68775d1f72e3f1474915791c9
BLAKE2b-256 checksum
How to use checksums
294df779b9a7573a27eff09f8b78b2f77e752aa83c3c2cd5e2734f96117f7b3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.5 CPython/3.11.0 Linux/6.5.0-1025-azure

Security for amira-amr 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page