# \donttest{
library(dplyr)
npx_data <- npx_data1 %>%
mutate(SampleID = paste(SampleID, "_", Index, sep = ""))
try({ # Requires umap package dependency
#UMAP using all the data
olink_umap_plot(df=npx_data, color_g = "QC_Warning")
#UMAP per panel
g <- olink_umap_plot(df=npx_data, color_g = "QC_Warning", byPanel = TRUE)
g$Inflammation #Plot only the Inflammation panel
#Label outliers
olink_umap_plot(df=npx_data, color_g = "QC_Warning",
outlierDefX = 2, outlierDefY = 4) #All data
olink_umap_plot(df=npx_data, color_g = "QC_Warning",
outlierDefX = 3, outlierDefY = 2, byPanel = TRUE) #Per panel
#Retrieve the outliers
g <- olink_umap_plot(df=npx_data, color_g = "QC_Warning",
outlierDefX = 3, outlierDefY = 2, byPanel = TRUE)
outliers <- lapply(g, function(x){x$data}) %>%
bind_rows() %>%
filter(Outlier == 1)
})
# }
Run the code above in your browser using DataLab