Skip to content

Instantly share code, notes, and snippets.

@fo40225
Created November 21, 2022 07:23
Show Gist options
  • Save fo40225/2097450514681aced6e3bbcd71f31834 to your computer and use it in GitHub Desktop.
Save fo40225/2097450514681aced6e3bbcd71f31834 to your computer and use it in GitHub Desktop.
run rgi (Resistance Gene Identifier)
pip install biopython==1.78
sudo apt install -y prodigal
# PATH need contain diamond, blast, kma, samtools, bamtools, bedtools2
git clone https://github.com/arpcard/rgi.git -b 6.0.1
cd rgi
# app/Diamond.py
# cmd = ('diamond prepdb -d {db} && diamond {program} --in {in_ref} --db {db} \
python setup.py install
wget -O card-data-v3.2.5.tar.bz2 https://card.mcmaster.ca/download/0/broadstreet-v3.2.5.tar.bz2
tar -a -x -v -f card-data-v3.2.5.tar.bz2 ./card.json
wget -O card-prevalence-v4.0.0.tar.bz2 https://card.mcmaster.ca/download/6/prevalence-v4.0.0.tar.bz2
mkdir -p wildcard
tar -a -x -v -f card-prevalence-v4.0.0.tar.bz2 -C wildcard
gunzip wildcard/*.gz
rgi card_annotation -i card.json > card_annotation.log 2>&1
rgi wildcard_annotation -i wildcard --card_json card.json -v 4.0.0 > wildcard_annotation.log 2>&1
rgi load \
--card_json card.json \
--debug \
--card_annotation card_database_v3.2.5.fasta \
--card_annotation_all_models card_database_v3.2.5_all.fasta \
--wildcard_annotation wildcard_database_v4.0.0.fasta \
--wildcard_annotation_all_models wildcard_database_v4.0.0_all.fasta \
--wildcard_index wildcard/index-for-model-sequences.txt \
--wildcard_version 4.0.0 \
--amr_kmers wildcard/all_amr_61mers.txt \
--kmer_database wildcard/61_kmer_db.json \
--kmer_size 61
rgi main \
--input_type contig \
--alignment_tool DIAMOND \
--num_threads $(nproc) \
--include_loose \
--split_prodigal_jobs \
--input_sequence sample.contigs.fa \
--output_file sample
rgi bwt \
-n $(nproc) \
--include_wildcard \
--include_other_models \
-1 sample.R1.fastq.gz \
-2 sample.R1.fastq.gz \
-o sample
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment