LEfSe
by JB
‘This post explains what LEfSe is and how LEfSe works. (in personal opinion and review)’
LEfSe ?
LDA Effect Size (LEfSe) (Segata et. al 2010) is An algorithm for High-Dimensional biomarker discovery and explanation that identifies genomic features (genes, pathways, or taxa) characterizing the differences between two or more biological conditions (or classes).
Non-paramteric data
Normal distribution does not fit well to the metagenomic data (https://doi.org/10.21775/cimb.024.017).
The specific property of metagenomic data is that the normal distribution implied in many statistical tests does not describe this type of data well.
- First of all, normal distribution is continuous while the metagenomic sequencing data have discrete nature.
- Second, components of a feature vector cannot be negative. At the same time the mean value of taxon abundance is ofen comparable to its variance and the abundance matrix is sparse (has many zero values).
For example, in the case of gut microbiota, due to the wide diversity of microbial community structures, a typical bacterial species has zero or low abundance in microbiota of the majority of people while only a small fraction of the population carry high abundance (tens of per cent) of this species.A typical histogram of taxon abundance across samples is presented in Figure as below.
Hypothesis testing procedures
Hypothesis testing is a statistical method that is used in making statistical decisions using experimental data.
The following procedure shows that how we test experiments with statistical method according to sample charateristics.
Normality test
First of all, we are able to confirm whether data shows normality or not throughout Shapiro-Wilk test.
Shapiro-Wilk test
The null-hypothesis of this test is that the population is normally distributed.
> library(dplyr)
> library(MASS)
> library(ggplot2)
# test dataset : CO2
# The CO2 data frame from an experiment on the cold tolerance of the grass species Echinochloa crus-galli.
# Type : a factor with levels Quebec Mississippi giving the origin of the plant
# uptake : a numeric vector of carbon dioxide uptake rates (umol/m^2 sec).
#shapiro test
> summarise(group_by(CO2, Type), shapiro.pval=shapiro.test(uptake)$p.value)
# A tibble: 2 x 2
Type shapiro.pval
<fct> <dbl>
1 Quebec 0.000111
2 Mississippi 0.0213
> ggplot(data=CO2, aes(x=uptake, fill=Type)) +
geom_histogram(bins=10, alpha=0.5) +
theme_bw() +
facet_wrap(.~Type)
Analysis steps in LEfSe
There are 3 steps in LEfSe analysis.
-
- Step 1
- Kruskal-Wallis test to detect features with significant differential abundance in different groups
-
- Step 2
- biological consistency is subsequently investigated using a set of pairwise tests among subclasses using the (unpaired) Wilcoxon rank-sum test
-
- Step 3
- LDA to estimate the effect size of each differentially abundant feature and, if desired by the investigator, to perform dimension reduction.
Kruskal Wallis test
If data does not show normality, mean value cannot be used for comparing two or more groups.
The Kruskal–Wallis test by ranks, Kruskal–Wallis H test (named after William Kruskal and W. Allen Wallis), or one-way ANOVA on ranks is a non-parametric method for testing whether samples originate from the same distribution. It is used for comparing two or more independent samples of equal or different sample sizes. It extends the Mann–Whitney U test, which is used for comparing only two groups. The parametric equivalent of the Kruskal–Wallis test is the one-way analysis of variance (ANOVA).
- Null hypothesis: Null hypothesis assumes that the samples (groups) are from identical populations.
- Alternative hypothesis: Alternative hypothesis assumes that at least one of the samples (groups) comes from a different population than the others.
Equation
The distribution of the Kruskal-Wallis test statistic approximates a chi-square distribution, with k-1 degrees of freedom.

-
n = sum of sample sizes in all groups -
K = Number of samples -
R = Sum of ranks in the i'th group
> str(CO2)
Classes ‘nfnGroupedData’, ‘nfGroupedData’, ‘groupedData’ and 'data.frame': 84 obs. of 5 variables:
$ Plant : Ord.factor w/ 12 levels "Qn1"<"Qn2"<"Qn3"<..: 1 1 1 1 1 1 1 2 2 2 ...
$ Type : Factor w/ 2 levels "Quebec","Mississippi": 1 1 1 1 1 1 1 1 1 1 ...
$ Treatment: Factor w/ 2 levels "nonchilled","chilled": 1 1 1 1 1 1 1 1 1 1 ...
$ conc : num 95 175 250 350 500 675 1000 95 175 250 ...
$ uptake : num 16 30.4 34.8 37.2 35.3 39.2 39.7 13.6 27.3 37.1 ...
> kruskal.test(uptake ~ Type, data = CO2)
Kruskal-Wallis rank sum test
data: uptake by Type
Kruskal-Wallis chi-squared = 29.491, df = 1, p-value = 5.617e-08
P-value is 5.617e-08
It means that carbon dioxide uptake rates have different distribution between Québec and Mississippi.
Post Hoc (by Bonferroni’s method)
Post-hoc (Latin, meaning “after this”) means to analyze the results of your experimental data. They are often based on a familywise error rate; the probability of at least one Type I error in a set (family) of comparisons.
Bonferonni Correction
This multiple-comparison post-hoc correction is used when you are performing many independent or dependent statistical tests at the same time. The problem with running many simultaneous tests is that the probability of a significant result increases with each test run. This post-hoc test sets the significance cut off at α/n. For example, if you are running 20 simultaneous tests at α=0.05, the correction would be 0.0025. More detail. The Bonferroni does suffer from a loss of power. This is due to several reasons, including the fact that Type II error rates are high for each test. In other words, it overcorrects for Type I errors. more information
Subscribe via RSS