跳到正文
cccskills
免费在 GitHub 公开

bio-metagenomics-amr-detection

Screen bacterial genomes and metagenomes for antimicrobial resistance genes using AMRFinderPlus, ResFinder, and CARD/RGI. Compare database results, summarize resistance by drug class, and organize findings across samples for resistance profiling.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

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.

实测评分 未实测

查看安装方法

适用场景

  • Screening clinical isolates for resistance genes
  • Comparing resistance profiles across surveillance samples
  • Measuring resistance gene abundance in metagenomes
  • Comparing results from multiple resistance databases

包含的文件(4)

  • SKILL.md7.0 KB
  • examples/batch_amr_screening.py2.0 KB
  • examples/run_amrfinder.sh814 B
  • usage-guide.md2.6 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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

ToolDatabaseBest For
AMRFinderPlusNCBIComprehensive, curated
ResFinderCGEClinical isolates
CARD/RGICARDDetailed resistance mechanisms
ABRicateMultipleQuick screening

AMRFinderPlus (NCBI)

Installation

conda install -c bioconda ncbi-amrfinderplus
amrfinder -u  # Update database

From Nucleotide Sequences

# 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

# 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

ColumnDescription
Gene symbolAMR gene name
Sequence nameContig/protein ID
Element typeAMR, STRESS, VIRULENCE
Element subtypeSpecific class
ClassDrug class
SubclassSpecific drug
% CoverageQuery coverage
% IdentitySequence identity

Batch Processing

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

conda install -c bioconda resfinder
# Or use web: https://cge.food.dtu.dk/services/ResFinder/

Run ResFinder

# 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)

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

conda install -c bioconda rgi
rgi load --card_json /path/to/card.json --local

Run RGI

# 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

# Main results
cat rgi_output.txt

# JSON with full details
cat rgi_output.json

ABRicate (Quick Screening)

Installation

conda install -c bioconda abricate
abricate --setupdb  # Update databases

Available Databases

abricate --list
# ncbi, card, resfinder, argannot, megares, ecoh, ecoli_vf, plasmidfinder, vfdb

Run ABRicate

# 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

# 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

# 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

# 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.

#!/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

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 workflow

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

adaptyv

免费

Support protein design with cloud laboratory testing for binding, expression, thermal stability, and enzyme activity. Covers sequence optimization, submitting experiments through the Adaptyv API, checking progress, and downloading experimental results.

中文简介正在准备中。当前显示英语简介。

  • Validate designed proteins with laboratory assays
  • Screen and redesign sequences for better solubility
  • Submit protein testing experiments through an API
FreedomIntelligence/OpenClaw-Medical-Skills30802026年7月21日 更新

Build flexible daily plans that account for ADHD-related difficulties with time estimation and getting started. Narrow priorities to three tasks, add transition buffers, and choose small next actions that match the energy available that day.

中文简介正在准备中。当前显示英语简介。

  • Choosing three priorities for today
  • Planning a schedule with transition buffers
  • Finding a small first step when starting feels difficult
FreedomIntelligence/OpenClaw-Medical-Skills30802026年7月21日 更新

aeon

免费

Build Python workflows for data recorded over time, including classification, forecasting, anomaly detection, and pattern search. Using aeon, the skill guides preprocessing, algorithm selection, feature extraction, and evaluation through interfaces compatible with scikit-learn.

中文简介正在准备中。当前显示英语简介。

  • Classify time series by their patterns
  • Forecast future values from historical data
  • Detect anomalies and change points
FreedomIntelligence/OpenClaw-Medical-Skills30802026年7月21日 更新

Use a browser to research topics, extract page information, fill forms, and test websites. Guides agents through identifying page controls, interacting with web apps, saving screenshots or PDFs, and reusing saved login sessions.

中文简介正在准备中。当前显示英语简介。

  • Researching topics and reading web articles
  • Filling and submitting online forms
  • Extracting page text and links
FreedomIntelligence/OpenClaw-Medical-Skills30802026年7月21日 更新

Combine health measurements, exercise, sleep, nutrition, and mental health records to examine trends, unusual changes, and estimated risks. The skill produces personalized suggestions and text or interactive HTML reports using local data without external API calls.

中文简介正在准备中。当前显示英语简介。

  • Review health records together in a comprehensive report
  • Explore links between sleep, mood, exercise, and weight
  • Summarize estimated disease and nutrition risks
FreedomIntelligence/OpenClaw-Medical-Skills30802026年7月21日 更新

alphafold

免费

Predict structures for designed protein sequences and protein complexes with AlphaFold2 or ColabFold. Inspect structure files and confidence scores to assess folding and chain interfaces, with guidance for local runs, Modal execution, and common prediction errors.

中文简介正在准备中。当前显示英语简介。

  • Check predicted folding of a designed protein sequence
  • Predict a binder–target protein complex
  • Review structure and interface confidence scores
FreedomIntelligence/OpenClaw-Medical-Skills30802026年7月21日 更新

查看 FreedomIntelligence 的全部技能

报告此技能的问题