Getting Started with LorMe
How does LorMe get started?
1. Preparing the Input Components
LorMe requires three core components to initialize an analysis-ready object.
1) Metadata (Required)
Metadata must include sample IDs and the experimental design
# here just an example
groupinformation <- data.frame(
group = c(rep("a", 10), rep("b", 10)),
factor1 = rnorm(10),
factor2 = rnorm(mean = 100, 10),
subject = factor(c(1:10, 1:10))
)
head(groupinformation)## group factor1 factor2 subject
## 1 a -0.1533463 99.88965 1
## 2 a 1.2855310 100.86515 2
## 3 a 0.5674519 101.01802 3
## 4 a -0.7097412 100.06131 4
## 5 a 0.4745012 99.07435 5
## 6 a -2.2891605 98.36897 6
Note: The ordering of samples in the metadata must match the ordering in the feature table
2 & 3) Feature Table and Taxonomy Table (Required)
These are commonly provided together in QIIME-style outputs.
# Load the example dataset
data(testotu)
# Extract feature table (numeric abundance matrix)
feature_table <- testotu[, -c(1, 22)]
head(feature_table)## X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14 X15 X16 X17 X18 X19 X20
## 1 202 146 120 48 30 49 9 14 13 11 9 9 52 47 36 51 55 83 535 309
## 2 0 2 0 14 7 5 135 190 143 149 73 107 11 34 34 165 176 448 18 25
## 3 89 100 103 47 45 27 150 188 131 285 358 369 9 12 12 40 34 47 52 57
## 4 0 0 0 3 2 0 3 1 2 3 2 2 0 1 0 0 0 0 1 5
## 5 15 47 12 9 2 9 46 73 54 115 92 109 12 7 4 13 15 12 29 39
## 6 2 3 3 0 0 1 2 3 2 6 5 11 1 0 0 4 2 1 0 2
## OTU.ID
## 1 OTU1
## 2 OTU2
## 3 OTU3
## 4 OTU4
## 5 OTU5
## 6 OTU6
## 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
Notes:
1.The feature table should contain only numeric values.
2.Column names in the taxonomy table are flexible.
3.The taxonomy column must contain all hierarchical taxonomic annotations.
Optional Input: Phylogenetic Tree
A phylogeny tree
Alternatively: Import Existing Objects
LorMe can directly import from:
phyloseq
microeco
objects, allowing seamless integration with existing workflows.
2. Data Encapsulation
This step combines metadata, feature table, and taxonomy into a preconfigured LorMe object
Option I: Direct encapsulation
# Simple mode
test_object <- tax_summary(
groupfile = groupinformation,
inputtable = feature_table,
taxonomytable = tax_anno
)
# Complete mode
test_object <- tax_summary(
groupfile = groupinformation,
inputtable = feature_table,
taxonomytable = tax_anno,
reads = TRUE,
into = "standard",
sep = ";",
outputtax = c("Phylum", "Genus")
)Notes:
1.If your metagenomic annotations contain both Kingdom and Domain,
set into = "complete".
2.To output all taxonomic levels, use
outputtax = "standard".
Option II: Converting from phyloseq or microeco object
# Convert from phyloseq
if (requireNamespace("phyloseq", quietly = TRUE)) {
data("GlobalPatterns", package = "phyloseq")
gp_obj <- Trans_from_phylo(GlobalPatterns, outputtax = "standard")
}
# Convert from microeco
if (requireNamespace("microeco", quietly = TRUE)) {
data("dataset", package = "microeco")
dataset_obj <- Trans_from_microeco(dataset, outputtax = "standard")
}Note: The phyloseq or microeco object must include complete taxonomy information.
3.Configuring Analysis Preferences
This step assigns your experimental design (required) and optionally configures:
Color schemes
Group display order
Faceting variables
Basic Configuration
test_object_plan1 <- object_config(
taxobj = test_object,
treat_location = 1 # Automatically assigns aesthetic colors
)## Color scheme generated, see in your plot interface
Advanced Configuration (Optional)
## Color scheme generated, see in your plot interface
my_order <- c("b", "a")
test_object_plan1 <- object_config(
taxobj = test_object,
treat_location = 1,
rep_location = 4,
treat_col = my_col,
treat_order = my_order
)More details in colors color_scheme
Finished!
Your LorMe object is now ready.
You can proceed directly to one-line analysis.