# 16S Microbial analysis with Nanopore data

### Overview

Questions:
• How can we analyse the health status of the soil?

• How do plants modify the composition of microbial communities?

Objectives:
• Use Nanopore data for studying soil metagenomics

• Analyze and preprocess Nanopore reads

• Use Kraken2 to assign a taxonomic labels

Requirements:
Time estimation: 2 hours
Supporting Materials:
Last modification: Oct 16, 2021

# Introduction

Healthy soils are an essential element in maintaining the planet’s ecological balance. That is why their protection must be considered a priority in order to guarantee the well-being of humanity. The alteration of microbial populations often precedes changes in the physical and chemical properties of soils, so monitoring their condition can serve to predict their future evolution, allowing to develop strategies to mitigate ecosystem damage.

Advances in sequencing technologies have opened up the possibility of using the study of taxa present in bacterial communities as indicators of soil condition. For such an approach to be possible, variations in microbial populations need to be less affected by spatial factors than by human-derived alterations, which has been confirmed by various investigations (Hermans et al. 2016, Fierer and Jackson 2006).

Among the environmental variables that have shown the greatest correlation with alterations in the composition of bacterial communities are soil pH, the carbon-nitrogen ratio (C:N), and the co-concentrations of Olsen P (a measure of plant available phosphorus), aluminium and copper (Fig. 1).

On the other hand, many species of microorganisms establish complex symbiotic relationships with plant organisms. The fraction of the substrate that is directly influenced by root secretions and associated microorganism is known as rhizosphere. Thus, for example, bacteria of the genus Bacillus, Pseudomonas or Burkholderia appear associated with the plant roots, protecting them from pathogenic microorganisms.

In this tutorial, we will use sequencing data obtained through the MinION sequencer (Oxford Nanopore Technologies) with two objectives: 1) evaluate the health status of soil samples and 2) study how microbial populations are modified by their interaction with plant roots. This example was inspired by Brown et al. 2017.

### Agenda

In this tutorial, we will cover:

# Background on data

Next, we will introduce some details about the datasets that we are going to use to perform the analysis.

## The datasets

In this example, we will use a dataset originally hosted in the NCBI SRA database, with the accession number SRP194577. To obtain the samples, the DNA was extracted using the Zymo Research Kit, followed by PCR amplification of 16S rRNA genes. Sequencing was carried out on a Nanopore Minion device. We are going to use four datasets, corresponding to two experimental conditions:

• Soil:
• Surface sample (0-5 cm): bulk_top.fastq.gz
• Deep sample (10-15 cm): bulk_bottom.fastq.gz
• Rhizosphere:
• Surface sample (0-5 cm): rhizosphere_top.fastq.gz
• Deep sample (10-15 cm): rhizosphere_bottom.fastq.gz

### question Question

Why do we sequence the 16S rRNA genes for analyzing microbial communities?

### solution Solution

There are several reasons to use these genes as taxonomic markers. First, they are constituent parts of ribosomes, a piece of highly-conserved biological machinery, which makes them universally distributed. On the other hand, these genes present regions with varying degrees of sequence variability, which allows them to be used as a species-specific signature.

# Get data

1. Create a new history for this tutorial
2. Import the files from Zenodo:

• Click on Collection tab
• Click of the Paste/Fetch button
• Paste the Zenodo links and press Start and Build
 https://zenodo.org/record/4274812/files/bulk_bottom.fastq.gz
https://zenodo.org/record/4274812/files/bulk_top.fastq.gz
https://zenodo.org/record/4274812/files/rhizosphere_bottom.fastq.gz
https://zenodo.org/record/4274812/files/rhizosphere_top.fastq.gz

• Assign a name to the new collection: soil collection
• Open the Galaxy Upload Manager (galaxy-upload on the top-right of the tool panel)

• Select Paste/Fetch Data
• Paste the link into the text field

• Press Start

• Close the window

• By default, Galaxy uses the URL as the name, so rename the files with a more useful name.

### Tip: Importing data from a data library

