Analyse de données métagénomiques 16S - FROGS

Module 20

Olivier Rué

MaIAGE - Migale

September 12, 2023

FROGS

FROGS team

  • FROGS is a INRAE development project

FROGS articles

 

How to use FROGS

  • Command line
remove_chimera.py 
  --input-biom clustering.biom \ 
  --input-fasta clustering.fasta \
  --non-chimera remove_chimera.fasta \
  --out-abundance remove_chimera.biom \
  --summary remove_chimera.html
  • Galaxy instances via web

FROGS docs and help

  • Website: https://frogs.toulouse.inrae.fr
  • Github: https://github.com/geraldinepascal/FROGS.git
  • Newsletter: subscription request at frogs-support@inrae.fr
  • Need help
    • frogs-support@inrae.fr for generic questions
    • help-migale@inrae.fr for bugs/quotas/errors with Galaxy Migale instance

TP1: Introduction to Galaxy

Sequencing data

FASTQ format

@ST-E00114:1342:HHMGVCCX2:1:1101:3123:2012 1:N:0:TCCGGAGA+TCAGAGCC
CTTGGTCATTTAGAG
+
***<<*AEF???***
@ST-E00114:1342:HHMGVCCX2:1:1101:11556:2030 1:N:0:TCCGGAGA+TCAGAGCC
CATTGGCCATATCAT
+
AAAE??<<*???***

Meaning

@Identifier1 (comment)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ
@Identifier2 (comment)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ

Quality score encoding

Quality score

Measure of the quality of the identification of the nucleobases generated by automated DNA sequencing

FASTQ compression

  • Compression is essential to deal with FASTQ files (reduce disk storage)
  • extension: file.fastq.gz
  • Tools are (almost all) able to deal with compressed files

Quality control

Quality control

  • One of the most easy step in bioinformatics …
  • … but one of the most important
  • check if everything is ok
  • Indicates if/how to clean reads
  • Shows possible sequencing problems
  • The results must be interpreted in relation to what has been sequenced

Reads are not perfect

Why QC’ing your reads?

Try to answer to (not always) simple questions:

  • Are data conform to the expected level of performance?
    • Size / Number of reads / Quality
  • Residual presence of adapters or indexes?
  • (Un)expected techincal biases?
  • (Un)expected biological biases?

Warning

QC without context leads to misinterpretation!

TP2: Quality control

Demultiplexing

Multiplexing principle

Demultiplexing by bioinformatics

Demultiplexing tool

  • Assign each read to FASTQ files depending on barcode found
  • BARCODE FILE is expected to be tabular:
    • first column corresponds to the sample name (unique, without space)
    • second to the forward sequence barcode used (None if only reverse barcode)
    • optional third is the reverse sequence barcode (optional)

TP DEMULTIPLEXING

Advices

  • Do not forget to indicate barcode sequence as they are in the fastq sequence file, especially if you have data multiplexed via the reverse strand.
  • For the mismatch threshold, we advised you to let the threshold to 0, and if you are not satisfied by the result, try with 1. The number of mismatch depends on the length of the barcode, but often those sequences are very short so 1 mismatch is already more than the sequencing error rate.
  • If you have different barcode lengths, you must demultiplex your data in different times beginning by the longest barcode set and used the “unmatched” or “ambiguous” sequence with smaller barcode and so on.

FROGS preprocess

What FROGS preprocess does?

  • Merging of R1 and R2 reads with vsearch [4], flash [5] or pear [6] (only in command line)
  • Deletes sequences without good primers
  • Finds and removes adapter sequences with cutadapt
  • Deletes sequence with not expected lengths
  • Deletes sequences with ambiguous bases (N)
  • Dereplication
  • removing homopolymers (size = 8) for 454 data
  • quality filter for 454 data

Merging of paired-end reads

TP FROGS preprocess

Clustering

Sequencing data are noised

How to deal with these noised sequences?

  • Comparison all against all
    • Very accurate
    • Requires a lot of memory and/or time
  • Clustering
    • closed-reference / open-reference
    • de novo
  • Denoising

Vocabulary

  • A lot of terms for features built by softwares
    • OTUs, zOTUS, ASVs, ESVs…
  • A recent review establishes the vocabulary [7]
    • OTUs / ASVs / swarm clusters
  • ASVs are identical denoised reads with as few as 1 base pair difference between variants, representing an inference of the biological sequences prior to amplification and sequencing errors
  • OTUs are formed with a % threshold clustering
  • Swarm clusters are a third feature type

OTU paradigm

  • Operational Taxonomic Unit

Operational Taxonomic Units

Operational Taxonomic Units

Operational Taxonomic Units

ASV paradigm

  • Amplicon Sequence Variants

ASV are inferred by a de novo process in which biological sequences are discriminated from errors on the basis of the expectation that biological sequences are more likely to be repeatedly observed than are error-containing sequences

ASV resolution

  • ASV resolution changes the composition for these samples

Swarm

Swarm [8] is a notably different sequence clustering approach, which, while technically a clustering algorithm, may also be considered a denoising method when using the fastidious method with d=1. It relies on the maximum number of differences between reads (local linking threshold) and forms clusters that are resilient to input-order changes, thus creating stable, high-resolution features (herein referred to as swarm-clusters). When using the fastidious method with d=1, swarm aims to produce clusters centered around real biological sequences, where clusters represent sequence variants.

Since FROGS uses swarm (with the fastidious method with d=1) and strongly promotes denoising by chimera removal and cluster filtering, FROGS produces ASVs.

Why Swarm?

  • Fixed clustering threshold is a real problem
  • OTUs construction is input-order depenent

Swarm: A smart idea

Swarm

  • A robust and fast clustering method for amplicon-based studies
  • The purpose of swarm is to provide a novel clustering algorithm to handle large sets of amplicons
  • swarm results are resilient to input-order changes and rely on a small local linking threshold d, the maximum number of differences between two amplicons
  • swarm forms stable high-resolution clusters, with a high yield of biological information
  • Default: forms a lot of low-abundant OTUs that are in fact artifacts and need to be removed
  • Swarm (fastidious method + d=1) clusters + filters → ASVs

d: the small local linking threshold

Swarm steps

Which method to choose?

Advantages and inconvenients

  • Which type of features to prefer may be context-dependent, and both may even be used in the same study
  • ASV demonstrate a biologically informative fine-scale resolution [9]
  • But difficult to separate noise from a real signal in low abundant reads [10]
  • ASVs represent stable and reproducible units across studies whereas OTUs are dataset-specific features (swarm clusters are not )
    • problematic for longitudinal and very big studies

FROGS will soon offer the choice between swarm and dada2 for ASV creation

TP FROGS clustering

Chimera removal

Chimera detection strategies

  • Reference based: against a database of «genuine» sequences

    • dependant of the references used
  • De novo: against abundant sequences in the samples

  • FROGS uses vsearch [4] as chimera removal tool

A little extra: the sample-cross validation

  • FROGS adds a sample-cross validation

Chimera rates in samples

  • From 5 to 40% in 16S data

  • Few with ITS (<10%)

TP Frogs remove chimera

Abundance/Prevalence filters

How to filter clusters?

  • Low abundant sequences
  • Clusters not shown in few replicates
  • Contamination

TP Frogs cluster filters

Taxonomic affiliation

Comparison of approaches

RDP problems

  • Depends too much on the databank used!
  • Gives one affiliation for each feature with bootstrap, on each subdivision
Bacteria;(1.0);Actinobacteriota;(1.0);Actinobacteria;(1.0);Propionibacteriales;(1.0);Propionibacteriaceae;(1.0);Cutibacterium;(1.0);Cutibacterium acnes;(0.57);

The FROGS recommandation

  • Use Blast and not RDP
  • Check Blast metrics to avoid concluding too fast
  • Take care of the reference databank used!
Bacteria;Actinobacteriota;Actinobacteria;Propionibacteriales;Propionibacteriaceae;Cutibacterium;Multi

The FROGS databanks

  • Command line: you can use your own databank
  • Galaxy
  • The file must be well formated, we can do it for you
  • For private databanks, contact us!

The FROGS extra: the multi-affiliations

  • FROGS gives all identical hits
Bacteria;Firmicutes;Bacilli;Staphylococcales;Staphylococcaceae;Staphylococcus;Staphylococcus xylosus
Bacteria;Firmicutes;Bacilli;Staphylococcales;Staphylococcaceae;Staphylococcus;Staphylococcus saprophyticus

Strictly identical (V1-V3 amplification) on 499 nucleotides

  • FROGS can’t decide if it’s one or another
  • You have to check if you can choose between multi-affiliations

To help you

Filter ASVs on their affiliation

Affiliation filters

  • Remaining contamination?

  • Want to analyse only the Firmicutes?

  • 2 modes

    • Deleting: remove ASVs
    • Hiding: only the affiliation is modified, not the abundance

Phylogenetic tree

FROGS tree

  • This tool builds a phylogenetic tree thanks to affiliations of ASVs contained in the BIOM file
  • Needed to compute beta-diversity indices based on phylogenetic distances
  • Interesting to explore poor-characterized environments

FROGSfunc: function inference

Concepts

Based on PICRUSt2

  • PICRUSt [13] (Phylogenetic investigation of communities by reconstruction of unobserved states) is an open-source tool.
  • It is a software for predicting functional abundances based only on marker gene sequences
  • PICRUSt2 is composed of 4 python applications.
  • No graphic interface exists to run PICRUSt2 for non-expert users.

How it works

  1. Places the ASVs into a reference phylogenetic tree and predicts of marker copy number in each ASV.
  2. Predicts number of function copy number in each ASV and calculates functions abundances in each sample and ASV abundances according to marker copy number.
  3. Calculates pathway abundances in each sample.

FROGSfunc placeseqs and copynumber

FROGSfunc placeseqs and copynumber

NSTI

  • NSTI scores are simply the average branch length that separates each ASV in your sample from a reference bacterial genome, weighted by the abundance of that ASV in the sample.
  • PICRUSt2 sets NSTI threshold to 2 per default. Some studies have shown that this threshold is permissive. Thus, it is important to see if the taxonomies between PICRUSt2 and FROGS are quite similar or not, in order to potentially choose a more stringent threshold afterwards.
    • 0 < Good < 0.5
    • 0.5 <= Medium < 1
    • 1 <= Bad < 2
    • To exclude >= 2

FROGSfunc functions

FROGSfunc pathways

References

1. Escudié F, Auer L, Bernard M, Mariadassou M, Cauquil L, Vidal K, et al. FROGS: Find, Rapidly, OTUs with Galaxy Solution. Bioinformatics. 2018;34:1287–94. doi:10.1093/bioinformatics/btx791.
2. Bernard M, Rué O, Mariadassou M, Pascal G. FROGS: a powerful tool to analyse the diversity of fungi with special management of internal transcribed spacers. Briefings in Bioinformatics. 2021;22. doi:10.1093/bib/bbab318.
3. Stoler N, Nekrutenko A. Sequencing error profiles of Illumina sequencing instruments. NAR Genomics and Bioinformatics. 2021;3. doi:10.1093/nargab/lqab019.
4. Rognes T, Flouri T, Nichols B, Quince C, Mahé F. VSEARCH: A versatile open source tool for metagenomics. PeerJ. 2016;4:e2584.
5. Magoč T, Salzberg SL. FLASH: Fast length adjustment of short reads to improve genome assemblies. Bioinformatics. 2011;27:2957–63.
6. Zhang J, Kobert K, Flouri T, Stamatakis A. PEAR: A fast and accurate illumina paired-end reAd mergeR. Bioinformatics. 2013;30:614–20.
7. Hakimzadeh A, Abdala Asbun A, Albanese D, Bernard M, Buchner D, Callahan B, et al. A pile of pipelines: An overview of the bioinformatics software for metabarcoding data analyses. Molecular Ecology Resources. 2023.
8. Mahé F, Rognes T, Quince C, Vargas C de, Dunthorn M. Swarm v2: Highly-scalable and high-resolution amplicon clustering. PeerJ. 2015;3:e1420.
9. Couton M, Baud A, Daguin-Thiébaut C, Corre E, Comtet T, Viard F. High-throughput sequencing on preservative ethanol is effective at jointly examining infraspecific and taxonomic diversity, although bioinformatics pipelines do not perform equally. Ecology and Evolution. 2021;11:5533–46.
10. De Santiago A, Pereira TJ, Mincks SL, Bik HM. Dataset complexity impacts both MOTU delimitation and biodiversity estimates in eukaryotic 18S rRNA metabarcoding studies. Environmental DNA. 2022;4:363–84.
11. Group JCHMPDGW. Evaluation of 16S rDNA-based community profiling for human microbiome research. PloS one. 2012;7:e39315.
12. Murali A, Bhargava A, Wright ES. IDTAXA: A novel approach for accurate taxonomic classification of microbiome sequences. Microbiome. 2018;6:1–14.
13. Douglas GM, Maffei VJ, Zaneveld JR, Yurgel SN, Brown JR, Taylor CM, et al. PICRUSt2 for prediction of metagenome functions. Nature biotechnology. 2020;38:685–8.