bio-metagenomics-amr-detection
Detect antimicrobial resistance genes using AMRFinderPlus, ResFinder, and CARD. Screen isolates and metagenomes for resistance determinants. Use when characterizing resistance profiles in clinical isolates, surveillance samples, or metagenomic data.
Best use case
bio-metagenomics-amr-detection is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Detect antimicrobial resistance genes using AMRFinderPlus, ResFinder, and CARD. Screen isolates and metagenomes for resistance determinants. Use when characterizing resistance profiles in clinical isolates, surveillance samples, or metagenomic data.
Teams using bio-metagenomics-amr-detection should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/bio-metagenomics-amr-detection/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How bio-metagenomics-amr-detection Compares
| Feature / Agent | bio-metagenomics-amr-detection | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Detect antimicrobial resistance genes using AMRFinderPlus, ResFinder, and CARD. Screen isolates and metagenomes for resistance determinants. Use when characterizing resistance profiles in clinical isolates, surveillance samples, or metagenomic data.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
## Version Compatibility
Reference examples tested with: AMRFinderPlus 3.12+, pandas 2.2+
Before using code patterns, verify installed versions match. If versions differ:
- Python: `pip show <package>` then `help(module.function)` to check signatures
- CLI: `<tool> --version` then `<tool> --help` to confirm flags
If code throws ImportError, AttributeError, or TypeError, introspect the installed
package and adapt the example to match the actual API rather than retrying.
# AMR Detection
**"Screen my isolates for antibiotic resistance genes"** → Identify antimicrobial resistance determinants in bacterial genomes or metagenomes by searching against curated resistance gene databases.
- CLI: `amrfinder -n assembly.fasta --organism Escherichia` (AMRFinderPlus)
- CLI: ResFinder, CARD/RGI for alternative database searches
Identify antimicrobial resistance (AMR) genes in bacterial genomes and metagenomes.
## Tool Comparison
| Tool | Database | Best For |
|------|----------|----------|
| AMRFinderPlus | NCBI | Comprehensive, curated |
| ResFinder | CGE | Clinical isolates |
| CARD/RGI | CARD | Detailed resistance mechanisms |
| ABRicate | Multiple | Quick screening |
## AMRFinderPlus (NCBI)
### Installation
```bash
conda install -c bioconda ncbi-amrfinderplus
amrfinder -u # Update database
```
### From Nucleotide Sequences
```bash
# Assembled contigs
amrfinder -n contigs.fasta -o amr_results.tsv --threads 8
# With organism for point mutations
amrfinder -n contigs.fasta -O Escherichia -o amr_results.tsv
# Include stress/virulence genes
amrfinder -n contigs.fasta -O Salmonella --plus -o amr_results.tsv
```
### From Protein Sequences
```bash
# If you have predicted proteins
amrfinder -p proteins.faa -o amr_results.tsv
# Combined nucleotide and protein
amrfinder -n contigs.fasta -p proteins.faa -g gff_annotation.gff \
-O Escherichia -o amr_results.tsv
```
### Output Fields
| Column | Description |
|--------|-------------|
| Gene symbol | AMR gene name |
| Sequence name | Contig/protein ID |
| Element type | AMR, STRESS, VIRULENCE |
| Element subtype | Specific class |
| Class | Drug class |
| Subclass | Specific drug |
| % Coverage | Query coverage |
| % Identity | Sequence identity |
### Batch Processing
```bash
for fasta in assemblies/*.fasta; do
sample=$(basename $fasta .fasta)
amrfinder -n $fasta -O Escherichia --plus \
-o results/${sample}_amr.tsv --threads 4
done
# Combine results
head -1 results/sample1_amr.tsv > combined_amr.tsv
for f in results/*_amr.tsv; do
tail -n+2 $f >> combined_amr.tsv
done
```
## ResFinder
### Installation
```bash
conda install -c bioconda resfinder
# Or use web: https://cge.food.dtu.dk/services/ResFinder/
```
### Run ResFinder
```bash
# Assembled genome
python -m resfinder -ifa contigs.fasta -o resfinder_output \
-db_res /path/to/resfinder_db -acq
# With species for point mutations
python -m resfinder -ifa contigs.fasta -o resfinder_output \
-db_res /path/to/resfinder_db \
-db_point /path/to/pointfinder_db \
-s "Escherichia coli" -acq
```
### From Raw Reads (KMA)
```bash
python -m resfinder -ifq reads_1.fq reads_2.fq -o resfinder_output \
-db_res /path/to/resfinder_db -acq
```
## CARD/RGI
Resistance Gene Identifier with detailed mechanism annotations.
### Installation
```bash
conda install -c bioconda rgi
rgi load --card_json /path/to/card.json --local
```
### Run RGI
```bash
# From contigs
rgi main --input_sequence contigs.fasta --output_file rgi_output \
--input_type contig --local --clean
# From protein
rgi main --input_sequence proteins.faa --output_file rgi_output \
--input_type protein --local
# Include loose hits (more sensitive)
rgi main --input_sequence contigs.fasta --output_file rgi_output \
--input_type contig --include_loose --local
```
### RGI Output
```bash
# Main results
cat rgi_output.txt
# JSON with full details
cat rgi_output.json
```
## ABRicate (Quick Screening)
### Installation
```bash
conda install -c bioconda abricate
abricate --setupdb # Update databases
```
### Available Databases
```bash
abricate --list
# ncbi, card, resfinder, argannot, megares, ecoh, ecoli_vf, plasmidfinder, vfdb
```
### Run ABRicate
```bash
# Default (ncbi)
abricate contigs.fasta > abricate_results.tsv
# Specific database
abricate --db resfinder contigs.fasta > resfinder_results.tsv
abricate --db card contigs.fasta > card_results.tsv
# Multiple databases
for db in ncbi card resfinder; do
abricate --db $db contigs.fasta > ${db}_results.tsv
done
```
### Batch Summary
```bash
# Run on multiple samples
abricate assemblies/*.fasta > all_results.tsv
# Generate summary matrix
abricate --summary all_results.tsv > summary_matrix.tsv
```
## Metagenome AMR Profiling
### Using ShortBRED
```bash
# Map reads to AMR markers
shortbred_quantify.py --markers amr_markers.faa \
--wgs reads_1.fq reads_2.fq \
--results amr_abundance.tsv \
--threads 8
```
### Using GROOT
```bash
# Index database
groot index -m card.90 -i groot_index -p 8
# Align and report
groot align -i groot_index -f reads_1.fq,reads_2.fq -p 8 | \
groot report > amr_report.tsv
```
## Complete Workflow
**Goal:** Screen a bacterial assembly for antimicrobial resistance genes using multiple databases for comprehensive resistance profiling.
**Approach:** Run AMRFinderPlus with organism-specific point mutation detection, then ABRicate against NCBI/CARD/ResFinder databases, and summarize drug class counts.
```bash
#!/bin/bash
set -euo pipefail
ASSEMBLY=$1
ORGANISM=$2
OUTPUT_DIR=$3
mkdir -p $OUTPUT_DIR
echo "=== AMRFinderPlus ==="
amrfinder -n $ASSEMBLY -O $ORGANISM --plus \
-o $OUTPUT_DIR/amrfinder.tsv --threads 8
echo "=== ABRicate (multiple databases) ==="
for db in ncbi card resfinder; do
abricate --db $db $ASSEMBLY > $OUTPUT_DIR/abricate_${db}.tsv
done
echo "=== Summary ==="
echo "AMR genes found:"
cut -f6 $OUTPUT_DIR/amrfinder.tsv | sort | uniq -c | sort -rn | head -20
echo "=== Complete ==="
echo "Results in $OUTPUT_DIR/"
```
## Summarize Results
```python
import pandas as pd
# Load AMRFinderPlus results
amr = pd.read_csv('amrfinder.tsv', sep='\t')
# Count by drug class
class_counts = amr['Class'].value_counts()
print(class_counts)
# Pivot for heatmap (multiple samples)
import glob
results = []
for f in glob.glob('results/*_amr.tsv'):
sample = f.split('/')[-1].replace('_amr.tsv', '')
df = pd.read_csv(f, sep='\t')
df['Sample'] = sample
results.append(df)
combined = pd.concat(results)
matrix = pd.crosstab(combined['Sample'], combined['Gene symbol'])
```
## Related Skills
- metagenomics/kraken-classification - Taxonomic context
- metagenomics/functional-profiling - Functional pathways
- genome-assembly/contamination-detection - Sample QC
- workflows/metagenomics-pipeline - Full metagenomics workflowRelated Skills
tooluniverse-adverse-event-detection
Detect and analyze adverse drug event signals using FDA FAERS data, drug labels, disproportionality analysis (PRR, ROR, IC), and biomedical evidence. Generates quantitative safety signal scores (0-100) with evidence grading. Use for post-market surveillance, pharmacovigilance, drug safety assessment, adverse event investigation, and regulatory decision support.
crisis-detection-intervention-ai
Detect crisis signals in user content using NLP, mental health sentiment analysis, and safe intervention protocols. Implements suicide ideation detection, automated escalation, and crisis resource integration. Use for mental health apps, recovery platforms, support communities. Activate on "crisis detection", "suicide prevention", "mental health NLP", "intervention protocol". NOT for general sentiment analysis, medical diagnosis, or replacing professional help.
claw-metagenomics
Shotgun metagenomics profiling — taxonomy, resistome, and functional pathways
bio-single-cell-doublet-detection
Detect and remove doublets (multiple cells captured in one droplet) from single-cell RNA-seq data. Uses Scrublet (Python), DoubletFinder (R), and scDblFinder (R). Essential QC step before clustering to avoid artificial cell populations. Use when identifying and removing doublets from scRNA-seq data.
bio-ribo-seq-orf-detection
Detect and quantify translated ORFs from Ribo-seq data including uORFs and novel ORFs using RiboCode and ORFquant. Use when identifying translated regions beyond annotated coding sequences or quantifying ORF-level translation.
bio-methylation-dmr-detection
Differentially methylated region (DMR) detection using methylKit tiles, bsseq BSmooth, and DMRcate. Use when identifying contiguous genomic regions with methylation differences between experimental conditions or cell types.
bio-methylation-based-detection
Analyzes cfDNA methylation patterns for cancer detection using cfMeDIP-seq or bisulfite sequencing with MethylDackel. Identifies cancer-specific methylation signatures and performs tissue-of-origin deconvolution. Use when using methylation biomarkers for early cancer detection or minimal residual disease.
bio-metagenomics-visualization
Visualize metagenomic profiles using R (phyloseq, microbiome) and Python (matplotlib, seaborn). Create stacked bar plots, heatmaps, PCA plots, and diversity analyses. Use when creating publication-quality figures from MetaPhlAn, Bracken, or other taxonomic profiling output.
bio-metagenomics-strain-tracking
Track bacterial strains using MASH, sourmash, fastANI, and inStrain. Compare genomes, detect contamination, and monitor strain-level variation. Use when needing sub-species resolution for outbreak tracking, transmission analysis, or within-host strain dynamics.
bio-metagenomics-metaphlan
Marker gene-based taxonomic profiling using MetaPhlAn 4. Provides accurate species-level relative abundances using clade-specific markers. Use when accurate taxonomic profiling is needed and computational resources are limited, or for comparison with HMP/other MetaPhlAn studies.
bio-metagenomics-kraken
Taxonomic classification of metagenomic reads using Kraken2. Fast k-mer based classification against RefSeq database. Use when performing initial taxonomic classification of shotgun metagenomic reads before abundance estimation with Bracken.
bio-metagenomics-functional-profiling
Profile functional potential of metagenomes using HUMAnN3 and similar tools. Use when obtaining pathway abundances, gene family counts, or functional annotations from metagenomic data.