ResFinderParser
Harmonizing ResFinder outputs for scalable AMR analysis
ResFinderParser is a Python tool that parses and standardizes JSON outputs generated by ResFinder (CGE/DTU) across multiple isolates. It compiles per-sample resistance detection results into structured, analysis-ready tabular datasets.
ResFinder integrates multiple resistance detection layers, including acquired resistance genes (ResFinder database), chromosomal mutations (PointFinder), disinfectant-associated determinants (DisinFinder), and predicted phenotypic resistance. Although biologically comprehensive, these outputs are generated independently for each isolate and are not directly optimized for cross-sample analyses.
The parser restructures these results into harmonized matrices suitable for:
- Antimicrobial resistance (AMR) surveillance
- Comparative resistance profiling
- Resistance frequency and trend analysis
- Integration into automated genomic analysis pipeline
By transforming nested JSON outputs into standardized TSV files, the tool enables scalable genomic resistance analyses across research and surveillance contexts.
Requirements
- Python 3.8+
- pandas 2.0+
Installation
Using Poetry (recommended)
poetry install
Using pip
pip install resfinder-parser
Input
ResFinderParser expects the JSON output files generated by ResFinder. The tool should be run on a directory containing one subfolder per isolate, each including the corresponding ResFinder *.json file (and, if available, PointFinder and DisinFinder results).
Example structure:
RESFINDER_DIR/
├── ISOLATE_001/
│ └── ResFinder_results.json
├── ISOLATE_002/
│ └── ResFinder_results.json
└── ...
The parser extracts resistance genes, chromosomal mutations, disinfectant-associated determinants, and predicted phenotypes directly from the JSON structure.
Outputs
The parser generates four standardized TSV files:
-
isolate_summaries.tsv One row per isolate containing:
- isolate_id
- analysis_date
- ResFinder version
- databases used
- provided species
- predicted phenotype summary Useful for run tracking and dataset documentation.
-
resfinder_results.tsv Long-format table (isolate × antibiotic) including:
- antibiotic
- resistance class
- amr_resistant (True/False)
- identity
- coverage
- grade Suitable for resistance frequency analysis and comparative profiling.
-
pointfinder_results.tsv Long-format mutation table including:
- gene
- mutation
- nucleotide change
- associated phenotype
- PMID Enables mutation-level resistance analysis.
- combined_presence_absence.tsv
Wide-format matrix:
- One row per isolate
- One column per detected gene (ResFinder + DisinFinder)
- One column per relevant mutation (PointFinder) Designed for comparative analyses, clustering, and integration with epidemiological metadata. All outputs are directly compatible with R, Python (pandas), and automated genomic analysis pipelines.
Usage
Command Line
resfinder-parser -r /path/to/RESFINDER_DIR -o /path/to/output_dir
As a Python Module
from resfinder_parser import ResfinderCollector
collector = ResfinderCollector("/path/to/RESFINDER_DIR", "/path/to/output_dir")
collector.collect()
Arguments:
-r,--resfinder_dir(required): directory containing isolate subfolders-o,--output_dir(optional): directory where output files will be written
Development
Run tests:
poetry run pytest
Citation
We recommend citing ResFinder (this repository) and its associated databases:
- Zankari et al., 2012. Journal of Antimicrobial Chemotherapy.
- Florensa et al., 2022. Microbial Genomics.
- CGE/DTU ResFinder platform.
Metadata
Release files for resfinder-parser 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| resfinder_parser-0.3.0.tar.gz | 9.5 kB | Without provenance | Details for resfinder_parser-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| resfinder_parser-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for resfinder_parser-0.3.0-py3-none-any.whl |
Total release size: 19.6 kB
Release files / resfinder_parser-0.3.0.tar.gz
| Download URL | resfinder_parser-0.3.0.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6c91a090c0d8fc6432f2855dd23a61d9802ee1e705abd070189816d712beaf1e
|
|
BLAKE2b-256 checksum How to use checksums |
c64236348d7d07f2f3f22d8f8fa7334e1a751955e4b6b4d297582380dbdec845
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.2 CPython/3.10.12 Linux/6.8.0-101-generic
|
Release files / resfinder_parser-0.3.0-py3-none-any.whl
| Download URL | resfinder_parser-0.3.0-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5c64f9663b9a2a0b5a31b6ffa1412f2a38f045e6d9a040d9e3758410d3abad35
|
|
BLAKE2b-256 checksum How to use checksums |
4109fc09a4d05fd7fee2c78182c2f0d45c74d237a988bbd6fbed653e857d5549
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.2 CPython/3.10.12 Linux/6.8.0-101-generic
|
Security for resfinder-parser 0.3.0
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.