OmicsLake v2.0 is a modern, easy-to-use omics data management package with data lineage at its core. It integrates into existing analysis workflows with minimal changes and automatically tracks data dependencies.
This vignette is built with non-evaluated chunks by default for stable package checks. If you want to execute every chunk locally, run:
Then render the vignette from a writable directory.
vignettes/omicslake_layer_use_cases_EN.Rmdvignettes/omicslake_practical_workflow_EN.Rmdvignettes/omicslake_comprehensive_guide_EN.Rmdput(), get(), snap(),
tree()# Store a data frame
counts <- data.frame(
gene_id = paste0("GENE", 1:100),
sample_A = rpois(100, 50),
sample_B = rpois(100, 60)
)
lake$put("counts", counts)
# R objects can also be stored
params <- list(
method = "TMM",
log_transform = TRUE,
threshold = 0.05
)
lake$put("analysis_params", params)
# Read data
data <- lake$get("counts")
my_params <- lake$get("analysis_params")# No SQL needed! Filter with formula syntax
high_expr <- lake$get("counts", where = ~ sample_A > 50)
# Custom operators are also available
mito_genes <- lake$get("counts", where = ~ gene_id %like% "MT-%")
# Compound conditions
filtered <- lake$get("counts",
where = ~ sample_A > 30 & sample_B %between% c(40, 80)
)
# Select columns simultaneously
subset <- lake$get("counts",
where = ~ sample_A > 50,
select = c("gene_id", "sample_A")
)# Get a lazy reference with lake$ref()
# Dependencies in dplyr pipes are automatically tracked!
library(dplyr)
lake$ref("counts") |>
filter(sample_A > 30) |>
mutate(
mean_expr = (sample_A + sample_B) / 2,
log2_ratio = log2(sample_B / sample_A)
) |>
arrange(desc(mean_expr)) |>
save_as("processed_counts", lake)
# Check lineage
lake$tree("processed_counts")
# counts -> processed_counts# Add metadata
metadata <- data.frame(
gene_id = paste0("GENE", 1:100),
gene_name = paste0("Gene_", LETTERS[1:4])[rep(1:4, 25)],
biotype = sample(c("protein_coding", "lncRNA"), 100, replace = TRUE)
)
lake$put("gene_metadata", metadata)
# JOIN with dplyr
lake$ref("counts") |>
left_join(lake$ref("gene_metadata"), by = "gene_id") |>
filter(biotype == "protein_coding") |>
group_by(gene_name) |>
summarize(total_A = sum(sample_A), total_B = sum(sample_B)) |>
save_as("gene_summary", lake)
# Dependencies are automatically tracked
lake$tree("gene_summary")
# counts -----> gene_summary
# gene_metadata ↗Build complex queries without writing SQL.
# Build queries with method chaining
result <- lake$from("counts")$
join("gene_metadata", on = "gene_id")$
where(biotype == "protein_coding")$
where(sample_A > 40)$
select(gene_id, gene_name, sample_A, sample_B)$
order_by(desc(sample_A))$
top(20, by = sample_A)$
run()
# Save results to Lake
lake$from("counts")$
where(sample_A > 50)$
as("high_expression_genes")# Upstream dependencies (what was this data made from?)
lake$deps("gene_summary", direction = "up")
# Downstream dependencies (what uses this data?)
lake$deps("counts", direction = "down")
# Complete lineage tree
lake$tree("gene_summary", direction = "up", depth = 10)
# Impact analysis (what would be affected if this data changes?)
lake$impact("counts")pipeline <- create_pipeline(lake, "preprocessing")
pipeline$
step("load", function() read.csv("data.csv"))$
step("clean", function(data) na.omit(data))$
step("normalize", function(data) {
data$value <- scale(data$value)
data
})$
step("filter", function(data) data[data$quality > 0.8, ])
result <- pipeline$run()
# Each step is recorded in the Lake
lake$tree("preprocessing.filter")# %like% - SQL LIKE pattern matching
genes[genes %like% "MT-%"] # Genes starting with MT-
genes[genes %like% "%kinase%"] # Contains "kinase"
# %ilike% - Case-insensitive
names[names %ilike% "john%"]
# %between% - Range filter
values[values %between% c(10, 100)]
# %regex% - Regular expression matching
ids[ids %regex% "^ENSG\\d{11}$"]
# %!in% - NOT IN
letters[letters %!in% c("a", "e", "i", "o", "u")]
# is_null / is_not_null
data[is_not_null(data$value), ]The v1.0 ol_* functions continue to work, but migration
to the new API is recommended:
| Legacy API | New API |
|---|---|
ol_init("proj") |
Lake$new("proj") |
ol_write("t", df) |
lake$put("t", df) |
ol_read("t") |
lake$get("t") |
ol_label("v1") |
lake$snap("v1") |
ol_tag("t", "v1") |
lake$tag("t", "v1") |
ol_checkout("v1") |
lake$restore("v1") |
ol_show_lineage("t") |
lake$tree("t") |
ol_query("SQL") |
lake$sql("SQL") |
Key features of OmicsLake v2.0:
For concrete layer-wise examples, see
vignettes/omicslake_layer_use_cases_EN.Rmd.
See individual function help for details: