Protocol Citation: Chandrashekar K, Anagha S Setlur, S Pooja, M Purushotham Rao, Vidya Niranjan 2024. MetaAMRSpotter: Automated workflow with shell scripting for uncovering hidden AMR hotspots from metagenomes. protocols.io https://dx.doi.org/10.17504/protocols.io.e6nvw1jyzlmk/v1
License: This is an open access protocol distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited
Protocol status: Working
We use this protocol and it's working
Created: May 20, 2024
Last Modified: May 21, 2024
Protocol Integer ID: 100114
Keywords: AMR gene prediction, metagenomics, automated pipeline, shell scripting, analyzing metagenomic data, robust solution for metagenomic data analysis, metagenomic data analysis, metagenomic, metagenomic data from various sample, amr hotspots from metagenome, raw sequencing read, amr gene prediction, metagenome, functionalities for pathogen identification, pathogen identification, genome, automated workflow with shell scripting, sequencing, metaamrspotter, pipeline for each sample, gene detection, automated workflow, uncovering of hidden amr hotspot, antimicrobial resistance, different software tool, pipeline, hidden amr hotspot, friendly pipeline
Disclaimer
This protocol can be run on Linux & Ubuntu systems with enough RAM and memory (for databases and tools) to enable appropriate data run and generation.
Abstract
This protocol employs a novel, open-source automated pipeline scripted entirely in shell for analyzing metagenomic data from various samples. Designed to streamline the workflow, the pipeline integrates functionalities for pathogen identification, antimicrobial resistance (AMR) gene detection, and listing the probable antibiotics to which the genes are resistant. This user-friendly pipeline eliminates the need for manual tools installation and configuration, simplifying the analysis process. It directly analyzes raw sequencing reads, if there is presence of appropriate reference genomes and runs through the pipeline for each sample. This protocol runs nine tools together, with just one input given at the start of the program. Demonstrated using publicly available data on both a desktop Linux system and a high-performance computing cluster, the pipeline acknowledges potential variations arising from different software tools and versions, providing users the flexibility to modify them as needed. This approach offers a robust solution for metagenomic data analysis from varied samples, facilitating efficient and accurate detection and uncovering of hidden AMR hotspots.
Keywords: AMR gene prediction, metagenomics, automated pipeline, shell scripting
Guidelines
This protocol works well for paired end metagenome samples.
Materials
This protocol employs nine tools that are automated to run one after the other.
Troubleshooting
Safety warnings
NA
Ethics statement
NA
Before start
1. All necessary tools and databases must be downloaded and installed.
2. Make sure the reference file for the respective selected organism is indexed and placed in the reference folder.
RETRIEVAL OF METAGENOME SAMPLES
The metagenomic samples of various organisms can be retrieved from NCBI SRA. Respective organisms' reference genomes can also be downloaded from NCBI Ref-Seq and indexed.
The following command can be used for indexing the reference:
Command
Indexing
bowtie2-build <reference.fasta> <index_name>
DIRECTORY SPECIFICATION AND UNZIPPING FILES
Specify the directory of the file and unzip all .gz files in the directory. Check if the file is found first and if yes, then proceed to the next step.
Code provided below:
Note
# Specify the
directory where your .gz files are located
# Unzip all .gz
files in the directory
for file in *.gz;
do
# Check if the file exists and is a .gz file
if [ -e "$file" ]; then
echo "Unzipping $file..."
gunzip "$file"
echo "Done."
else
echo "File not found or not a .gz
file: $file"
fi
done
RUNNING FASTQC
This tool describes the quality of the raw sequence data which is a result of high through-put sequencing techniques. The tool measures length distribution, GC content and level of duplications. Quality score for the sequence which has the potency to have low-quality regions will be detected and the tool also analyzes the adapter sequence and overexpressed k-mers which could lead to errors.
The following code was used to run FastQC for selected genomes.
Note
# Check if the "fastqc" directory exists,
and create it if not
if [ ! -d "fastqc" ]; then
mkdir fastqc
fi
# Create an array to store unique prefixes
prefixes=()
# Loop through all FASTQ and FASTQ.gz files in the
current directory
for input_file in *.fastq; do
# Extract the
prefix from the input file name
prefix=$(basename "$input_file" | sed -E
's/_[12]\.(fastq|fastq.gz)//')
# Check if the
prefix is already in the array
if [[ ! "
${prefixes[@]} " =~ " $prefix " ]]; then
This tool is designed to pre-process the next-generation sequencing data. Trimming will enhance the quality of the file. The tool supports both single-end read and paired-end reads data. The tool eliminates low-quality reads which optimizes ensuring all the high-quality data are retained.
The below code runs Trimmomatic.
Note
# Define Trimmomatic command with desired parameters
# Check the
exit status of the Trimmomatic command
if [ $? -eq
0 ]; then
echo
"Trimmomatic completed successfully for $prefix."
else
echo
"Trimmomatic encountered an error for $prefix."
fi
ALIGNMENT USING BOWTIE2
Bowtie aligns sequences against the references and it supports gapped, local and paired-end alignment. It generates genome index using a technique called Burrows-Wheeler Transform (BWA) via similar algorithms such as Needleman-Wunch and Smith Waterman algorithms. This tool will optimize the sequence read by alignment process.
SPAdes is a genome assembly tool which works on de Bruijn Graph algorithm that reconstructs the entire genomes sequence by reading the fragments. It provides simplified graphs for the user. The tool measures the distance between k-mers and adjusts the scores to accurate distances. The contig file generated has valuable information and are high-quality assemblies that are optimized and analyzed for sequenced data.
The tool abbreviation stands for Quality Assessment Tool to analyze the genome assembled. The tool compares the sequence by either comparing with the available reference genome to identify the gaps in the contigs or performs de novo comparison without the reference genome and predicts the assembly quality. This tool optimizes the assembled file and predicts the low gene-coverage and provides possible results with tables and graphs.
PROFILING USING METAPHLAN
Metaphlan is the most diversely used computational tool to perform microbial profiling. It mainly focuses on metagenomic shot-gun sequencing data. The database has pre-defined markers specific to the microbial community and the sequencing data aligns against the database. The assigned reads are taxonomical labels to the given samples. It provides insights in composition and diversity of microbial populations. It is essential to determine the microbes in agriculture, health-disease, pathology and food production.
The codes for running Quast and Metaphlan are provided below:
Abricate is a computational tool to identify antimicrobial resistance genes and virulence genes. Microbial genome is considered as the input. The tool uses database which contains AMR genes and is specific to sequences associated to resistance to antibiotics. Followed by comparison of sequence against the reference to determine the high similarity to sequence in AMR gene database.
ABRICATE PLASMID FINDER
This tool is used to identify the plasmids in the bacterial genome that could have adapted antimicrobial resistance genes, this serves as reference to identify the similarity. The report generated has names corresponding to the matched plasmid and the alignment coverage scores.
ABRICATE VIRULENCE FACTOR
This is used to find similarity against virulence factor using a pre-built database. The report generated consist of specific virulence factors' names, the alignment coverage and the virulence factor associated. The virulence factors indicate the risk of pathogenicity specific to the bacterium and this helps to understand the crucial need of developing potential therapies.
Codes for running abricate and detection of AMR genes:
STITCHING THESE CODES TOGETHER - FORMULATING WHOLE PIPELINE
These individual codes for each tool were stitched together thereby automating the entire protocol for easy use. All users who would like to use this protocol may choose to stitch the code to run the workflow.
EXPECTED OUTCOMES - HUMAN, POULTRY AND GOAT DEMO
This shell scripted workflow has been run for human genomes, poultry and goat to identify the AMR genes and the possible antibiotics they are resistant to. Expected outcomes are provided below.
Detection of poultry AMR genes from poultry metagenome sample
The reference genomes must be taken according to the genome in question being studied.
Expected result
1. As noted above, the AMR genes can be detected for various samples, with the antibiotics they are resistant to.
2. This workflow may be applied to diverse range of samples to uncover any hidden AMR hotspots.
CONCLUSION
This study thus introduces an open-source pipeline for streamlined and quick analysis of metagenomic data from various samples. Scripted entirely in shell, it integrates pathogen identification, AMR gene detection, and antibiotic resistance prediction. The pipeline directly analyzes raw reads whose quality checks have been completed priorly, eliminating manual tool setup and simplifying workflows. Demonstrated on diverse samples, it offers flexibility for customization and facilitates efficient AMR gene detection. Thus, this workflow may be applied to diverse range of samples to uncover any hidden AMR hotspots.
ACKNOWLEDGEMENTS
We would like to thank Dr. Akshatha Prasanna, Assistant Professor, Department of Biotechnology, Dayananda Sagar College of Engineering for her inspiring work that led us to this study. The authors are also extremely grateful to Mr. Akshay Uttarkar, Research Scholar at RV College of Engineering, for providing all his valuable inputs.
Special thanks to our research interns Vasupradha SH, Shreya Vinod and Rajnee Joel for helping the authors run the protocol for different samples.
Protocol references
1. Prasanna, A., & Niranjan, V. (2021). Clin-mNGS: Automated Pipeline for Pathogen Detection from Clinical Metagenomic Data. Current Bioinformatics, 16(2), 306-314. https://doi.org/10.2174/1574893615999200608130029
2. de Sena Brandine, G., & Smith, A. D. (2019). Falco: high-speed FastQC emulation for quality control of sequencing data. F1000Research, 8, 1874. https://doi.org/10.12688/f1000research.21142.2
3. Bolger, A. M., Lohse, M., & Usadel, B. (2014). Trimmomatic: a flexible trimmer for Illumina sequence data. Bioinformatics (Oxford, England), 30(15), 2114–2120. https://doi.org/10.1093/bioinformatics/btu170
4. Langdon W. B. (2015). Performance of genetic programming optimised Bowtie2 on genome comparison and analytic testing (GCAT) benchmarks. BioData mining, 8(1), 1. https://doi.org/10.1186/s13040-014-0034-0
5. Bankevich, A., Nurk, S., Antipov, D., Gurevich, A. A., Dvorkin, M., Kulikov, A. S., Lesin, V. M., Nikolenko, S. I., Pham, S., Prjibelski, A. D., Pyshkin, A. V., Sirotkin, A. V., Vyahhi, N., Tesler, G., Alekseyev, M. A., & Pevzner, P. A. (2012). SPAdes: a new genome assembly algorithm and its applications to single-cell sequencing. Journal of computational biology : a journal of computational molecular cell biology, 19(5), 455–477. https://doi.org/10.1089/cmb.2012.0021
6. Gurevich, A., Saveliev, V., Vyahhi, N., & Tesler, G. (2013). QUAST: quality assessment tool for genome assemblies. Bioinformatics (Oxford, England), 29(8), 1072–1075. https://doi.org/10.1093/bioinformatics/btt086
7. Davies, T. J., Swann, J., Sheppard, A. E., Pickford, H., Lipworth, S., AbuOun, M., Ellington, M. J., Fowler, P. W., Hopkins, S., Hopkins, K. L., Crook, D. W., Peto, T. E. A., Anjum, M. F., Walker, A. S., & Stoesser, N. (2023). Discordance between different bioinformatic methods for identifying resistance genes from short-read genomic data, with a focus on Escherichia coli. Microbial genomics, 9(12), 001151. https://doi.org/10.1099/mgen.0.001151