Package to find the equivalent antibiotic resistance genes (ARGs) in other databases based on ARG(s) from one AMR determinant database
Project description
ChAMReD
This project originated from the dilemma a scientist faces when choosing a database that stores antimicrobial resistance determinants. Multiple databases exist with comparative strengths and weaknesses. This project builds on the concepts of the haAMRonization project aiming to aggeregate and combine the information contained within the metadata associated with each project. The problem is exacerbated by the fact that the equivalent antimicrobial resistance genes (ARGs) can be named differently in each database.
The hypothesis for the project is as follows:
- Given a match in one database find the matches in other databases and vice versa (reciprocal best hits)
- Aggregate the combined descriptive information pertaining to antimicrobial resistance contained in the union of the metadata
- Report this to user for them to make intelligent informed choices
The tool is split into two parts - a workflow to buld the databases (chamrdb-builder) and this the chamrdb tool itself (this repo) for querying and annotating hAMRonization results.
Current integrated database versions:
-
NCBI 4.2 (2026-03-24.1)
-
ResFinder 2026-03-11 & PointFinder 2026-03-11
-
CARD 4.0.1 (2025-05-29)
Installation
You can install directly with pip.
pip install chamred
Querying the graph
> charmed query --help
usage: chamred query [-h] [-d {card,ncbi,resfinder}] [-ct COVERAGE_THRESHOLD]
[-it IDENTITY_THRESHOLD] (-i ID | -f ID_FILE |
-j HAMRONIZATION_JSON_FILE) [-o OUTFILE_PATH]
options:
-h, --help show this help message and exit
-d, --database {card,ncbi,resfinder}
which database are the gene(s) in
-ct, --coverage_threshold COVERAGE_THRESHOLD
coverage threshold below which a match will not be
reported
-it, --identity_threshold IDENTITY_THRESHOLD
identity threshold below which a match will not be
reported
-i, --id ID The id of a ARG in the specified database
-f, --id_file ID_FILE
Path to a file containing ids of ARGs in the specified
database
-j, --hamronization_json_file HAMRONIZATION_JSON_FILE
Path to a hamronization summaty in JSON format
-o, --outfile_path OUTFILE_PATH
Path to file where query results will be written
The graph can be queried in one of 3 ways
1. Querying an individual
Requires specifying the identifier -i and database -d
chamred query -d ncbi -i WP_012695489.1
Alternatively the gene name can be used
chamred query -d ncbi -i qnrB2
The output reports the matches and metadata from the other databases
Another example where the matches are one way hits not RBHs
chamred query -d resfinder -i "aac(3)-IIIb"
In these outputs ↔ means a RBH, and ➡ a search hit
2. Providing a list of identifiers from a single database
Requires specifying the database -d, the text file containing the ids -f, and a path for the tsv output file -o
grep "^>" chamred/data/db_fastas/card.protein.fasta | sed 's/>//' > card_ids.txt
chamred query -d card -f card_ids.txt -o docs/card_vs_ncbi_resfinder.tsv
This will produce a TSV file containing the matches and associated metadata with one row per id in the text file
3. Use hAMRonization summary output
Use the hAMRonization softare to convert the outputs from antimicrobial resistance gene detection tools into a unified format. Concatenate and summarize AMR detection reports into a single summary JSON file using the hamronize summarize command from this package. The JSON output from this step can be used to query ChamreDb.
Use -j to specify the json summary file and -o the path for the TSV output
Please Note
Only outputs using data derived from AMR detection tools that have searched either the CARD, NCBI or Resfinder 4 databases can be used.
chamred query -j docs/data/hamronize_summary.json -o docs/data/hamronize_summary.tsv
This will produce a TSV file containing the matches and associated metadata with one row per id in the text file
Database Builder: chamrdb-builder
This workflow can be found here and follows these steps to build the database.
-
Download sequences and associated metadata of ARGs from 3 databases
-
Parse the data to
- extract the protein sequences and write into fasta format with the gene identifiers as the record ids.
- extract the associated metadata and convert to a consistent
JSONformat
-
Find best matches of each gene from one source database against the other two target databases using MMseqs2
- Where a reciprocal best hit (RBH) exists, report this.
- If a RBH does not exist, report the best match as long as thresholds for coverage and indentity are met.
-
From the outputs of the MMseqs2 searches the RBHs or best matches of each gene from one database against the other two databases can be parsed to produce a
Directed Graphusing networkx. In this graph- the nodes represent a protein from one database
- Node attributes contain the phenotype from the JSON metadata
- the edges link nodes and represent the matches and attributes include
- type, either RBH or OWH (one way hit)
- coverage, (alignment length/query length)
- identity, (percent identity of match)
- the nodes represent a protein from one database
Analyses can be repeated here.
Contributors
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chamred-0.4.3.tar.gz.
File metadata
- Download URL: chamred-0.4.3.tar.gz
- Upload date:
- Size: 611.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6634c4f9d3df326cc8c44c929637a8ba70c65d97cc03df47aa263397dcc17a6d
|
|
| MD5 |
cacae6b9dbd6c9fda73061b4d9fa351b
|
|
| BLAKE2b-256 |
77cbd6a1adc641689c54d9b46d3877227314bd1c27d59a7aa1b1d491d298f537
|
Provenance
The following attestation bundles were made for chamred-0.4.3.tar.gz:
Publisher:
publish.yml on maguire-lab/chamred
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chamred-0.4.3.tar.gz -
Subject digest:
6634c4f9d3df326cc8c44c929637a8ba70c65d97cc03df47aa263397dcc17a6d - Sigstore transparency entry: 1397350600
- Sigstore integration time:
-
Permalink:
maguire-lab/chamred@f15e3a218c4df186ac185faa96ef25df79ec519d -
Branch / Tag:
refs/tags/v0.4.3 - Owner: https://github.com/maguire-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f15e3a218c4df186ac185faa96ef25df79ec519d -
Trigger Event:
release
-
Statement type:
File details
Details for the file chamred-0.4.3-py3-none-any.whl.
File metadata
- Download URL: chamred-0.4.3-py3-none-any.whl
- Upload date:
- Size: 692.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35323ffaf17aceb9a5641e713ac304fab208f9b376f1fe8f29e3a65cb45dac89
|
|
| MD5 |
8742e3cbd5e1d7b05e08218bba64f238
|
|
| BLAKE2b-256 |
df2ce35b512a2b6207174e226d3121930d11e33a09b27d7395ff29d98df32399
|
Provenance
The following attestation bundles were made for chamred-0.4.3-py3-none-any.whl:
Publisher:
publish.yml on maguire-lab/chamred
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chamred-0.4.3-py3-none-any.whl -
Subject digest:
35323ffaf17aceb9a5641e713ac304fab208f9b376f1fe8f29e3a65cb45dac89 - Sigstore transparency entry: 1397350608
- Sigstore integration time:
-
Permalink:
maguire-lab/chamred@f15e3a218c4df186ac185faa96ef25df79ec519d -
Branch / Tag:
refs/tags/v0.4.3 - Owner: https://github.com/maguire-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f15e3a218c4df186ac185faa96ef25df79ec519d -
Trigger Event:
release
-
Statement type: