TITLE: MetaAMRSpotter: Automated workflow with shell scripting for uncovering hidden AMR hotspots from metagenomes
AUTHORS: Chandrashekar K, Anagha S Setlur, S Pooja, M Purushotham Rao, Vidya Niranjan

[DESCRIPTION]
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

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


[GUIDELINES]
This protocol works well for paired end metagenome samples.

[STEPS]
SECTION: DIRECTORY SPECIFICATION AND UNZIPPING FILES
2. 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:
 

SECTION: RUNNING FASTQC
3. 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.
 

SECTION: RUNNING TRIMMOMATIC
4. 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.
 

SECTION: ALIGNMENT USING BOWTIE2
5. 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. 

The provided code runs Bowtie2 tool.
 

SECTION: SPADES ASSEMBLY
6. 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 below code runs the Spades assembly.
 

SECTION: RUNNING QUAST
7. 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.  
SECTION: PROFILING USING METAPHLAN
8. 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:
 

SECTION: IDENTIFICATION OF AMR GENES
9. ABRICATE AMR

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. 
SECTION: IDENTIFICATION OF AMR GENES
10. 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.
SECTION: IDENTIFICATION OF AMR GENES
11. 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:
 

SECTION: EXPECTED OUTCOMES - HUMAN, POULTRY AND GOAT DEMO
13. 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.
 
 
  
 
  
 
 
The reference genomes must be taken according to the genome in question being studied. 
 


SECTION: CONCLUSION
14. 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.
SECTION: ACKNOWLEDGEMENTS
15. 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.
SECTION: STITCHING THESE CODES TOGETHER - FORMULATING WHOLE PIPELINE
12. 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.
SECTION: RETRIEVAL OF METAGENOME SAMPLES
1. 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: