Getting Started with LorMe
How does LorMe get started?
LorMe provides basic functions for significance test and simple compare visualization.
data("iris")
sigtest_results<- auto_signif_test(data = iris,treatment_col = 5,value_col = 1) #You can check the report in console
## ###Distribution hypothesis####
## Normality Test (Shapiro-Wilk): Passed (P = 0.219 )
##
## Equal Variance Test (Brown-Forsythe): Failed (P = 0.002258528 )
##
##
## ###Data overview####
##
## Treatment_Name N Mean Sd SEM
## 1 setosa 50 5.006 0.3524897 0.04984957
## 2 versicolor 50 5.936 0.5161711 0.07299762
## 3 virginica 50 6.588 0.6358796 0.08992695
## ###Kruskal-Wallis One Way Analysis of Variance on Ranks####
## H = 96.93744 with 2 degrees of freedom. P = 8.918734e-22
##
## The differences in the median values among the treatment groups are greater than would be expected by chance; there is a statistically significant difference (P = 8.918734e-22 )
##
## ###Multiple Comparison Procedures####
##
## All Pairwise Multiple Comparison Procedures (Bonferroni Method) with alpha=0.05
##
## ###Bonferroni adjusted LSD statistics####
##
## MSerror Df Mean CV t.value MSD
## 0.2650082 147 5.843333 8.809859 2.421686 0.2493317
##
##
## ###Comparions on Species ####
##
## diff lwr.ci upr.ci pval
## versicolor-setosa 0.930 0.6806683 1.1793317 2.631058e-15
## virginica-setosa 1.582 1.3326683 1.8313317 6.644464e-32
## virginica-versicolor 0.652 0.4026683 0.9013317 8.296915e-09
##
##
## ###Labels####
##
## compare Letters type Mean std n se LCL
## virginica virginica a Species 6.588 0.6358796 50 0.07280222 6.444126
## versicolor versicolor b Species 5.936 0.5161711 50 0.07280222 5.792126
## setosa setosa c Species 5.006 0.3524897 50 0.07280222 4.862126
## UCL Min Max Q25 Q50 Q75
## virginica 6.731874 4.9 7.9 6.225 6.5 6.9
## versicolor 6.079874 4.9 7.0 5.600 5.9 6.3
## setosa 5.149874 4.3 5.8 4.800 5.0 5.2
## Analysis finished
## ###Distribution hypothesis####
## Normality Test (Shapiro-Wilk): Passed (P = 0.219 )
##
## Equal Variance Test (Brown-Forsythe): Failed (P = 0.002258528 )
##
##
## ###Data overview####
##
## Treatment_Name N Mean Sd SEM
## 1 setosa 50 5.006 0.3524897 0.04984957
## 2 versicolor 50 5.936 0.5161711 0.07299762
## 3 virginica 50 6.588 0.6358796 0.08992695
## ###Kruskal-Wallis One Way Analysis of Variance on Ranks####
## H = 96.93744 with 2 degrees of freedom. P = 8.918734e-22
##
## The differences in the median values among the treatment groups are greater than would be expected by chance; there is a statistically significant difference (P = 8.918734e-22 )
##
## ###Multiple Comparison Procedures####
##
## All Pairwise Multiple Comparison Procedures (Bonferroni Method) with alpha=0.05
##
## ###Bonferroni adjusted LSD statistics####
##
## MSerror Df Mean CV t.value MSD
## 0.2650082 147 5.843333 8.809859 2.421686 0.2493317
##
##
## ###Comparions on Species ####
##
## diff lwr.ci upr.ci pval
## versicolor-setosa 0.930 0.6806683 1.1793317 2.631058e-15
## virginica-setosa 1.582 1.3326683 1.8313317 6.644464e-32
## virginica-versicolor 0.652 0.4026683 0.9013317 8.296915e-09
##
##
## ###Labels####
##
## compare Letters type Mean std n se LCL
## virginica virginica a Species 6.588 0.6358796 50 0.07280222 6.444126
## versicolor versicolor b Species 5.936 0.5161711 50 0.07280222 5.792126
## setosa setosa c Species 5.006 0.3524897 50 0.07280222 4.862126
## UCL Min Max Q25 Q50 Q75
## virginica 6.731874 4.9 7.9 6.225 6.5 6.9
## versicolor 6.079874 4.9 7.0 5.600 5.9 6.3
## setosa 5.149874 4.3 5.8 4.800 5.0 5.2
## Analysis finished
To begin microbial profile analysis, LorMe starts with encapsulation
Data preparation
# Load the example dataset
data(testotu) # Load the standard Qiime output feature table
head(testotu) # First column -ID, last column -taxonomic annotation, others - the feature table.
## OTU.ID X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14 X15 X16 X17 X18
## 1 OTU1 202 146 120 48 30 49 9 14 13 11 9 9 52 47 36 51 55 83
## 2 OTU2 0 2 0 14 7 5 135 190 143 149 73 107 11 34 34 165 176 448
## 3 OTU3 89 100 103 47 45 27 150 188 131 285 358 369 9 12 12 40 34 47
## 4 OTU4 0 0 0 3 2 0 3 1 2 3 2 2 0 1 0 0 0 0
## 5 OTU5 15 47 12 9 2 9 46 73 54 115 92 109 12 7 4 13 15 12
## 6 OTU6 2 3 3 0 0 1 2 3 2 6 5 11 1 0 0 4 2 1
## X19 X20
## 1 535 309
## 2 18 25
## 3 52 57
## 4 1 5
## 5 29 39
## 6 0 2
## taxonomy
## 1 d__Bacteria; p__Gemmatimonadota; c__Gemmatimonadetes; o__Gemmatimonadales; f__Gemmatimonadaceae; g__uncultured; s__uncultured Gemmatimonadetes bacterium
## 2 d__Bacteria; p__Armatimonadota; c__Fimbriimonadia; o__Fimbriimonadales; f__Fimbriimonadaceae; g__norank; s__uncultured bacterium
## 3 d__Bacteria; p__Actinobacteriota; c__Thermoleophilia; o__Gaiellales; f__uncultured; g__norank; s__uncultured bacterium
## 4 d__Bacteria; p__Proteobacteria; c__Alphaproteobacteria; o__Micavibrionales; f__Micavibrionaceae; g__Micavibrio
## 5 d__Bacteria; p__Gemmatimonadota; c__S0134 terrestrial group; o__norank; f__norank; g__norank; s__uncultured bacterium
## 6 d__Bacteria; p__Chloroflexi; c__Chloroflexia; o__Thermomicrobiales; f__AKYG1722; g__norank
feature_table<- testotu[, -c(1,22)]
tax_anno<- testotu[, c(1,22)]
# Create metadata
groupinformation <- data.frame(
group = c(rep("a", 10), rep("b", 10)), # Group column, required for sample grouping
factor1 = rnorm(10), # An optional phenotype or environmental factor
factor2 = rnorm(mean = 100, 10), # Another optional phenotype or environmental factor
subject = factor(c(1:10, 1:10)), # Replication column, required to indicate replicates
group2 = c(rep("e", 5), rep("f", 5), rep("e", 5), rep("f", 5)) # An optional secondary grouping variable
)
head(groupinformation) #metadata
## group factor1 factor2 subject group2
## 1 a 0.2700705 100.17254 1 e
## 2 a -0.2773064 100.95765 2 e
## 3 a -0.5660237 98.63731 3 e
## 4 a -1.8786583 100.06834 4 e
## 5 a -1.2667911 100.10066 5 e
## 6 a -0.9677497 100.90134 6 f
Encapsulation
This step encapsulate meta file, feature table, taxonomic information
# simple mode ###
test_object <- tax_summary(
groupfile = groupinformation, # Metadata file, required
inputtable = feature_table, # Feature table, required
taxonomytable = tax_anno # Taxonomy annotation , required
)
### complete mode ###
test_object <- tax_summary(
groupfile = groupinformation,
inputtable = feature_table,
taxonomytable = tax_anno,
reads = TRUE, # If feature table is in reads, by default
into = "standard", # standard annotation, by default
sep = ";", # Separator, by default
outputtax = c("Phylum", "Genus") # Output level, by default
)
Configuration Preferences
Aesthetics colors , Group displaying order are optional for configuration LorMe provide built-in color schemes, see in color_scheme These configuration are not required, but recommended to be set for consistent style.
## Color scheme generated, see in your plot interface
Configuration
### simple mode ###
test_object_plan1 <- object_config(
taxobj = test_object, #tax summary object, required
treat_location = 1, #which column is Group information, required
rep_location = 4 #which column is replication information, required
)
### complete mode ###
test_object_plan1 <- object_config(
taxobj = test_object,
treat_location = 1,
rep_location = 4,
treat_col = my_col, #color assign, optional
treat_order = my_order #Group order, optional
)
### Facet configuration ###
test_object_plan2 <- object_config(
taxobj = test_object,
treat_location = 1,
rep_location = 4,
facet_location = 5, #which column is second Group information, optional
subject_location = NULL, #which column is paired subject information, optional
treat_col = my_col,
treat_order = my_order,
facet_order = my_facet_order #facet order, optional
)
Finished
To this,we have finished the configuration and can finally enjoy one-code analysis!!!!