# NOT RUN {
# Import the data set.
data( cancerlipidome )
# }
# NOT RUN {
# Convert the data into wide format, where each lipid is one column and
# each sample is one row.
cancerlipidome.wide <-
tidyr::pivot_wider(
data = cancerlipidome,
names_from = Lipid_Name,
values_from = Lipid_Level
)
# Inspect the data frame.
# View( cancerlipidome.wide )
# Create a mapping of the lipid names.
names.mapping <-
map_lipid_names( x = unique( cancerlipidome$"Lipid_Name" ) )
# Compute the regression models.
result.limma <-
compute_models_with_limma(
x = cancerlipidome.wide,
dependent.variables = names.mapping$"Name",
independent.variables = c( "Group" )
)
# }
# NOT RUN {
# Create a figure of all lipids and factors.
figure.output <-
heatmap_lipidome_from_limma(
x = result.limma$"model",
names.mapping = names.mapping,
axis.x.carbons = FALSE,
class.facet = "row",
plot.all = TRUE,
plot.individual = FALSE,
print.figure = TRUE,
scales = "free",
space = "free"
)
# }
# NOT RUN {
# Create individual figures for each factor.
figure.output <-
heatmap_lipidome_from_limma(
x = result.limma$"model",
names.mapping = names.mapping,
axis.x.carbons = FALSE,
class.facet = "wrap",
omit.class = "PA",
plot.all = FALSE,
plot.individual = TRUE,
print.figure = FALSE,
scales = "free",
space = "free"
)
# Print the figure of differences between cancer and benign tumors.
print( figure.output[[ "GroupCancer" ]] )
# }
Run the code above in your browser using DataLab