As an alternative to uploading the data from a URL or your computer, the files may also have been made available from a shared data library:

• Go into Shared data (top panel) then Data libraries
• Navigate to the correct folder as indicated by your instructor
• Select the desired files
• Click on the To History button near the top and select as Datasets from the dropdown menu
• In the pop-up window, select the history you want to import the files to (or create a new one)
• Click on Import

# Assess datasets quality

Before starting to work on our datasets, it is necessary to assess their quality. This is an essential step if we aim to obtain a meaningful downstream analysis.

### details FASTQ sequence quality format

FASTQ format is a text-based format for storing both a biological sequence and its corresponding quality scores. Both the sequence letter and the quality score are encoded with a single ASCII character for brevity. You can find more info in the Wikipedia article.

## Quality control using FastQC and MultiQC

FastQC is one of the most widely used tools to check the quality of the samples generated by High Throughput Sequencing (HTS) technologies.

### hands_on Hands-on: Quality check

1. FastQC Tool: toolshed.g2.bx.psu.edu/repos/devteam/fastqc/fastqc/0.72+galaxy1 with the following parameters:
• param-collection “Dataset collection”: soil collection
2. Rename the outputs as FastQC unprocessed: Raw and FastQC unprocessed: Web
3. MultiQC Tool: toolshed.g2.bx.psu.edu/repos/iuc/multiqc/multiqc/1.8+galaxy1 with the following parameters:
• In “Results”:
• “Which tool was used generate logs?”: FastQC
• param-collection “Dataset collection”:

• FastQC unprocessed: Raw
4. Click on the galaxy-eye (eye) icon and inspect the generated HTML file

FastQC provides information on various parameters, such as the range of quality values across all bases at each position. MultiQC allows summarizing the output of different outputs from FastQC.

In the first place, we are going to analyse the sequence length distribution of the different datasets.

### question Question

1. Can you explain the sequence length distribution plot?

### solution Solution

The main peak, around 1700 bp, corresponds approximately to the length of the gene coding for 16S rRNA. There is also a secondary peak around 200 bp, which may be due to truncated amplifications, or as a result of non-specific hybridization of primers used for PCR.

If we examine figure 3, we can see that up to 3000 bp the quality of our sequencing data is around a Phred score of 12, which is a relatively low value compared to other sequencing technologies. This is explained because Nanopore reads poses high error rates in the basecalled reads (10% as compared to 1% for Illumina). However, Nanopore sequencing generates very long reads (in theory only limited by the mechanisms of extraction of the genetic material), enabling the sequencing of the complete 16S rRNA gene, which makes it possible to identify bacterial taxa at higher resolution.

Let’s have a look at figure 4, which shows the content of the GC by sequence.

### question Questions

What can cause GC content to show a bimodal peak?

### solution Solution

There are several possible causes for the presence of twin peaks in the GC content. One possible explanation is the presence of adapters in the sequence. Another possible cause is some kind of contamination, such as chimeras.

# Improve the dataset quality

In order to improve the quality of our data, we will use two tools presented above, porechop and fastp.

## Adapter and chimera removal with porechop

Nanopore sequencing technology requires to ligate adapters to both ends of genomic material to facilitate the strand capture and loading of a processive enzyme at the 5’end, boosting the effectiveness of the sequencing process. Adapter sequences should be removed because they can interfere with aligment of reads to 16S rRNA gene reference database, for which we will use the porechop tool (Wick 2017).

### comment Comment

If you are interested in Nanopore sequecing technology, you can find more information in Jain et al. 2016.

On the other hand, chimeric sequences are considered a contaminant and should be removed because they can result in artificial inflation of the microbial diversity. With Porechop you can eliminate them.

### hands_on Hands-on: Remove adapters with porechop

1. Porechop Tool: toolshed.g2.bx.psu.edu/repos/iuc/porechop/porechop/0.2.3 with the following parameters:
• “Input FASTA/FASTQ”: param-collection soil collection
• “Output format for the reads: fastq
2. Rename the output as soil collection trimmed

## Filter sequences with fastp

To increase the specificity of the analysis, we will select the reads with lengths between 1000 bp and 2000 bp, which are more informative from a taxonomic point of view, because they include both preserved and hypervariable regions of the 16S rRNA gene. In addition, sequences will be filtered on a minimum average read quality score of 9, according to the recommendations from Nygaard et al. 2020. This stage will be carried out through the use of fastp (Chen et al. 2018), an open-source tool designed to process FASTQ files.

### hands_on Hands-on: Filter sequence with fastp

1. fastp Tool: toolshed.g2.bx.psu.edu/repos/iuc/fastp/fastp/0.20.1+galaxy0 with the following parameters:
• “Single-end or paired reads: Single-end
• param-collection “Dataset collection”: soil collection trimmed
• “Disable adapter trimming”: Yes
• In “Filter Options”:
• In “Quality filtering options”:
• “Qualified quality phred”: 9
• In “Length filtering options”:
• “Length required”: 1000
• “Maximum length”: 2000
• “PolyG tail trimming”: Disable polyG tail trimming
2. Rename the output as soil collection processed

# Re-evaluate datasets quality

After processing the sequences, we are going to analyze them again using FastQC and MultiQC to see if we have managed to correct the anomalies that we had detected.

### hands_on Hands-on: Quality check

1. FastQC Tool: toolshed.g2.bx.psu.edu/repos/devteam/fastqc/fastqc/0.72+galaxy1 with the following parameters:
• param-collection “Dataset collection”: soil collection processed
2. Rename the outputs as FastQC processed: Raw and FastQC processed: Web
3. MultiQC Tool: toolshed.g2.bx.psu.edu/repos/iuc/multiqc/multiqc/1.8+galaxy1 with the following parameters:
• In “Results”:
• “Which tool was used generate logs?”: FastQC
• param-collection “Dataset collection”:

• FastQC processed: Raw
4. Click on the galaxy-eye (eye) icon and inspect the generated HTML file

We can verify that after processing the samples, the GC content presents a unimodal distribution, which indicates that the anomalies in the sequences have been successfully eliminated (Figure 6).

# Assign taxonomic classifications

One of the key steps in metagenomic data analysis is to identify the taxon to which the individual reads belong. Taxonomic classification tools are based on microbial genome databases to identify the origin of each sequence.

## Taxonomic classification with Kraken2

To perform the taxonomic classification we will use Kraken2 (Wood et al. 2019). This tool uses the minimizer method to sample the k-mers (all the read’s subsequences of length k) in a deterministic fashion in order to reduce memory constumption and processing time. In addition, it masks low-complexity sequences from reference sequences by using dustmasker.

Kraken2 uses a compact hash table, a probabilistic data structure that allows for faster queries and lower memory requirements. It applies a spaced seed mask of s spaces to the minimizer and calculates a compact hash code, which is then used as a search query in its compact hash table; the lowest common ancestor (LCA) taxon associated with the compact hash code is then assigned to the k-mer. You can find more information about the Kraken2 algorithm in the paper Improved metagenomic analysis with Kraken 2.

For this tutorial, we will use the SILVA database (Quast et al. 2012). It includes over 3.2 million 16S rRNA sequences from the Bacteria, Archaea and Eukaryota domains.

### hands_on Hands-on: Assign taxonomic labels with Kraken2

1. Kraken2 Tool: toolshed.g2.bx.psu.edu/repos/iuc/kraken2/kraken2/2.0.8_beta+galaxy0 with the following parameters:
• “Single or paired reads: Single
• param-collection “Dataset collection”: soil collection processed
• “Print scientific names instead of just taxids”: Yes
• “Confidence”: 0.1
• In “Create Report”:
• “Print a report with aggregrate counts/clade to file”: Yes
• “Format report output like Kraken 1’s kraken-mpa-report”: Yes
• “Select a Kraken2 database”: Silva (Created: 2020-06-24T164526Z, kmer-len=35, minimizer-len=31, minimizer-spaces=6)

### comment Comment

A confidence score of 0.1 means that at least 10% of the k-mers should match entries in the database. This value can be reduced if a less restrictive taxonomic assignation is desired.

# Analyze taxonomic assigment

Once we have assigned the corresponding taxa to each sequence, the next step is to properly visualize the data, for which we will use the Krona pie chart tool (Ondov et al. 2011). But before that, we need to adjust the format of the data output from Kraken2.

### hands_on Hands-on: Adjust dataset format

1. Reverse Tool: toolshed.g2.bx.psu.edu/repos/iuc/datamash_reverse/datamash_reverse/1.1.0 with the following parameters:
• param-collection “Dataset collection”: Report: Kraken2 on collection
2. Replace Text Tool: toolshed.g2.bx.psu.edu/repos/bgruening/text_processing/tp_replace_in_line/1.1.2 with the following parameters:
• param-collection “Dataset collection”: Reverse on collection
• In “Replacement”:
• param-repeat “Insert Replacement”
• “Find pattern”: \|
• “Replace with”: \t
3. Remove beginning Tool: Remove beginning1 with the following parameters:
• param-collection “Dataset collection”: Replace Text on collection

## Visualize the taxonomical classification with Krona

Krona allows hierarchical data to be explored with zooming, multi-layered pie charts. With this tool, we can easily visualize the composition of the bacterial communities and compare how the populations of microorganisms are modified according to the conditions of the environment.

### hands_on Hands-on: Visualize metagenomics analysis results

1. Krona pie chart Tool: toolshed.g2.bx.psu.edu/repos/crs4/taxonomy_krona_chart/taxonomy_krona_chart/2.7.1 with the following parameters:
• “What is the type of your input data”: Tabular
• param-collection “Dataset collection”: Remove beginning on collection
• “Provide a name for the basal rank”: Bacteria

Let’s take a look at the result. Using the search bar we can check if certain taxa are present.

### question Questions

1. What can we say about the health status of the soil samples?
2. Are there significant differences in the bacterial population structure between soil samples and rhizosphere samples?

### solution Solution

1. The low presence of Alphaproteobacteria (including members of the order Rhizobiales), as well as the abundance of Bacteroidetes and Gammaproteobacteria, suggest that the soil is highly exposed to phosphorus. This mineral is strongly associated with the anthropogenic activity as it is an important component of agrochemicals.
2. We can observe that there are important differences in the structure of the bacterial populations between the soil and rhizosphere samples. Particularly significant is the increase in phylum Planctomycetes, which are usually abundant in the rhizosphere.

# Conclusion

In this tutorial we used MinION Nanopore sequencing data to study the health status of soil samples and the structure of bacterial populations. The results indicate that the soil suffers some degree of erosion as a result of their exposure to agrochemicals. We have also been able to study how the composition of microbial communities is modified in presence of plant organisms.

### Key points

• We learned to use MinION Nanopore data for analyzing the health status of the soil

• We preprocessed Nanopore sequences in order to improve their quality

# Useful literature

Further information, including links to documentation and original publications, regarding the tools, analysis techniques and the interpretation of results described in this tutorial can be found here.

# References

