ahmohamed / lipidr

Data Mining and Analysis of Lipidomics datasets in R
https://www.lipidr.org/
Other
27 stars 13 forks source link

Showing only a subset of lipid classes in the full dataset #16

Closed FernandoTobias closed 3 years ago

FernandoTobias commented 3 years ago

Hi,

Is there a way to just show a particular class of lipids in either the enrichment plots or chain distribution heatmaps without removing them in the as_lipidomics_experiment file?

For example, I'd like to only see PC, TAG, Cer on my dataset which contains other lipid classes.

Thanks again, Fernando

ahmohamed commented 3 years ago

You can filter your lipids using rowData. See data subsetting in the vignette (https://www.lipidr.org/articles/workflow.html#data-subsetting). From the vignette

pc_lipids = rowData(d)$Class %in% c("PC", "PCO", "PCP")
d_pc = d[pc_lipids,]
ahmohamed commented 3 years ago

Closing for now. Feel free to reopen if needed.