Skip to main content

Metagenomic AMR variant detection tool, part of ARMTime.

Project description

Table of contents

General info

This repo contains the necessary workflow for detecting antimicrobial resistance gene (AMR) variant in metagenomic data.

Input: Paired-end illumina reads (.fastq, .fastq.gz), reference CARD database and SNP data (card.json, snp.txt).

Output: detected AMR SNPs

Workflow:

  1. Using card.json and snp.txt, a reference fasta file is created for each ARO that contain SNPs.
  2. Reads are aligned to the reference fasta using bowtie2 in very-sensitive mode.
  3. Generate alignment pileup with samtools, include all positions. This step can be fine-tuned by specifying MAPQ quality(i.e. --MAPQ)
  4. For each variant in snp.txt, scans the pileup file for that ARO+position, record the detected base, and depth.
  5. Calculate support values with base depth and count of variants detected.
  6. Filter according to tuning parameters (i.e. --max-recall, --max-precision).
  7. Output summary file(tab delimited).

Setup

Dependencies: biopython=1.72, numpy, pandas, bcftools, samtools, and bowtie2.

It is suggested to run this program within a conda environment. These dependencies can be installed from env.yaml using conda env create -f env.yaml

Following environment installing, clone this repo into any directory and see python main.py --help

At somepoint, this will be build into a conda package.

Usage

python main.py --forward /path/to/forward.fq --reverse /path/to/reverse.fq --card-json /path/to/card.json --card-snp path/to/snps.txt

At somepoint, the default behavior for --card-json and --card-snp will be to download the latest copy from card.mcmaster.ca unless specified. For now, you must specify it's path.

Example

See test/ for examples. To run the workflow using these test files:

python main.py --forward ./test/synthetic_1.fq --reverse ./test/synthetic_2.fq --temp ./example --card-json ./test/card.json --card-snp ./test/snps.txt --max-recall

This will generate an output folder called example and a result file called example_DetectedVariants.tsv

Output

The output is a tab delimitted file containing the following information:

Column Description
ARO ARO of resistance gene
VariantClass CARD Model Type
VariantType Mutation Type
ResistantVariant Flag for Resistant Variant
SNP Detected SNP
Depth Total depth of the SNP position
AbsSupport Number of reads matching the SNP
RelativeSuppor %of resistant reads to total reads
INFO Raw counts of alternate variants

Contribute

Any contributions are welcomed.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

GNU General Public License v3.0

Permissions of this strong copyleft license are conditioned on making available complete sourcecode of licensed works and modifications, which include larger works using a licensed work, under the same license. Copyright and license notices must be preserved. Contributors provide an express grant of patent rights.

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

STAPAMRTime-0.0.1.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

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

STAPAMRTime-0.0.1-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file STAPAMRTime-0.0.1.tar.gz.

File metadata

  • Download URL: STAPAMRTime-0.0.1.tar.gz
  • Upload date:
  • Size: 20.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.12

File hashes

Hashes for STAPAMRTime-0.0.1.tar.gz
Algorithm Hash digest
SHA256 de1c93e89c8572920709a84ba12e4008b0e5ffcb6396abcfe9d544f207800ff7
MD5 cd8522b996fbcf9dc6e62201cb6e3f97
BLAKE2b-256 0d995e22536e66ea9f7a47666fc539eddfafb9e2966bac9efb23d65bf9beb2ec

See more details on using hashes here.

File details

Details for the file STAPAMRTime-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: STAPAMRTime-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.12

File hashes

Hashes for STAPAMRTime-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8687820f7ac170c47c1de7bbe73b630faba63fa453115af1e9477bc2e1281302
MD5 60ce4804dfca49bb3a8e16b36ed56496
BLAKE2b-256 0eebdb71ef1a6091e08a69ca2a2f577a7ab3927213f9af00f89cda777b8bf716

See more details on using hashes here.

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