1. Fierer, N., and R. B. Jackson, 2006 The diversity and biogeography of soil bacterial communities. Proceedings of the National Academy of Sciences 103: 626–631. 10.1073/pnas.0507535103
2. Ondov, B. D., N. H. Bergman, and A. M. Phillippy, 2011 Interactive metagenomic visualization in a Web browser. BMC Bioinformatics 12: 10.1186/1471-2105-12-385
3. Quast, C., E. Pruesse, P. Yilmaz, J. Gerken, T. Schweer et al., 2012 The SILVA ribosomal RNA gene database project: improved data processing and web-based tools. Nucleic Acids Research 41: D590–D596. 10.1093/nar/gks1219
4. Wood, D. E., and S. L. Salzberg, 2014 Kraken: ultrafast metagenomic sequence classification using exact alignments. Genome Biology 15: R46. 10.1186/gb-2014-15-3-r46
5. Hermans, S. M., H. L. Buckley, B. S. Case, F. Curran-Cournane, M. Taylor et al., 2016 Bacteria as Emerging Indicators of Soil Condition (F. E. Loeffler, Ed.). Applied and Environmental Microbiology 83: 10.1128/aem.02826-16
6. Jain, M., H. E. Olsen, B. Paten, and M. Akeson, 2016 The Oxford Nanopore MinION: delivery of nanopore sequencing to the genomics community. Genome Biology 17: 10.1186/s13059-016-1103-0
7. Brown, B. L., M. Watson, S. S. Minot, M. C. Rivera, and R. B. Franklin, 2017 MinION™ nanopore sequencing of environmental metagenomes: a synthetic approach. GigaScience 6: 10.1093/gigascience/gix007
8. Wick, R., 2017 Porechop. GitHub. https://github.com/rrwick/Porechop
9. Chen, S., Y. Zhou, Y. Chen, and J. Gu, 2018 fastp: an ultra-fast all-in-one FASTQ preprocessor. 10.1101/274100
10. Wood, D. E., J. Lu, and B. Langmead, 2019 Improved metagenomic analysis with Kraken 2. Genome Biology 20: 10.1186/s13059-019-1891-0
11. Nygaard, A. B., H. S. Tunsjø, R. Meisal, and C. Charnock, 2020 A preliminary study on the potential of Nanopore MinION and Illumina MiSeq 16S rRNA gene sequencing to characterize building-dust microbiomes. Scientific Reports 10: 3209. 10.1038/s41598-020-59771-0

# Feedback

Did you use this material as an instructor? Feel free to give us feedback on how it went.
Did you use this material as a learner or student? Click the form below to leave feedback.

# Citing this Tutorial

1. Cristóbal Gallardo, 2021 16S Microbial analysis with Nanopore data (Galaxy Training Materials). https://training.galaxyproject.org/archive/2021-12-01/topics/metagenomics/tutorials/nanopore-16S-metagenomics/tutorial.html Online; accessed TODAY
2. Batut et al., 2018 Community-Driven Data Analysis Training for Biology Cell Systems 10.1016/j.cels.2018.05.012

### details BibTeX

@misc{metagenomics-nanopore-16S-metagenomics,
author = "Cristóbal Gallardo",
title = "16S Microbial analysis with Nanopore data (Galaxy Training Materials)",
year = "2021",
month = "10",
day = "16"
url = "\url{https://training.galaxyproject.org/archive/2021-12-01/topics/metagenomics/tutorials/nanopore-16S-metagenomics/tutorial.html}",
note = "[Online; accessed TODAY]"
}
@article{Batut_2018,
doi = {10.1016/j.cels.2018.05.012},
url = {https://doi.org/10.1016%2Fj.cels.2018.05.012},
year = 2018,
month = {jun},
publisher = {Elsevier {BV}},
volume = {6},
number = {6},
pages = {752--758.e1},
author = {B{\'{e}}r{\'{e}}nice Batut and Saskia Hiltemann and Andrea Bagnacani and Dannon Baker and Vivek Bhardwaj and Clemens Blank and Anthony Bretaudeau and Loraine Brillet-Gu{\'{e}}guen and Martin {\v{C}}ech and John Chilton and Dave Clements and Olivia Doppelt-Azeroual and Anika Erxleben and Mallory Ann Freeberg and Simon Gladman and Youri Hoogstrate and Hans-Rudolf Hotz and Torsten Houwaart and Pratik Jagtap and Delphine Larivi{\{e}}re and Gildas Le Corguill{\'{e}} and Thomas Manke and Fabien Mareuil and Fidel Ram{\'{\i}}rez and Devon Ryan and Florian Christoph Sigloch and Nicola Soranzo and Joachim Wolff and Pavankumar Videm and Markus Wolfien and Aisanjiang Wubuli and Dilmurat Yusuf and James Taylor and Rolf Backofen and Anton Nekrutenko and Björn Grüning},
title = {Community-Driven Data Analysis Training for Biology},
journal = {Cell Systems}
}
`