diff --git "a/data/dataset_Lipidomics.csv" "b/data/dataset_Lipidomics.csv"
new file mode 100644--- /dev/null
+++ "b/data/dataset_Lipidomics.csv"
@@ -0,0 +1,5203 @@
+"keyword","repo_name","file_path","file_extension","file_size","line_count","content","language"
+"Lipidomics","martijnmolenaar/LION-web","OntologyApp/server.R",".R","76663","2089","options(stringsAsFactors = FALSE,shiny.sanitize.errors = F)
+
+
+## examples
+
+cluster_example <- read.csv(file = ""data/clusters_lipids.csv"")
+PM <- read.csv(file = ""data/PM-ER_pvalues.csv"")
+MT <- read.csv(file = ""data/Mito-pvalues.csv"")
+ER <- read.csv(file = ""data/ER_KLA-ER_CON_pvalues.csv"")
+
+LIONterms_rules <- read.csv(file = 'data/20191008 LIONterms_rules.csv', header = T)
+LIONterms_rules$RULE1[LIONterms_rules$RULE1 == """"] <- ""-""
+LIONterms_FAs <- read.csv(file = 'data/20191008 LIONterms_FAs.csv', header = T)
+
+#change_log <- readLines('https://raw.githubusercontent.com/martijnmolenaar/lipidontology.com/master/README.md')
+#change_log <- paste(change_log[-c(1:2)], collapse = ""\n"", sep = """")
+
+backgroundlist_example <- paste(cluster_example$lipids, ""\n"", collapse = '', sep = """")
+
+sublist_example1 <- paste(cluster_example$lipids[cluster_example$cluster == 6], ""\n"", collapse = '', sep = """")
+sublist_example2 <- paste(cluster_example$lipids[cluster_example$cluster == 7], ""\n"", collapse = '', sep = """")
+sublist_example3 <- paste(cluster_example$lipids[cluster_example$cluster == 8], ""\n"", collapse = '', sep = """")
+
+pvalueExample1 <- paste( paste(PM$lipids, ""\t"", PM$pvalues, sep = """"), ""\n"", collapse = '', sep = """" )
+pvalueExample2 <- paste( paste(MT$lipids, ""\t"", MT$pvalues, sep = """"), ""\n"", collapse = '', sep = """" )
+pvalueExample3 <- paste( paste(ER$lipids, ""\t"", ER$pvalues, sep = """"), ""\n"", collapse = '', sep = """" )
+
+FA_composition_table <- read.csv(file = 'data/FA_composition_table.csv')
+
+source(file = ""data/20191010 LION_tree_structure.R"")
+
+#### libraries
+
+require(shiny)
+require(visNetwork)
+require(data.table)
+require(igraph)
+require(ggplot2)
+require(ggthemes)
+library(shinyTree)
+library(shinyWidgets)
+library(shinyBS)
+library(httr)
+library(formattable)
+library(jsonlite)
+library(ggrepel)
+library(shinycssloaders)
+
+
+
+
+## loading lipid ontology data
+require(RSQLite)
+require(topOnto)
+require('topOnto.LION.db')
+topOnto::initONT('LION')
+
+
+associationFile <- ""data/20190704 LION_association.txt""
+
+
+## load define functions
+source('data/20191008 LIONweb functions.R')
+
+
+## read associations
+lipidID2TERM <- readMappings(file = associationFile) ## topOnto function, but removes spaces
+
+
+# Define server logic for random distribution application
+function(input, output, session) {
+
+ showNotification(ui = """",
+ action = p(""By using this app you agree with the"", a('Terms of Usage.',
+ href=""https://martijnmolenaar.github.io/lipidontology.com/faq.html#basics"",
+ target=""_blank"")),
+ duration = 14, type = ""default"")
+
+ ### hide tabs at start-up
+ hideTab(inputId = ""tabs"", target = ""LION input"")
+ hideTab(inputId = ""tabs"", target = ""LION enrichment table"")
+ hideTab(inputId = ""tabs"", target = ""LION enrichment graph"")
+ hideTab(inputId = ""tabs"", target = ""LION network view"")
+
+ observe({
+ query <- parseQueryString(session$clientData$url_search)
+
+ if(!is.null(query[['studyid']])){
+ updatePrettyRadioButtons(
+ session,
+ inputId = ""file_input"",
+ selected = ""load external dataset""
+ )
+
+ }
+ })
+
+
+ ## pre-processing with CSVs:
+
+ input_data <- reactive({
+
+
+ ifelse(input$file_input==""file input"",
+ req(input$file1),
+ req(input$MWfile1))
+
+
+
+
+ isolate(if(input$file_input == ""file input""){
+ file_location <- input$file1$datapath
+ metadata <- input$file1$name
+ } else if(input$file_input == ""load external dataset""){
+ file_location <- paste(""https://www.metabolomicsworkbench.org/rest/study/study_id/"",
+ input$MWfile1,
+ ""/lion/"", sep = """")
+
+ metadata <- fromJSON(paste(""https://www.metabolomicsworkbench.org/rest/study/study_id/"",
+ input$MWfile1,
+ ""/summary"", sep = """"))$study_title
+ })
+
+
+ withProgress(message = 'loading data:', value = 0, {
+ if(grepl(""metabolomicsworkbench.org/rest"", file_location)){
+ incProgress(.1, detail = paste(""from Metabolomis Workbench""))
+
+ df <- try(read.csv(file_location,
+ header = FALSE,
+ sep = "","" #, quote = """"
+ ))
+
+ incProgress(.9, detail = paste(""..done""))
+ } else {
+
+ df <- try(read.csv(file_location,
+ header = FALSE,
+ sep = "","" #, quote = """"
+ ))
+ }
+ })
+
+
+ ###
+
+ ## error handling
+
+
+ errors <- NULL
+ if (!(is.data.frame(df))) {
+ df <- data.frame(errors = df[1], column = 0)
+ if(isolate(input$file_input) == ""load external dataset""){
+ errors <- c(errors, ""ERROR: Metabolomics Workbench study ID not found"")
+ } else {
+ errors <- c(errors, ""ERROR: File type not supported"")
+ }
+
+ } else {
+ if (dim(df)[2] == 1) {
+ errors <- c(errors, ""ERROR: No commas found to seperate columns"")
+ }
+ if (dim(df)[2] > 1 & dim(df)[2] < 3) {
+ errors <- c(errors, ""ERROR: Unkown error"")
+ }
+ if (sum(is.na(df[, -1])) > 0) {
+ errors <- c(errors, ""ERROR: There are missing values"")
+ }
+ if (sum( df[-c(1,2),-1] == """" ) > 0) {
+ errors <- c(errors, ""ERROR: Dataset contains empty cells"")
+ }
+ if (sum( df[-c(1,2),-1] == 0 ) > 0) {
+ errors <- c(errors, ""ERROR: Dataset contains zeros"")
+ }
+ if (all(table(as.character(df[1, -1])) < 2)) {
+ errors <- c(errors, ""ERROR: Some or all conditions are n < 2"")
+ }
+ if (any(duplicated(df[2, -1]))) {
+ errors <-
+ c(errors, ""ERROR: One or more samples names are not unique"")
+ }
+ if (sum(apply(df[-1,-c(1:2)],1,function(row){all(row == 0)})) > 0) {
+ errors <-
+ c(errors, ""ERROR: Dataset contains rows with only zeros"")
+ }
+ }
+ errors <- paste(errors, collapse = ""
"")
+
+ ## end error handling
+
+
+ isolate(if(input$file_input == ""load external dataset""){
+ studyID <- paste(input$MWfile1,"": "",sep = """")
+ } else {studyID <- """"})
+
+ #if(!(is.null(errors))){
+ if(errors==""""){
+
+ input_data <- list(df = df,
+ matrix = sapply(df[-c(1,2),-1], as.numeric),
+ conditions = unique(as.character(df[1,-1])),
+ samples = as.character(df[2,-1]),
+ meta = df[1:2,-1],
+ IDs = df[-c(1,2),1],
+ studyID = studyID,
+ metadata = metadata,
+ errors = errors)
+ } else {
+ input_data <-list(df = NULL,
+ matrix = NULL,
+ conditions = NULL,
+ samples = NULL,
+ meta = NULL,
+ IDs = NULL,
+ studyID = NULL,
+ metadata = NULL,
+ errors = errors)
+ }
+
+ return(input_data)
+
+ })
+
+ output$load_datasetUI <- renderUI({
+ file_input <- input$file_input
+
+ if (file_input == ""file input"") {
+
+ fluidRow(column(offset = .3, width = 12,
+
+ br(),
+ strong(""Choose CSV File:""),
+ fluidRow(
+
+ column(offset=0,#style='margin-left:2%;' ,
+ width = 10,
+ popify(placement = ""bottom"", title = ""File-input info"",
+ fileInput(""file1"", label = NULL,
+ multiple = FALSE,
+ accept = c(""text/csv"",
+ ""text/comma-separated-values,text/plain"",
+ "".csv"") ),
+ content = 'Format your dataset as comma seperated value files (.csv), with the first column reserved for metabolites and the other columns for numeric data (containing decimal points). Use double column headers; with row 1 containing condition identifiers and row 2 containing sample identifiers. Submit at least duplicates per condition. Dataset should be normalized before submission. Download a dataset below for an example.'
+
+ )),
+ column(offset=0, width = 1,style = ""margin-top: 5px;"",align=""center"",
+ popify(placement = ""right"", title = ""Lipid nomenclature"", options=list(container=""body""),
+ el = icon(name = ""question"",lib = ""font-awesome"", ""fa-2x""),
+ content = 'Format lipids in LIPIDMAPS notation style: a class-prefix followed by (summed) fatty acid(s) surrounded by parentheses. Examples are: PC(32:1); PE(18:1/16:0); SM(d18:1/18:0); TAG(54:2); etc. Check www.lipidmaps.org for more examples. LION will try to reformat alternative notation styles into LIPIDMAPS format.'))),
+
+ downloadLink(""examplePre1"", ""example set 1 (organelle fractions) [1]""),
+ br(),
+ downloadLink(""examplePre2"", ""example set 2 (CHO-k1 incubated with several FFAs) [2]""),
+ br(),
+ downloadLink(""examplePre3"", ""example set 3 (CHO-k1 incubated with AA) [2]""),
+ br(),
+ br(),
+ em(tags$small(""[1] adapted from Andreyev AY et al, 2010"")), br(),
+ em(tags$small(""[2] from Molenaar MR et al, 2019"")),br(),
+ #em(""[1] Andreyev AY, et al., 2010""),
+ br(),
+ #em(""[2] Molenaar MR, et al., 2019""),
+ br(),br(),
+ uiOutput(""selectLocalStatisticUI"")
+ ))
+
+
+ } else { ### to load Metabolomics Workbench-file
+ fluidRow(column(offset = .3, width = 12,
+
+ br(),
+
+ fluidRow(
+
+ column(offset=0,#style='margin-left:2%;' ,
+ width = 10,
+ popify(placement = ""bottom"", title = ""Metabolomics Workbench"",
+ searchInput(
+ inputId = ""MWfile1"",
+ label = ""Enter Metabolomics Workbench study ID"",
+ placeholder = ""study ID"",
+ btnSearch = icon(""search""),
+ btnReset = icon(""remove""),
+ width = ""100%""
+ ), content = ""In this field, a study ID from the Metabolomics Workbench data repository can be entered—the dataset will be loaded directly to LION/web in the required format. To browse studies, please visit the Metabolomics Workbench website (see below). Please note that LION/web does only process lipids.""
+
+ ))
+ ),
+
+ br(),
+ em(""example: ""),br(),
+ ""ST001140: "",
+ a('Changes in the Canine Plasma Lipidome after Short- and Long-Term Excess Glucocorticoid Exposure',
+ href=""https://www.metabolomicsworkbench.org/data/DRCCMetadata.php?Mode=Study&StudyID=ST001140"", target=""_blank""),
+ br(),br(),
+ em(""For more information, please visit the"", a('Metabolomics Workbench data repository.', href=""https://www.metabolomicsworkbench.org/data/browse.php"", target=""_blank"")),
+ br(),
+ br(),
+ uiOutput(""selectLocalStatisticUI"")
+ ))
+ }
+
+ })
+
+
+ observeEvent(input$file_input, {
+
+ query <- parseQueryString(session$clientData$url_search)
+
+ if(!is.null(query[['studyid']])){
+ updateSearchInput(
+ session,
+ inputId = ""MWfile1"",
+ value = query[['studyid']],
+ trigger = TRUE,
+ label = ""Enter Metabolomics Workbench study ID""
+
+ )
+
+ }
+ })
+
+ output$selectLocalStatisticUI <- renderUI({
+
+ input_data <- input_data()
+ conditions <- input_data$conditions
+
+
+ if (input_data$errors == """") {
+
+ wellPanel(
+ tags$b(input_data$metadata),
+ br(),br(),
+
+ popify(placement = ""bottom"", title = ""Info"",
+ radioButtons(""local_statistics"", label = h5(""Select local statistics to rank input identifiers""),
+ choices = list(""one-tailed T-test (2 conditions)"" = 1, ""2-LOG[fold change] (2 conditions)"" = 2, ""one-way ANOVA F-test (>2 conditions)"" = 3),
+ selected = 1), content = 'Select a local statistic to rank the metabolites based on the provided dataset. LION-terms associated with lipids higher ranked than expected by chance will be reported as enriched.'),
+ popify(
+ placement = ""bottom"",
+ title = ""Info"",
+ checkboxInput(
+ inputId = ""normalization"",
+ label = ""normalize signals as percentage"",
+ value = FALSE
+ ),
+ content = 'If checked, lipid signals are expressed as percentage of the total signal per sample. This is useful when input data is not normalized.'
+ ),
+ br(),
+ uiOutput(""conditionsUI"")
+ )
+ } else { ### if there are errors...
+ HTML(paste('',
+ input_data$errors,
+ """",sep=""""))
+ }
+
+ })
+
+ output$KS2_UI<- renderUI({
+
+ if(input$ks_sided == ""ks2""){
+
+ fluidRow(
+ column(width = 1),
+ column(width = 11,
+ selectizeInput(""split_direction_in_output"",
+ label = NULL,
+ choices = c(""Separate up- and downregulated terms in barchart"" = ""split"",
+ ""Combine up- and downregulated terms in barchart"" = ""combine"",
+ ""Display data in volcano plot"" = ""volcano""),
+ selected = ""split""))
+ )
+
+ }
+
+
+
+ })
+
+ output$conditionsUI <- renderUI({
+ input_data <- input_data()
+ conditions <- input_data$conditions
+
+ if (input$local_statistics == 1){ ## t-test pvalues
+
+
+ wellPanel(
+
+ h5(tags$i(""a T-test p-value will be calculated for every input identifier"")),
+
+ fluidRow(
+ column(
+ width = 6,
+ selectInput(
+ ""conditionA"",
+ h5(""condition of interest""),
+ conditions,
+ selected = conditions[1]
+ )
+ ),
+ column(
+ width = 6,
+ selectInput(
+ ""conditionB"",
+ h5(""control condition""),
+ conditions,
+ selected = conditions[2]
+ )
+ )
+ ),
+ actionButton(
+ inputId = ""calculatePreprocessing"",
+ label = "" Calculate local statistics"",
+ width = NULL,
+ icon = icon(""line-chart"", lib = ""font-awesome"")
+ ),
+ br(),
+ br(),
+ plotOutput(""p_value_plot""),
+ br(),
+ uiOutput(""conditionsUI_pB"")
+ )
+ } else if(input$local_statistics == 2) { ### 2log fold change
+
+ wellPanel(
+
+ h5(tags$i(""a 2-LOG[fold change] value will be calculated for every input identifier"")),
+
+ fluidRow(
+ column(
+ width = 6,
+ selectInput(
+ ""conditionA"",
+ h4(""condition of interest""),
+ conditions,
+ selected = conditions[1]
+ )
+ ),
+ column(
+ width = 6,
+ selectInput(
+ ""conditionB"",
+ h4(""control condition""),
+ conditions,
+ selected = conditions[2]
+ )
+ )
+ ),
+ actionButton(
+ inputId = ""calculatePreprocessing"",
+ label = "" Calculate local statistics"",
+ width = NULL,
+ icon = icon(""line-chart"", lib = ""font-awesome"")
+ ),
+ br(),
+ br(),
+ plotOutput(""p_value_plot""),
+ br(),
+ uiOutput(""conditionsUI_pB"")
+ )
+
+ } else { ### F-test
+
+ wellPanel(
+
+ h5(tags$i(""an F-test p-value will be calculated for every input identifier"")),
+
+ selectizeInput(inputId = ""selectedConditions"", h4(""conditions of interest""),
+ choices = input_data()$conditions, selected = input_data()$conditions,
+ multiple = TRUE,options = list(plugins= list('remove_button'))
+ ),
+
+ actionButton(
+ inputId = ""calculatePreprocessing"",
+ label = "" Calculate local statistics"",
+ width = NULL,
+ icon = icon(""line-chart"", lib = ""font-awesome"")
+ ),
+ br(),
+ br(),
+ htmlOutput(""FtestError""),
+ br(),
+ plotOutput(""p_value_plot""),
+ br(),
+ uiOutput(""conditionsUI_pB"")
+ )
+
+ }
+ })
+
+ output$FtestError <- renderText({
+ message <- ifelse(length(input$selectedConditions)<2, ""ERROR: Number of conditions should be 2 or higher"","""")
+ HTML(paste('',
+ message,
+ """",sep=""""))
+ })
+
+
+ output$conditionsUI_pB <- renderUI({
+ data <- pre_processed_data()[[1]] ### show when 'pre_processed_data()' is constructed
+
+
+ if(!(any(is.na(data$pValues)))){
+ fluidRow(
+
+ actionButton(inputId = ""submitPreprocessing"",
+ label = "" Use values as local statistics"",
+ width = NULL,
+ icon = icon(""share-square"", lib = ""font-awesome"")),
+ downloadButton(""download_pValues"", """")
+ )
+ }
+
+
+ })
+
+ pre_processed_data <- eventReactive(input$calculatePreprocessing, {
+
+ input_data <- input_data()
+
+ if(isolate(input$normalization)){ ## normalization option switched on
+ input_data$matrix[] <-
+ apply(input_data$matrix,2,function(i){
+ i / sum(i) * 100
+ })
+ }
+
+
+ if(any(input$local_statistics %in% c(1,2))){
+ setA <- input_data$matrix[,which(input_data$meta[1,] == input$conditionA)]
+ setB <- input_data$matrix[,which(input_data$meta[1,] == input$conditionB)]
+ }
+
+ if(input$local_statistics == 1){ ### when t-test p-values are selected
+
+ pValues <- apply(cbind(setA,setB), 1, function(row){
+ t.test(x=row[1:dim(setA)[2]],
+ y=row[(dim(setA)[2]+1):(dim(setA)[2]+dim(setB)[2])],
+ alternative = ""greater"")$p.value
+
+ })
+ outputList <- list(data.frame(IDs = input_data()$IDs,
+ pValues = pValues))
+
+ }
+
+ if(input$local_statistics == 2){ ### when 2-log FC values are selected
+
+ FC_values <- apply(cbind(setA,setB), 1, function(row){
+ x <- mean(row[1:dim(setA)[2]], na.rm = TRUE)
+ y <- mean(row[(dim(setA)[2]+1):(dim(setA)[2]+dim(setB)[2])], na.rm = TRUE)
+ log(x = x/y, base = 2)
+
+ })
+ outputList <- list(data.frame(IDs = input_data()$IDs,
+ pValues = FC_values))
+
+ }
+
+ if(input$local_statistics == 3){ ### when ANOVA is selected
+
+ #input_data <- input_data()
+
+ if (length(input$selectedConditions) > 1) { ## minimum of 2 conditions needed
+ pValues <-
+ sapply(1:length(input_data$IDs), function(lipid_nr){
+ df <- do.call(""rbind"",sapply(input_data$conditions, function(condition){
+ data.frame(l = NA,
+ condition = condition,
+ signal = input_data$matrix[lipid_nr, unlist(input_data$meta[1,]) == condition]
+ )}, simplify = FALSE))
+
+ model.df <- lm(signal ~ condition, data = df)
+ anova(model.df)['condition','Pr(>F)']
+ })
+
+ } else {pValues = NA}
+
+
+ outputList <- list(data.frame(IDs = input_data()$IDs,
+ pValues = pValues))
+
+ }
+
+ names(outputList) <- paste(""set"",isolate(input$submit),sep="""")
+ outputList
+
+ })
+
+ output$p_value_plot <- renderPlot({
+
+ df <- pre_processed_data()[[1]]
+ df <- df[,2][order(df[,2])]
+
+ ylab <- subset(data.frame(selection = 1:3, ylab = c('t-test p-value','2-LOG[fold change]','F-test p-value (log scale)')),
+ selection == isolate(input$local_statistics))$ylab
+
+ if(ylab == 'F-test p-value (log scale)'){
+ if (length(input$selectedConditions) > 1) {
+
+ ggplot(data.frame(x = 1:length(df), y=df), aes(x = x, y = y))+
+ labs(x = ""metabolites"", y = ylab, title = ""Distribution local statistics"")+
+ geom_point()+
+ scale_y_log10()+
+ geom_blank()
+
+ # qplot is deprecated!!
+ # qplot(y=df, main = ""Distribution local statistics"",
+ # xlab = ""metabolites"",
+ # ylab = yla
+ # log = ""y"")
+
+ } else {
+ ggplot(data.frame(x = 1:length(df), y=NA), aes(x = x, y = y))+
+ labs(x = ""metabolites"", y = ylab, title = ""Distribution local statistics"")+
+ geom_blank()
+ }
+
+ } else {
+
+ ggplot(data.frame(x = 1:length(df), y=df), aes(x = x, y = y))+
+ labs(x = ""metabolites"", y = ylab, title = ""Distribution local statistics"")+
+ geom_point()+
+ geom_blank()
+
+ # qplot is deprecated!!
+ # qplot(y=df, main = ""Distribution local statistics"",
+ # xlab = ""metabolites"",
+ # ylab = ylab
+ # )
+
+
+ }
+
+
+
+ })
+
+ ## end of pre-processing
+
+
+ ## examples by p-value
+
+ observeEvent(input$submitPreprocessing, {
+ pre_processed_data <- pre_processed_data()[[1]]
+ pre_processed_data <- paste( paste(pre_processed_data$IDs, ""\t"", pre_processed_data$pValues, sep = """"), ""\n"", collapse = '', sep = """" )
+
+ updateTextAreaInput(session, ""listwPvalues"", value = pre_processed_data)
+ ### update dependent on statistics choice
+ if(isolate(input$local_statistics) == 2){ ### 2 == log fold change
+ updateRadioButtons(session, ""ranking"", selected = ""descending"" )
+ } else { ## in case of p-values
+ updateRadioButtons(session, ""ranking"", selected = ""ascending"" )
+ }
+
+ ###
+ updateTabsetPanel(session, ""sub_method"",
+ selected = ""(ii) analysis"")
+ })
+
+ output$examplePre1 <- downloadHandler(
+ filename <- function() {
+ paste(""lipidomics set - adapted from Andreyev AY et al 2010"",""csv"",sep=""."")
+ },
+
+ content <- function(file) {
+ file.copy(""data/lipidomics set - adapted from Andreyev AY et al 2010.csv"", file)
+ },
+ contentType = ""text/csv""
+ )
+ output$examplePre2 <- downloadHandler(
+ filename <- function() {
+ paste(""lipidomics set FA incorporation"",""csv"",sep=""."")
+ },
+
+ content <- function(file) {
+ file.copy(""data/lipidomics set FA incorporation.csv"", file)
+ },
+ contentType = ""text/csv""
+ )
+ output$examplePre3 <- downloadHandler(
+ filename <- function() {
+ paste(""lipidomics set membrane fluidity after AA incubation"",""csv"",sep=""."")
+ },
+
+ content <- function(file) {
+ file.copy(""data/lipidomics set membrane fluidity after AA incubation.csv"", file)
+ },
+ contentType = ""text/csv""
+ )
+
+
+ observe({
+ input$download_network_bs
+ visNetworkProxy(""ontology.plot"") %>% visGetPositions()
+ })
+
+ observeEvent(input$exampleB1, {
+ updateTextAreaInput(session, ""listwPvalues"", value = pvalueExample1)
+ })
+ observeEvent(input$exampleB2, {
+ updateTextAreaInput(session, ""listwPvalues"", value = pvalueExample2)
+ })
+ observeEvent(input$exampleB3, {
+ updateTextAreaInput(session, ""listwPvalues"", value = pvalueExample3)
+ })
+ observeEvent(input$plot_click, { ### display term info in console
+ termInfo <- dataBlock()$to_ggplot_display$data
+
+
+ })
+
+ ## examples by sublist
+ observeEvent(input$exampleA1, {
+ updateTextAreaInput(session, ""sublist"", value = sublist_example1)
+ updateTextAreaInput(session, ""background"", value = backgroundlist_example)
+ })
+ observeEvent(input$exampleA2, {
+ updateTextAreaInput(session, ""sublist"", value = sublist_example2)
+ updateTextAreaInput(session, ""background"", value = backgroundlist_example)
+ })
+ observeEvent(input$exampleA3, {
+ updateTextAreaInput(session, ""sublist"", value = sublist_example3)
+ updateTextAreaInput(session, ""background"", value = backgroundlist_example)
+ })
+
+ observeEvent(input$submitB, {
+ ## first unhide tabs
+
+ input_listwPvalues <- input$listwPvalues
+
+ if(grepl(""\t"", input_listwPvalues) &
+ grepl(""\n"", input_listwPvalues) &
+ grepl(""\\D"",input_listwPvalues) &
+ grepl(""\\d"",input_listwPvalues) ){ ## input requirements
+
+ #if(input$listwPvalues!=""""){
+ showTab(inputId = ""tabs"", target = ""LION input"")
+ showTab(inputId = ""tabs"", target = ""LION enrichment table"")
+ showTab(inputId = ""tabs"", target = ""LION enrichment graph"")
+ showTab(inputId = ""tabs"", target = ""LION network view"")
+
+ dataBlock()
+
+ ## goto LION input
+ updateTabsetPanel(session, ""tabs"",
+ selected = ""LION input"")
+ } else {
+
+ hideTab(inputId = ""tabs"", target = ""LION input"")
+ hideTab(inputId = ""tabs"", target = ""LION enrichment table"")
+ hideTab(inputId = ""tabs"", target = ""LION enrichment graph"")
+ hideTab(inputId = ""tabs"", target = ""LION network view"")
+
+ updateTabsetPanel(session, ""tabs"",
+ selected = ""General information"")
+ showNotification(ui = """",
+ action = ""No or incorrect input found. Please reformat and submit data in the text box."",
+ duration = 3, type = 'error')
+ }
+ })
+ observeEvent(input$submitA, {
+
+ input_list <- c(input$sublist, input$background)
+
+ if(all(grepl(""\n"", input_list) & grepl(""\\D"",input_list))){ ## input requirements
+
+ #if(input$sublist!="""" & input$background!=""""){
+ ## first unhide tabs
+ showTab(inputId = ""tabs"", target = ""LION input"")
+ showTab(inputId = ""tabs"", target = ""LION enrichment table"")
+ showTab(inputId = ""tabs"", target = ""LION enrichment graph"")
+ showTab(inputId = ""tabs"", target = ""LION network view"")
+
+ dataBlock()
+
+ ## goto LION input
+ updateTabsetPanel(session, ""tabs"",
+ selected = ""LION input"")
+ } else {
+
+ hideTab(inputId = ""tabs"", target = ""LION input"")
+ hideTab(inputId = ""tabs"", target = ""LION enrichment table"")
+ hideTab(inputId = ""tabs"", target = ""LION enrichment graph"")
+ hideTab(inputId = ""tabs"", target = ""LION network view"")
+
+ updateTabsetPanel(session, ""tabs"",
+ selected = ""General information"")
+ showNotification(ui = """",
+ action = ""No or incorrect input found. Please reformat and submit data in the two text boxes."",
+ duration = 3, type = 'error')
+ }
+ })
+
+
+
+ ### enrichment analysis
+ dataBlock <- reactive({
+
+ errorhandling <- NULL
+
+ input$submitB
+ input$submitA
+
+ input_listwPvalues <- isolate(input$listwPvalues)
+
+ ### some lipids contain comma's, so only the last comma should be regarded as a separator
+ numericPattern <- unlist(regmatches(input_listwPvalues, gregexpr("", *(\\d|\\.)+(\n|$)"", input_listwPvalues)) ) ## extract patterns to replace last comma
+
+ for(p in numericPattern){ ### replace last comma of line to \t; this will be the seperator
+ input_listwPvalues <- gsub(p, gsub("","", ""\t"", p), input_listwPvalues)
+ }
+
+
+
+ #### is input appropriate??
+
+ if (isolate(input$sub_method) == ""(ii) analysis"" & input$method == ""Ranking mode"") {
+ if(!(grepl(""\t"", input_listwPvalues) &
+ grepl(""\n"", input_listwPvalues) &
+ grepl(""\\D"",input_listwPvalues) &
+ grepl(""\\d"",input_listwPvalues) )){ ### definition of wrong input
+
+ hideTab(inputId = ""tabs"", target = ""LION enrichment table"")
+ hideTab(inputId = ""tabs"", target = ""LION enrichment graph"")
+ hideTab(inputId = ""tabs"", target = ""LION network view"")
+
+ return(NULL)
+ }
+ }
+
+ if (isolate(input$method) == ""Target-list mode"") {
+ if( isolate(input$sublist)=="""" | isolate(input$background) == """"){ ### definition of wrong input
+ hideTab(inputId = ""tabs"", target = ""LION enrichment table"")
+ hideTab(inputId = ""tabs"", target = ""LION enrichment graph"")
+ hideTab(inputId = ""tabs"", target = ""LION network view"")
+
+ return(NULL)
+ }
+ }
+ ####
+
+
+
+ if(isolate(input$ranking)==""ascending""){direction <- 1} else {direction <- -1}
+
+ ### table 1
+
+ withProgress(message = 'progress:', value = 0, {
+ incProgress(.1, detail = paste(""mapping input data""))
+ if (isolate(input$method) == ""Target-list mode"") {
+ if ((is.null(isolate(input$sublist)) ||
+ isolate(input$sublist) == """") == FALSE) {
+
+ ### new 20191010
+ cat(""substracting input target-list \n"")
+
+ sublist <- strsplit(isolate(input$sublist), ""\n""); names(sublist) <- ""ID""
+ background <- strsplit(isolate(input$background), ""\n""); names(background) <- ""ID""
+
+ background = data.frame(ID = c(background$ID, sublist$ID[!sublist$ID %in% background$ID]))
+ background$IDnr <- 1:length(background$ID)
+ background$input <- paste(sprintf(""[#%04d]"", background$IDnr),background$ID)
+
+ sublist$input <-
+ do.call(""rbind"",
+ sapply(unique(sublist$ID), function(ID_i){
+ background[background$ID == ID_i,]
+ }, simplify = FALSE))$input
+
+ background$input <-
+ do.call(""rbind"",
+ sapply(unique(background$ID), function(ID_i){
+ background[background$ID == ID_i,]
+ }, simplify = FALSE))$input
+
+
+ lipidExistance <- data.frame(input = background$input )
+ cat(""converting input target-list \n"")
+ lipidExistance$'simplified input' <- convertLipidNames(gsub(""^\\[#\\d+\\] "","""",lipidExistance$input))
+ ### end new 20191010
+
+
+ } else {
+ lipidExistance <- data.frame(""input"")
+ }
+
+ }
+
+ if (isolate(input$method) == ""Ranking mode"") { ## (isolate(input$sub_method) == ""(ii) analysis"") {
+ if ((is.null(input_listwPvalues) ||
+ input_listwPvalues == """") == FALSE) {
+
+
+ pValueList <- list()
+
+ pValueList$input <-
+ transpose(strsplit(unlist(strsplit(
+ input_listwPvalues, ""\n""
+ )), ""[\t\\|]""))[[1]]
+
+ pValueList$input <- paste(sprintf(""[#%04d]"", 1:length(pValueList$input)),pValueList$input)
+
+ pValueList$pvalues <-
+ transpose(strsplit(unlist(strsplit(
+ input_listwPvalues, ""\n""
+ )), ""[\t\\|]""))[[2]]
+
+ if(any(is.null(pValueList$input),is.null(pValueList$pvalues))){
+ errorhandling <- ""unexpected input""
+ pValueList$input <- NULL
+ pValueList$pvalues <- NULL
+ }
+
+ pValueList <- as.data.frame(pValueList)
+ lipidExistance <- data.frame(input = pValueList$input)
+
+ lipidExistance$'simplified input' <- convertLipidNames(gsub(""^\\[#\\d+\\] "","""",lipidExistance$input))
+
+
+ } else {
+ lipidExistance <- data.frame(""input"")
+ }
+ }
+ if (length(lipidExistance$input) < 1) {
+
+ } else {
+
+ ##### new 20191106
+ lipidExistance_list <-
+ lapply(1:dim(lipidExistance)[1], function(row_i) {
+
+ lipid_i <- lipidExistance[row_i, 2] ## lipid_i is lipid of this iteration
+
+ LION_ID <-
+ unlist(lipidID2TERM[lipid_i == names(lipidID2TERM)])
+
+ if (is.null(LION_ID)) {
+ ### if input is LION:xxxx
+ LION_ID <-
+ unlist(lipidID2TERM[lipid_i == unlist(lipidID2TERM)])
+ LION_ID <-
+ LION_ID[!grepl(""^SLM:|^LM..\\d+"", names(LION_ID))] ## remove SwissLipids/LIPIDMAPS IDs
+ }
+
+ if (!is.null(LION_ID)) {
+ output_df <-
+ data.frame(
+ input = lipidExistance[row_i, 1],
+ 'simplified input' = lipid_i,
+ name = names(LION_ID),
+ LION = LION_ID,
+ match = ""direct""
+ )
+ } else {
+ ### no direct matching is found
+ if (isolate(input$SmartMatching)) {
+ ### 'smartmatching' is on
+ lipid_index <-
+ list(
+ generalized = simplifyLipidnames(lipid_i),
+ headgroup = getLipidHeadgroup(lipid_i),
+ linkage = getLipidLinkage(lipid_i),
+ FAs = getFAs(lipid_i)
+ )
+
+ generalized_LION_ID <-
+ unlist(lipidID2TERM[lipid_index$generalized == names(lipidID2TERM)])
+ if (!is.null(generalized_LION_ID)) {
+ terms <-
+ data.frame(name = names(lipidID2TERM)[lipid_index$generalized == names(lipidID2TERM)],
+ LION = generalized_LION_ID)
+ } else {
+ ## no generalized lipid found
+ LIONterms_rules_i <-
+ LIONterms_rules[lipid_index$headgroup == LIONterms_rules$RULE1 ,]
+
+ if (all(LIONterms_rules_i$RULE2 == """")) {
+ terms <- LIONterms_rules_i[, 1:2]
+ } else {
+ terms <-
+ LIONterms_rules_i[lipid_index$linkage == LIONterms_rules_i$RULE2,][, 1:2]
+ }
+ }
+
+
+ terms <-
+ rbind(terms, LIONterms_FAs[LIONterms_FAs$name %in% lipid_index$FAs,])
+ if (dim(terms)[1] > 0) {
+ output_df <-
+ data.frame(input = lipidExistance[row_i, 1],
+ 'simplified input' = lipid_i,
+ terms,
+ match = ""smart matching"")
+
+ } else {
+ ## no match by smart matching
+ output_df <-
+ data.frame(
+ input = lipidExistance[row_i, 1],
+ 'simplified input' = lipid_i,
+ name = ""not found"",
+ LION = ""not found"",
+ match = """"
+ )
+ }
+
+
+ } else {
+ ### 'smartmatching' is off, and no match found
+ output_df <-
+ data.frame(
+ input = lipidExistance[row_i, 1],
+ 'simplified input' = lipid_i,
+ name = ""not found"",
+ LION = ""not found"",
+ match = """"
+ )
+ }
+
+
+ }
+ if(isolate(input$FAprediction)){ ## predict FAs if nescerrary
+
+ lipid_index <-
+ list(
+ generalized = simplifyLipidnames(lipid_i),
+ headgroup = getLipidHeadgroup(lipid_i),
+ FAs = getFAs(lipid_i)
+ )
+
+ if(lipid_index$generalized == lipid_i & length(lipid_index$FAs) == 1){ ## is FA prediction applicable?
+
+ predicted_FAs <- predict_FAs(headgroup = lipid_index$headgroup,
+ summedFA = gsub(""C"","""",lipid_index$FAs),
+ composition_table = FA_composition_table )
+
+ if(dim(LIONterms_FAs[LIONterms_FAs$name %in% predicted_FAs,])[1]>0){ ## any result?
+ output_df <-
+ rbind(output_df,
+ data.frame(input = lipidExistance[row_i, 1],
+ 'simplified input' = lipid_i,
+ LIONterms_FAs[LIONterms_FAs$name %in% predicted_FAs,],
+ match = ""FA-prediction""))
+ }
+
+
+ }
+
+
+ }
+
+ return(output_df)
+ })
+
+ matching_statistics <- data.frame(total = length(sapply(lipidExistance_list, function(lipid_i){!any(lipid_i$LION == ""not found"")})),
+ matched = sum(sapply(lipidExistance_list, function(lipid_i){!any(lipid_i$LION == ""not found"")})),
+ percent = mean(sapply(lipidExistance_list, function(lipid_i){!any(lipid_i$LION == ""not found"")}) ) * 100)
+
+
+ lipidExistance <- do.call(""rbind"",lipidExistance_list)
+
+ colnames(lipidExistance) <- c('input','simplified input','LION name','LION ID', ""match"")
+
+
+ color_df <- data.frame(match = c(""direct"",""smart matching"", ""FA-prediction"",""""),
+ color = c(""#4f4d4d"",""#9c3c2d"",""#c4942b"",""#bdbbbf""))
+
+ lipidExistance_toview <-
+ do.call(""rbind"", lapply(lipidExistance_list, function(lipidExistance_i) {
+ color_pattern <- color_df$color[match(lipidExistance_i$match, color_df$match)]
+
+ data.frame(
+ input = unique(lipidExistance_i$input),
+ name = paste("""",lipidExistance_i$name,"""" , sep ="""", collapse = ""
""),
+ #LION = paste("""",lipidExistance_i$LION,"""" , sep ="""", collapse = ""
"")
+ LION = paste("""",
+ lipidExistance_i$LION,
+ """",
+ sep = """", collapse = ""
"")
+
+
+ )
+ }))
+
+
+ colnames(lipidExistance_toview) <- c('input','LION name','LION ID')
+
+ lipidExistance_toview[[3]] <- gsub("" href=.+Fnot found'"","""",lipidExistance_toview[[3]])
+
+ ##### end new 20191006
+
+ lipidExistance$'simplified input' <- NULL ## remove this column, not interesting for user
+
+
+ ## use matched lipids as assocation table
+
+ lipidExistance_feasable <- lipidExistance[lipidExistance$`LION ID` != ""not found"",]
+
+ matched_lipidID2TERM <-
+ sapply(unique(lipidExistance_feasable$input), function(input){
+ lipidExistance_feasable$`LION ID`[lipidExistance_feasable$input == input]
+ }, simplify = FALSE)
+
+
+ }
+
+ })
+
+
+ if (!any(dim(lipidExistance) == c(1, 1))) {
+ ### perform when there is input (dim 1 by 1 >> no input)
+
+ withProgress(message = 'progress:', value = 0, {
+ # Generate an HTML table view of the ontology data
+
+ incProgress(.5, detail = paste(""submitting data""))
+
+ if (isolate(input$method) == ""Target-list mode"") {
+ if ((is.null(isolate(input$sublist)) ||
+ isolate(input$sublist) == """") == FALSE) {
+
+
+ lipidIDs <-
+ list(sublist = sublist$input, #unlist(strsplit(isolate(input$sublist), ""\n"")),
+ backgroundlist = background$input #unlist(strsplit(isolate(input$background), ""\n""))
+ )
+
+
+ lipidIDlogical <-
+ factor(as.integer(lipidIDs$backgroundlist %in% lipidIDs$sublist), levels = c(0,1))
+ names(lipidIDlogical) <- lipidIDs$backgroundlist
+
+ if( any(names(lipidIDlogical) %in% names(matched_lipidID2TERM)) &
+ sum(lipidIDlogical==""1"") > 1 ){ ### can at least one lipid be matched?
+ ONTdata <- new(
+ ""topONTdata"",
+ ontology = ""LION"",
+ allGenes = lipidIDlogical,
+ annot = annFUN.gene2GO,
+ gene2GO = matched_lipidID2TERM)
+ } else {
+
+ names(lipidIDlogical)[1] <- ""PC(38:1)"" ### make a fake object
+ levels(lipidIDlogical) <- c(levels(lipidIDlogical),""1"")
+ lipidIDlogical[1] <- ""1""
+
+ ONTdata <- new(
+ ""topONTdata"",
+ ontology = ""LION"",
+ allGenes = lipidIDlogical,
+ annot = annFUN.gene2GO,
+ gene2GO = lipidID2TERM)
+ }
+
+
+ resultFis <-
+ runTest(ONTdata,
+ algorithm = ""classic"",
+ statistic = ""fisher"")
+
+
+
+ to_display <-
+ GenTable(ONTdata,
+ 'p-value' = resultFis,
+ topNodes = 2000)
+
+ to_display <-
+ to_display[grep(""LION"", to_display$TERM.ID), ]
+
+ LUT <- data.frame(ID = names(ONTdata@termName),
+ Discription = ONTdata@termName)
+
+ to_display$Term <- LUT$Discription[match(to_display$TERM.ID, LUT$ID)]
+ to_display <- to_display[to_display$Annotated > 2, ] ### remove terms with 1 or 2 lipids
+
+ #### limiting by LION-term selection
+ if(isolate(input$LIONselection)){ ### switch for LION-selection
+ TermsOfInterest <- get_selected(isolate(input$tree), format = ""names"")
+ TermsOfInterest <- unique(c(unlist(TermsOfInterest),
+ unlist(sapply(TermsOfInterest, function(element){attr(element,""ancestry"")}))
+ )) ## vector with LION-names
+ to_display <- to_display[to_display$Term %in% TermsOfInterest,]
+ }
+
+ ## limiting redundant/similar parent terms
+
+ if(isolate(input$RemoveRedundantTerms)){ ### switch for LION-selection
+ ONT_DAG <- ONTdata@graph
+ ONT_DAG_lev <- buildLevels(ONT_DAG)
+ DAG.env <- ONT_DAG_lev$nodes2level
+
+ DAGlevel <- sapply(to_display$TERM.ID, function(id) {
+ DAG.env[[id]]
+ })
+
+ lipidsInTerms <- genesInTerm(ONTdata)
+
+ TermContent <-
+ sapply(to_display$TERM.ID, function(id) {
+ lipidsInTerms[[id]]
+ })
+
+ test_similarity <-
+ sapply(names(TermContent), function(term_i) {
+ sapply(names(TermContent), function(term_j) {
+ if (term_i != term_j) {
+ if (length(TermContent[[term_i]]) == length(TermContent[[term_j]])) {
+ same <- all(TermContent[[term_i]] %in% TermContent[[term_j]])
+ } else {
+ same <- FALSE
+ }
+
+
+ outputList <- list(
+ term_a = term_i,
+ term_b = term_j,
+ isSame = same,
+ term_a_level = DAGlevel[names(DAGlevel) == term_i],
+ term_b_level = DAGlevel[names(DAGlevel) == term_j]
+ )
+
+
+ outputList$remove <- """"
+
+ if ((outputList$term_a_level - outputList$term_b_level)==1) {
+ outputList$remove <- outputList$term_b
+ }
+ if ((outputList$term_a_level - outputList$term_b_level)==-1) {
+ outputList$remove <- outputList$term_a
+ }
+
+ outputList
+
+ } else {
+ list(
+ term_a = term_i,
+ term_b = term_j,
+ remove = """",
+ isSame = FALSE
+ )
+ }
+ }, simplify = FALSE)
+ })
+
+ test_similarity <-
+ test_similarity[unlist(lapply(test_similarity, function(n) {
+ n[['isSame']]
+ }))]
+
+ test_similarity <-
+ unique(unlist(lapply(test_similarity, function(n) {
+ n[['remove']]
+ })))
+
+ to_display <- to_display[!(to_display$TERM.ID %in% test_similarity),]
+
+ }
+
+
+ ###
+
+ to_display$`p-value` <- gsub(""< "","""",to_display$`p-value`) ### '< 1e-30' cannot be understood
+
+ to_display$'FDR q-value' <-
+ format(p.adjust(as.numeric(to_display$`p-value`), ""fdr""), digits = 3)
+
+ colnames(to_display) <-
+ c(
+ ""Term ID"",
+ ""Discription"",
+ ""Annotated"",
+ ""Significant"",
+ ""Expected"",
+ ""p-value"",
+ ""FDR q-value""
+ )
+
+
+
+ } else {
+ to_display <- data.frame()
+ }
+ } ## end if ""By target list""
+
+ if (isolate(input$sub_method == ""(ii) analysis"" & input$method == ""Ranking mode"")) {
+ if ((is.null(input_listwPvalues) ||
+ input_listwPvalues == """") == FALSE) {
+
+
+ pValueList$pvalues <- as.numeric(pValueList$pvalues)
+
+ lipidIDrank <- rank(pValueList$pvalues * direction) ## direction by radiobutton input$ranking
+ names(lipidIDrank) <- pValueList$input
+
+ mySel <- function(allScore) {
+ return(rep(TRUE, length(lipidIDrank)))
+ }
+
+
+ if(any(names(lipidIDrank) %in% names(matched_lipidID2TERM))){ ### can at least one lipid be matched?
+ ONTdata <- new(
+ ""topONTdata"",
+ ontology = ""LION"",
+ allGenes = lipidIDrank,
+ annot = annFUN.gene2GO,
+ gene2GO = matched_lipidID2TERM,
+ geneSelectionFun = mySel
+ )
+ } else { ### make a fake object
+ names(lipidIDrank)[1] <- 'PC(32:0)'
+ ONTdata <- new(
+ ""topONTdata"",
+ ontology = ""LION"",
+ allGenes = lipidIDrank,
+ annot = annFUN.gene2GO,
+ gene2GO = lipidID2TERM,
+ geneSelectionFun = mySel
+ )
+ }
+
+ resultFis <-
+ runTest(ONTdata,
+ algorithm = ""classic"",
+ statistic = isolate(input$ks_sided))
+
+ resultFis@score <- abs(resultFis@score)
+
+ ES <- runTest(ONTdata, algorithm = ""classic"",
+ statistic = ""ks.score"")@score
+
+ sign_i_df <- data.frame(LION = names(ES),
+ sign = sign(ES),
+ ES = ES)
+
+
+
+
+ incProgress(.7, detail = paste(""enrichment statistics""))
+
+ to_display <-
+ GenTable(ONTdata,
+ 'p-value' = resultFis,
+ topNodes = 2000)
+
+ to_display <-
+ to_display[grep(""LION"", to_display$TERM.ID), ]
+
+
+ LUT <- data.frame(ID = names(ONTdata@termName),
+ Discription = ONTdata@termName)
+
+ to_display$Term <- LUT$Discription[match(to_display$TERM.ID, LUT$ID)] ### otherwise, some names are abbrev.
+ to_display <- to_display[to_display$Annotated > 2, ] ### remove terms with 1 or 2 lipids
+
+ #### limiting by LION-term selection
+ if(isolate(input$LIONselection)){ ### switch for LION-selection
+ TermsOfInterest <- get_selected(isolate(input$tree), format = ""names"")
+ TermsOfInterest <- unique(c(unlist(TermsOfInterest),
+ unlist(sapply(TermsOfInterest, function(element){attr(element,""ancestry"")}))
+ )) ## vector with LION-names
+ to_display <- to_display[to_display$Term %in% TermsOfInterest,]
+ }
+
+
+ ## limiting redundant/similar parent terms
+
+ ## limiting redundant/similar parent terms
+
+ if(isolate(input$RemoveRedundantTerms)){ ### switch for LION-selection
+ ONT_DAG <- ONTdata@graph
+ ONT_DAG_lev <- buildLevels(ONT_DAG)
+ DAG.env <- ONT_DAG_lev$nodes2level
+
+ DAGlevel <- sapply(to_display$TERM.ID, function(id) {
+ DAG.env[[id]]
+ })
+
+ lipidsInTerms <- genesInTerm(ONTdata)
+
+ TermContent <-
+ sapply(to_display$TERM.ID, function(id) {
+ lipidsInTerms[[id]]
+ })
+
+ test_similarity <-
+ sapply(names(TermContent), function(term_i) {
+ sapply(names(TermContent), function(term_j) {
+ if (term_i != term_j) {
+ if (length(TermContent[[term_i]]) == length(TermContent[[term_j]])) {
+ same <- all(TermContent[[term_i]] %in% TermContent[[term_j]])
+ } else {
+ same <- FALSE
+ }
+
+
+ outputList <- list(
+ term_a = term_i,
+ term_b = term_j,
+ isSame = same,
+ term_a_level = DAGlevel[names(DAGlevel) == term_i],
+ term_b_level = DAGlevel[names(DAGlevel) == term_j]
+ )
+
+
+ outputList$remove <- """"
+
+ if ((outputList$term_a_level - outputList$term_b_level)==1) {
+ outputList$remove <- outputList$term_b
+ }
+ if ((outputList$term_a_level - outputList$term_b_level)==-1) {
+ outputList$remove <- outputList$term_a
+ }
+
+ outputList
+
+ } else {
+ list(
+ term_a = term_i,
+ term_b = term_j,
+ remove = """",
+ isSame = FALSE
+ )
+ }
+ }, simplify = FALSE)
+ })
+
+ test_similarity <-
+ test_similarity[unlist(lapply(test_similarity, function(n) {
+ n[['isSame']]
+ }))]
+
+ test_similarity <-
+ unique(unlist(lapply(test_similarity, function(n) {
+ n[['remove']]
+ })))
+
+ to_display <- to_display[!(to_display$TERM.ID %in% test_similarity),]
+
+ }
+
+
+ ###
+
+
+ to_display$`p-value` <- gsub(""< 1e"",""< 1.0e"",to_display$`p-value`) ### '< 1e-30' cannot be understood
+ to_display$`p-value` <- gsub(""< "","""",to_display$`p-value`) ### '< 1e-30' cannot be understood
+
+ to_display$'FDR q-value' <-
+ format(p.adjust(as.numeric(to_display$`p-value`), ""fdr""), digits = 3)
+
+ colnames(to_display) <-
+ c(
+ ""Term ID"",
+ ""Discription"",
+ ""Annotated"",
+ ""Significant"",
+ ""Expected"",
+ ""p-value"",
+ ""FDR q-value""
+ )
+ to_display <- to_display[, c(1, 2, 3, 6, 7)]
+
+ if(!is.null(sign_i_df) & isolate(input$ks_sided) == ""ks2""){ ### show scores when 2-sided
+ to_display$ES <- sign_i_df$ES[match(to_display$`Term ID`, sign_i_df$LION)]
+ to_display$Regulated <- as.character(factor(sign_i_df$sign[match(to_display$`Term ID`, sign_i_df$LION)], levels = c(1,-1), labels = c(""UP"",""DOWN"")))
+ }
+
+
+
+ } else {
+ to_display <- data.frame()
+ }
+ }
+
+ lengthOfTable <- length(to_display$""Term ID"")
+
+ ### make detailed table with lipids per term
+
+ to_display_detailed <- to_display
+
+ lipidsInTerms <- genesInTerm(ONTdata)
+
+ identifiers <- lapply(to_display_detailed$'Term ID', function(ID){
+ lipidsInTerms[[ID]]
+ #genesInTerm(ONTdata)[[ID]]
+ })
+
+ ####
+
+ if(length(to_display_detailed[,1]) > 0){ ### if this is zero, script goes wrong
+
+ output <- lapply(1:length(to_display_detailed[,1]), function(row){ ### add rows with lipid info
+ output <- as.data.frame(matrix(ncol = length(to_display_detailed[1,]),
+ nrow = length(identifiers[[row]])+1,
+ data=""""))
+ output[1,] <- to_display_detailed[row,]
+ output[-1,1] <- paste("" "",identifiers[[row]])
+
+ output
+ })
+
+ to_display_detailed <- as.data.frame(rbindlist(output))
+ colnames(to_display_detailed) <- colnames(to_display)
+ } else {to_display_detailed <- to_display}
+
+
+ ### lipid associations report
+
+ lipidReport <- associatedTerms(lipid = ONTdata@allGenes, ontologyObject = ONTdata, reformat = TRUE)
+ colnames(lipidReport) <- lipidReport[1,]
+ lipidReport <- lipidReport[-1,]
+
+ ### term associations report
+
+ #lipidsInTerms <- genesInTerm(ONTdata)
+
+ lipidsInTerms <- data.frame(ID = names(lipidsInTerms),
+ Discription = LUT$Discription[match(names(lipidsInTerms), LUT$ID)],
+ nr_lipids = sapply(lipidsInTerms, function(term){length(term)}),
+ lipids = sapply(lipidsInTerms, function(term){ paste(gsub(""^\\[#\\d+\\] "","""",term), collapse = '; ') })
+ )
+
+ lipidsInTerms <- subset(lipidsInTerms, Discription != lipids)
+ colnames(lipidsInTerms) <- c(""LION-term"",""LION-name"", ""nr_lipids"", ""lipid identifiers"")
+
+ ### ggplot of data
+ to_ggplot_display <- to_display
+
+
+ to_ggplot_display$color <-
+ -log(as.numeric(to_ggplot_display$`FDR q-value`), base = 10)
+ to_ggplot_display$color[to_ggplot_display$color > 6] <- 6
+
+
+ if(!is.null(isolate(input$split_direction_in_output))){
+ graph_option <- isolate(input$split_direction_in_output)
+ } else {
+ graph_option <-""combine""
+ }
+
+
+ main_title <- substitute(bold(""LION enrichment analysis"")~
+ italic(x), list(x = tolower(isolate(input$method))))
+
+ sub_title <-
+ c(ID = ifelse(
+ isolate(input$file_input == ""load external dataset"") & isolate(input$method) == ""Ranking mode"",
+ paste(isolate(input_data()$studyID),"" "", sep =""""),
+ """"
+ ),
+ A = ifelse(isolate(input$method) == ""Target-list mode"","""",paste("""",isolate(input$conditionA), sep = """")),
+ B = ifelse(isolate(input$method) == ""Target-list mode"","""",paste("""",isolate(input$conditionB), sep = """")),
+ vs = ifelse(is.null(isolate(input$conditionA)) | is.null(isolate(input$conditionB)) | isolate(input$method) == ""Target-list mode"",
+ """", ""vs.""),
+ mode = isolate(input$method))
+
+ sub_title <-
+ substitute(bold(studyID) ~ A ~ italic(vs)~ B,
+ list(studyID = sub_title[""ID""],
+ A = sub_title[""A""],
+ B = sub_title[""B""],
+ vs = sub_title[""vs""])
+ )
+
+ if(!is.null(isolate(input$local_statistics))){
+ if(isolate(input$local_statistics)==""3""){ ### in case of a F-test for local statistics
+ sub_title <- """"
+ }
+ }
+
+
+
+ if(isolate(input$method == ""Ranking mode"" & input$ks_sided == ""ks2"" & graph_option == ""split"")){
+ to_ggplot_display$sign <- sign_i_df$sign[match(to_ggplot_display$`Term ID`,sign_i_df$LION)]
+ to_ggplot_display$sign_factor <- factor(ifelse(to_ggplot_display$sign<0,""down"",""up""), levels = c(""up"",""down""))
+
+ to_ggplot_display <-
+ ggplot(data = to_ggplot_display[1:min(lengthOfTable,40), ],
+ aes(
+ y = -log(as.numeric(`FDR q-value`), base = 10),
+ x = reorder(Discription, -log(as.numeric(
+ `FDR q-value`
+ ) , base = 10))
+ )) +
+ geom_hline(yintercept = -log(0.05, base = 10),
+ alpha = .3) +
+ geom_bar(stat = 'identity', aes(fill = color), width = .70) +
+ scale_fill_gradient2(
+ limits = c(0, 6),
+ midpoint = -log(0.05, base = 10),
+ low = ""grey"",
+ mid = ""grey"",
+ high = ""red""
+ ) +
+ facet_grid(sign_factor~., space = ""free"", scales = ""free"")+
+ labs(title = main_title,
+ subtitle = sub_title)+
+ xlab("""") +
+ ylab(""-LOG(FDR q-value)"") +
+ guides(fill = ""none"") +
+ coord_flip() +
+ theme_pander()
+ } else if(isolate(input$method == ""Ranking mode"" & input$ks_sided == ""ks2"" & graph_option == ""volcano"")) {
+ ## display as volcano plot
+
+ ES <- runTest(ONTdata,
+ algorithm = ""classic"",
+ statistic = ""ks.score"")@score
+
+
+ to_ggplot_display$ES <- ES[match(to_ggplot_display$`Term ID`, names(ES))]
+
+ to_ggplot_display <-
+ ggplot(data = to_ggplot_display,
+ aes(x = ES,
+ y = -log(as.numeric(`FDR q-value`), base = 10),
+ size = Annotated)
+ ) +
+ geom_hline(yintercept = -log(0.05, base = 10),
+ alpha = .8, linetype = 2) +
+ geom_vline(xintercept = 0,
+ alpha = .8, linetype = 2) +
+ geom_point(shape = 21,aes(fill = color)) +
+ geom_text_repel(data = to_ggplot_display[as.numeric(to_ggplot_display$`FDR q-value`) < 0.1,],
+ aes(label = Discription), size = 4)+
+ scale_fill_gradient2(
+ limits = c(0, 6),
+ midpoint = -log(0.05, base = 10),
+ low = ""grey"",
+ mid = ""grey"",
+ high = ""red""
+ ) +
+ labs(x =""LION-enrichment score (ES)"", y = ""-LOG(FDR q-value)"",
+ size = ""# of lipids"", title = main_title,
+ subtitle = sub_title)+
+ guides(fill = ""none"") +
+ theme_minimal()+
+ theme(plot.title = element_text(hjust = 1), plot.subtitle = element_text(hjust = 1))
+
+ } else {
+ to_ggplot_display <-
+ ggplot(data = to_ggplot_display[1:min(lengthOfTable,40), ],
+ aes(
+ y = -log(as.numeric(`FDR q-value`), base = 10),
+ x = reorder(Discription, -log(as.numeric(
+ `FDR q-value`
+ ) , base = 10))
+ )) +
+ geom_hline(yintercept = -log(0.05, base = 10),
+ alpha = .3) +
+ geom_bar(stat = 'identity', aes(fill = color), width = .70) +
+ scale_fill_gradient2(
+ limits = c(0, 6),
+ midpoint = -log(0.05, base = 10),
+ low = ""grey"",
+ mid = ""grey"",
+ high = ""red""
+ ) +
+ labs(title = main_title,
+ subtitle = sub_title)+
+ xlab("""") +
+ ylab(""-LOG(FDR q-value)"") +
+ guides(fill = ""none"") +
+ coord_flip() +
+ theme_pander()
+ }
+
+
+
+ incProgress(.8, detail = paste(""enrichment graph""))
+
+ ### network
+
+
+ if (isolate(input$method) == ""Target-list mode"") {
+ resultTable <-
+ GenTable(ONTdata, 'p-value' = resultFis, topNodes = 2000)
+ }
+
+ if (isolate(input$method) == ""Ranking mode"") {
+ resultTable <-
+ GenTable(ONTdata, 'p-value' = resultFis, topNodes = 2000)
+
+ }
+
+ if (exists(""resultFis"")) {
+
+ resultTable$`p-value` <- gsub(""< "","""",resultTable$`p-value`) ### '< 1e-30' cannot be understood
+
+ resultTable$'FDR q-value' <-
+ format(p.adjust(as.numeric(resultTable$`p-value`), ""fdr""), digits = 3)
+ nrOfSignNodes <-
+ max(c(sum(
+ as.numeric(resultTable$'FDR q-value') < 0.05
+ ), 5)) ## with a minimum of 5
+
+ ### score(resultFis) >>> 0 scores are not tolerated
+ resultFis_score <- score(resultFis)
+ resultFis_score[resultFis_score==0] <- 0.001
+
+ #nr of nodes by FDR qvalue
+ enrichmentGraph <-
+ showSigOfNodes(
+ ONTdata,
+ resultFis_score, #k, #abs(resultFis_score), #score(resultFis),
+ firstSigNodes = nrOfSignNodes,
+ useInfo = 'all',
+ swPlot = FALSE
+ )
+
+ enrichment_iGraph <-
+ graph_from_graphnel(enrichmentGraph$dag)
+
+ nodes <-
+ data.frame(id = unique(c(
+ get.data.frame(enrichment_iGraph)$from,
+ get.data.frame(enrichment_iGraph)$to
+ )))
+ nodes$label <-
+ resultTable$Term[match(nodes$id, resultTable$TERM.ID)]
+ nodes$shape <- ""dot""
+
+ #val_col <- colorRampPalette(c(""#BEBEBE"",""#BEBEBE"",""#E8AD43"",""#FFC100"",""#FFFF00"",""red""))(100)
+ val_col <-
+ colorRampPalette(c(""#BEBEBE"", ""#BEBEBE"", ""yellow"", ""orange"", ""red""))(100)
+ logPs <-
+ -log(as.numeric(resultTable$`p-value`[match(nodes$id, resultTable$TERM.ID)]), 10)
+ logPs[logPs < 1] <- 1
+ logPs[logPs > 10] <- 10
+ nodes$color <- val_col[logPs * 10]
+
+ nodes$color[grep(""CAT"", nodes$id)] <- ""#EEEEEE""
+ nodes$shape[grep(""CAT"", nodes$id)] <- ""box""
+ nodes$color[grep(""all"", nodes$id)] <- ""black""
+ nodes$shape[grep(""all"", nodes$id)] <- ""triangle""
+
+ ## size as function of nr of annotions
+ nodes$size <-
+ 0.2 * as.numeric(resultTable$Annotated[match(nodes$id, resultTable$TERM.ID)])
+ ##
+
+ nodes$size[nodes$size < 4] <- 4
+ nodes$size[grep(""all"", nodes$id)] <- 20
+ nodes$label[grep(""all"", nodes$id)] <- ""ontology root""
+
+ ## get levels
+ ONT_DAG <- ONTdata@graph
+ ONT_DAG <- buildLevels(ONT_DAG)
+ DAG.env <- ONT_DAG$nodes2level
+ DAG.env$`LION:0080986`
+ nodes$level <- sapply(nodes$id, function(id) {
+ DAG.env[[id]]
+ })
+
+ edges <- get.data.frame(enrichment_iGraph)
+ edges$color <- ""grey""
+ edges$arrows <- ""from""
+
+ #### limiting by LION-term selection
+ if(isolate(input$LIONselection)){ ### switch for LION-selection
+ #TermsOfInterest ## vector with LION-names from previous section
+ nodes <- nodes[nodes$label %in% c(TermsOfInterest,""ontology root""),]
+ ## delete nodes not selected for analysis
+ }
+ ###
+
+ ### delete dead ends of CATs w/o LION-terms
+ CATs <-
+ edges$from[paste(gsub("":\\d+"", """", edges$from),
+ gsub("":\\d+"", """", edges$to),
+ sep = """") %in% c(""CATLION"", ""CATCAT"")]
+ CATs <- nodes$id[!(nodes$id %in% CATs)]
+ CATs <- CATs[grepl(""CAT"", CATs)]
+
+ nodes <- nodes[!nodes$id %in% CATs, ]
+
+ to_display_network <- visNetwork(nodes, edges) %>%
+ visPhysics(stabilization = TRUE) %>%
+ visHierarchicalLayout(direction = ""LR"", levelSeparation = 250) %>%
+ visInteraction(navigationButtons = TRUE) %>%
+ visOptions(highlightNearest = TRUE) %>%
+ visPhysics(
+ solver = ""forceAtlas2Based"",
+ forceAtlas2Based = list(gravitationalConstant = -20)
+ )
+
+ incProgress(.9, detail = paste(""network""))
+
+ ### return as list object
+
+ }
+
+ # if(isolate(input$EmailMissingLipids)){ ## email missing lipids when option is set
+ # #sendEmail(subject = ""missing annotations"",mail_message = paste(subset(lipidExistance,`LION ID`==""not found"")$input, collapse = ""\n""))
+ # sendEmail(subject = ""missing annotations"", mail_message = paste(apply(lipidExistance, 1, function(row){paste(row, collapse = ""\t"")}), collapse = ""\n""))
+ # }
+
+
+
+ ### now LUT is available, match LION names correctly
+ lipidExistance$'LION name' <- LUT$Discription[match(lipidExistance$'LION ID', LUT$ID)]
+ lipidExistance$'LION name'[is.na(lipidExistance$'LION name')] <- ""not found""
+
+
+
+ list(
+ ONTdata = ONTdata,
+ lipidExistance = lipidExistance,
+ lipidExistance_toview = lipidExistance_toview,
+ matching_statistics = matching_statistics,
+ to_display = to_display,
+ to_display_detailed = to_display_detailed,
+ lipidReport = lipidReport,
+ lipidsInTerms = lipidsInTerms,
+ to_ggplot_display = to_ggplot_display,
+ edges_nodes = list(edges, nodes),
+ to_display_network = to_display_network
+
+ )
+
+ })
+ } else {
+ ### empty if there is no input
+ list(
+ ONTdata = NULL,
+ lipidExistance = NULL,
+ lipidExistance_toview, NULL,
+ matching_statistics = NULL,
+ to_display = NULL,
+ to_display_detailed = NULL,
+ lipidReport = NULL,
+ lipidsInTerms = NULL,
+ to_ggplot_display = NULL,
+ edges_nodes = NULL,
+ to_display_network = NULL
+
+ )
+
+ } ### if perform when there is input (dim 1 by 1 >> no input)
+
+
+ })
+
+
+ output$networkcoord <- downloadHandler(
+ filename = paste(""LION-network-job"",isolate(input$submitB)+isolate(input$submitA), "".zip"", sep=""""),
+ content = function(file) {
+
+ visNetworkProxy(""ontology.plot"") %>% visGetPositions() ### does actually only works the second time
+
+ if (!is.null(input$ontology.plot_positions)){
+ coords_base <- do.call(rbind, input$ontology.plot_positions)
+
+ edges <- isolate(dataBlock()$edges_nodes[[1]])
+ nodes <- isolate(dataBlock()$edges_nodes[[2]])
+
+ nodes$shape <- ifelse(nodes$shape == ""box"", ""square"", nodes$shape)
+ nodes$shape <- ifelse(nodes$shape == ""triangle"", ""square"", nodes$shape)
+ nodes$shape <- ifelse(nodes$shape == ""dot"", ""circle"", nodes$shape)
+
+ nodes$size <- nodes$size / 2
+ nodes$size[nodes$shape == ""square""] <- 10
+
+ nodes$label.dist <- sqrt(nodes$size)/3.5
+
+ colnames(edges)[match(c(""from"",""to""),colnames(edges))] <- c(""to"",""from"")
+ edges <- edges[,colnames(edges)[c(2,1,3,4,5)]]
+
+ edges <- edges[(edges$from %in% nodes$id) & (edges$to %in% nodes$id),]
+
+ net = graph_from_data_frame(d = edges ,vertices = nodes,directed = T)
+
+ layout <- layout_as_tree(net, flip.y = F, root = 1 , rootlevel = nodes$level)[,c(2,1)]
+ layout[,1] <- unlist(coords_base[,1]) / 200
+ layout[,2] <- unlist(coords_base[,2]) / 200
+
+ interactive_network <- isolate(dataBlock()$to_display_network)
+
+ save(list = c(""net"",""layout"", ""edges"",""nodes"",""interactive_network""), file = ""network.Rdata"")
+
+ png(paste(""LION-network-job"",isolate(input$submitB)+isolate(input$submitA), "".png"", sep=""""), width = 6000, height = 6000, res = 600)
+ plot(net, layout = layout,
+ vertex.label.cex=.4,
+ vertex.label.degree = 1.5*pi, edge.arrow.size = .40,
+ vertex.label.color=""black"")
+ dev.off()
+
+ svg(paste(""LION-network-job"",isolate(input$submitB)+isolate(input$submitA), "".svg"", sep=""""), width = 12, height = 12)
+ plot(net, layout = layout,
+ vertex.label.cex=.5,
+ vertex.label.degree = 1.5*pi, edge.arrow.size = .40,
+ vertex.label.color=""black"")
+ dev.off()
+
+ Rfile <- read.delim(""data/display_network.R"", header = F)
+ write.table(file = ""display_network.R"",Rfile$V1, quote = F, row.names = F, col.names = F)
+
+ zip(zipfile=file, files=c( paste(""LION-network-job"",isolate(input$submitB)+isolate(input$submitA), "".png"", sep=""""),
+ paste(""LION-network-job"",isolate(input$submitB)+isolate(input$submitA), "".svg"", sep=""""),
+ ""network.Rdata"",""display_network.R"",include_directories=FALSE)
+ )
+
+
+ }
+
+ })
+ #####
+
+
+
+ ### mapping percentage
+ output$mapping_percentage <- renderText({
+
+ if (is.null(dataBlock()$lipidExistance)){
+ output_text <- ""Unexpected input""
+ } else {
+
+ matching_statistics <- dataBlock()$matching_statistics
+
+ if (length(isolate(dataBlock()$to_display[,1])) == 0){
+ comment <- ""\nHowever, no upstream LION-terms were found for analysis.""
+ hideTab(inputId = ""tabs"", target = ""LION enrichment table"")
+ hideTab(inputId = ""tabs"", target = ""LION enrichment graph"")
+ hideTab(inputId = ""tabs"", target = ""LION network view"")
+ } else comment <- """"
+
+
+ color_df <- data.frame(match = c(""direct matching"",""smart matching"", ""fatty acid-association prediction"",""""),
+ color = c(""#4f4d4d"",""#9c3c2d"",""#c4942b"",""#bdbbbf""))
+
+ output_text <- paste("""",
+ matching_statistics$matched, "" out of "", matching_statistics$total, "" "", ""("", round(matching_statistics$percent, digits = 2), ""%"", "")"",
+ "" identifiers are matched to LION.
"",
+ paste("""",color_df$match,"""" , sep ="""", collapse = ""
""),
+ sep = """")
+ }
+ cat(""mapping % done\n"")
+ output_text
+
+ })
+
+
+
+ ###
+ output$downloadInputCNTRL <- renderUI({
+ if(is.null(dataBlock()$lipidExistance)){} else {
+ downloadButton(""downloadInput"", ""Download input table"")
+ }
+ })
+
+
+ #output$value <- renderTable({
+ output$value <- renderFormattable({
+ table <- dataBlock()$lipidExistance_toview #lipidExistance
+ formattable(table,align = c(""l"",""l"",""l""))
+ }) #, sanitize.text.function=identity)
+
+ output$downloadInput <- downloadHandler(
+
+ filename = function() {
+ paste(""LION-input-job"",isolate(input$submitB)+isolate(input$submitA), "".csv"", sep="""")
+
+ },
+ content = function(file) {
+ write.csv(dataBlock()$lipidExistance,
+ file, row.names = FALSE,quote = TRUE)
+ }
+ )
+
+
+ output$ontology.table <- renderFormattable({
+ table <- dataBlock()$to_display
+ rownames(table) <- NULL
+ ## add linkds
+ table[[1]] <-
+ paste("""",
+ table[[1]],"""", sep = """")
+
+ formattable(table, align = ""l"")
+
+
+ })
+
+ output$downloadTable <- downloadHandler(
+ filename = function() {
+ paste(""LION-enrichment-job"",isolate(input$submitB)+isolate(input$submitA), "".csv"", sep="""")
+
+ },
+ content = function(file) {
+ write.csv(dataBlock()$to_display,
+ file, row.names = FALSE,quote = TRUE)
+ }
+ )
+
+ output$download_pValues <- downloadHandler(
+
+ filename = function() {
+ paste(""LION-rankingvalues-job"",isolate(input$submitB)+isolate(input$submitA), "".csv"", sep="""")
+
+ },
+ content = function(file) {
+ pre_processed_data <- pre_processed_data()[[1]]
+ colnames(pre_processed_data) <- c(""ID"", ""value"")
+ write.csv(pre_processed_data,
+ file, row.names = FALSE,quote = TRUE)
+ }
+ )
+
+ output$downloadDetailTable <- downloadHandler(
+ filename = function() {
+ paste(""LION-enrichment-report-job"",isolate(input$submitB)+isolate(input$submitA), "".zip"", sep="""")
+
+ },
+ content = function(file) {
+ write.csv(dataBlock()$to_display_detailed,
+ file = ""LION-enrichment-detailed-job.csv"", row.names = FALSE,quote = TRUE)
+ write.csv(dataBlock()$lipidReport,
+ file = ""LION-lipid-associations.csv"", row.names = FALSE,quote = TRUE)
+ write.csv(dataBlock()$lipidsInTerms,
+ file = ""LION-term-associations.csv"", row.names = FALSE,quote = TRUE)
+
+
+
+ zip(zipfile=file, files=c( ""LION-enrichment-detailed-job.csv"", ""LION-lipid-associations.csv"",""LION-term-associations.csv""))
+
+
+ }
+ )
+
+
+ output$downloadPlotPNG <- downloadHandler(
+ filename = function() {
+ paste(""LION-enrichment-plot-job"",isolate(input$submitB)+isolate(input$submitA), '.png', sep='') },
+ content = function(file) {
+ ggsave(file, width = 2.5*5.52, height = 2.5*3.66,
+ dataBlock()$to_ggplot_display+
+ theme(plot.subtitle = element_text(hjust = 1),
+ plot.title = element_text(hjust = 1)),
+ device = 'png', dpi=300)
+ }
+ )
+ output$downloadPlotSVG <- downloadHandler(
+ filename = function() {
+ paste(""LION-enrichment-plot-job"",isolate(input$submitB)+isolate(input$submitA), '.svg', sep='') },
+ content = function(file) {
+ ggsave(file, width = 1.5*5.52, height = 1.5*3.66,
+ dataBlock()$to_ggplot_display+
+ theme(plot.subtitle = element_text(hjust = 1),
+ plot.title = element_text(hjust = 1)),
+ device = svg, scale=1.5)
+ }
+ )
+
+ output$ontology.graph <- renderPlot({
+ dataBlock()$to_ggplot_display
+
+ })
+
+
+ ## ontology enrichment tree
+ output$ontology.plot <- renderVisNetwork({
+ dataBlock()$to_display_network
+ })
+
+
+
+
+
+ output$tree <- renderTree({ ### LION-tree
+ LIONstructure
+ })
+
+
+
+ #output$markdown <- renderUI({
+ # HTML(markdown::markdownToHTML(text = change_log ))
+ #})
+
+
+}
+","R"
+"Lipidomics","martijnmolenaar/LION-web","OntologyApp/ui.R",".R","26399","335","require(shiny)
+require(shinythemes)
+require(visNetwork)
+library(shinyTree)
+library(shinyWidgets)
+library(shinyBS)
+library(formattable)
+library(shinycssloaders)
+
+
+##
+
+
+# Define UI for random distribution application
+#fluidPage(theme = shinytheme(""cosmo""),
+fluidPage(theme = shinytheme(""journal""),
+
+ # Application title
+ #titlePanel(""LION/web | Lipid Ontology enrichment analysis for lipidomics""),
+ br(),
+
+ sidebarLayout(
+
+
+ sidebarPanel( width = 4,
+
+ tabsetPanel(id = ""method"", type = ""tabs"", selected = ""Ranking mode"",
+
+ tabPanel(id = ""Settings"", title = """", icon = icon(""cog"", lib = ""font-awesome""),
+ br(),
+ br(),
+
+ popify(placement = ""right"", title = ""Info"", options=list(container=""body""),
+ materialSwitch(
+ inputId = ""RemoveRedundantTerms"",
+ value = TRUE,
+ label = ""Exclude parent terms with same associations as child"",
+ status = 'primary',
+ right = TRUE
+ ),
+ content = 'When a LION-term contains the same lipids as its parent (for instance, glycerophosphocholines and diacylglycerophosphocholines), the parent term (here glycerophosphocholines) will be excluded in analysis. '
+ ),
+ br(),
+ popify(placement = ""right"", title = ""Info"", options=list(container=""body""),
+ materialSwitch(
+ inputId = ""SmartMatching"",
+ value = TRUE,
+ label = ""Use 'smartmatching' (beta)"",
+ status = 'primary',
+ right = TRUE
+ ),
+ content = ""If possible, unmatched lipids are associated with related LION-terms: `TG(O-16:0/18:2/22:6)` is associated with `alkyldiacylglycerols`, `C16:0`, `C18:2`, and `C22:6`""
+ ),
+ br(),
+ popify(placement = ""right"", title = ""Info"", options=list(container=""body""),
+ materialSwitch(
+ inputId = ""FAprediction"",
+ value = FALSE,
+ label = ""Predict fatty acid assocations (beta)"",
+ status = 'primary',
+ right = TRUE
+ ),
+ content = ""For sum-formatted phospholipids, e.g. PC(34:1), predict the most likely fatty acid assocations, based on reported fatty acid compositions. For example, PC(34:1) will be associated to C16:0 and C18:1. Only use for datasets of mammalian origin""
+ ),
+ # br(),
+ # popify(placement = ""right"", title = ""Info"", options=list(container=""body""),
+ # materialSwitch(
+ # inputId = ""EmailMissingLipids"",
+ # label = ""Automatically send unmatched lipids to LION-team"",
+ # status = 'primary',
+ # right = TRUE
+ # ),
+ # content = ""Names of lipids that cannot be matched to LION are automatically send to the LION-team. This will help us to improve the coverage of the database. User information and associated data will NOT be sent.""
+ # ),
+ br(),
+ popify(placement = ""right"", title = ""Info"", options=list(container=""body""),
+ materialSwitch(
+ inputId = ""LIONselection"",
+ label = ""Preselect LION-terms for analysis"",
+ status = 'primary',
+ right = TRUE
+ ),
+ content = ""By default, all LION-terms will be used in the analysis. With this option, you can pre-select LION-terms to use in the enrichment analysis.""
+ ),
+ em(""""),
+ shinyTree(""tree"",checkbox = TRUE,search = TRUE),
+ br()
+ ),
+
+ tabPanel(""Ranking mode"",
+ br(),
+ tabsetPanel(id = ""sub_method"", type = ""pills"", selected = ""(i) process input"",
+ tabPanel(""(i) process input"",
+ #br(),
+ prettyRadioButtons(
+ inputId = ""file_input"",
+ label = """",
+ choices = c(""file input"",
+ ""load external dataset""),
+ inline = TRUE,
+ status = ""danger"",
+ fill = TRUE
+ ),
+ withSpinner(color = ""#9c3c2d"", size = .5,
+ uiOutput(""load_datasetUI""))
+ ),
+ tabPanel(""(ii) analysis"",
+ br(),
+ popify(
+ placement = ""bottom"",
+ title = ""Info"",
+ textAreaInput(
+ ""listwPvalues"",
+ label = h5(""lipids with values:""),
+ value = """",
+ placeholder = 'comma or tab-separated, i.e.;\nPC(16:0/18:1)\t0.7303\nPC(36:1)\t0.4325\nSM(d18:1/20:1),0.7654\nSLM:000088147\t0.1958\nLMGP01010007\t0.8450\n...\netc.',
+ resize = ""vertical"",
+ height = 400
+ ),
+ content = 'Provide a list of metabolites with numeric values (comma or tab seperated) to rank the input. Select the correct ranking directions with the option ""ranking direction"" below.'
+ ),
+
+ bsCollapse(id = ""KSsettings"",
+ bsCollapsePanel(""K-S settings"",
+ radioButtons(""ranking"", ""ranking direction"",
+ c(""from low to high"" = ""ascending"",
+ ""from high to low"" = ""descending"")),
+ radioButtons(""ks_sided"", ""alternative hypothesis"",
+ c(""one-tailed (ECDF is higher)"" = ""ks"",
+ ""two-tailed"" = ""ks2"")),
+ uiOutput(""KS2_UI"")
+ )
+ ),
+ fluidRow(
+ popify(placement = ""top"", title = ""Info"",
+ column(offset = 0,#style='margin-left:2%;' ,
+ width = 12,
+ actionButton(""submitB"","" Submit"",
+ icon = icon(""lightbulb"", lib = ""font-awesome""))
+ ),content = 'After clicking ""submit"", LION/web matches the input lipids to the LION-database. Only matched identifiers will be used in the enrichment analysis. Subsequently, LION/web ranks the input lipids by the provided numeric value. The distributions of all LION-terms associated with the dataset are compared to uniform distributions and evaluated by Kolmogorov-Smirnov-tests. A low p-value is returned when lipids associated with a certain LION-term are higher on top of the ranked list than one would expect by chance.')),
+ br(),
+ br(),
+ actionLink(""exampleB1"", ""example 1 (plasma membrane vs ER fraction)*""),
+ br(),
+ actionLink(""exampleB2"", ""example 2 (mitochondrial fraction vs homogenate)*""),
+ br(),
+ actionLink(""exampleB3"", ""example 3 (stimulated vs non-stimulated ER fractions)*""),
+ br(),
+ br(),
+ ""* adapted from Andreyev AY, et al., 2010""
+ )
+ )),
+ tabPanel(""Target-list mode"",
+ br(),
+ popify(placement = ""bottom"", title = ""Info"",
+ textAreaInput(
+ ""sublist"",
+ label = h5(""lipid target list:""),
+ value = """",
+ placeholder = 'PC(16:0/18:1)\nSM(d18:1/20:1)\n...\netc.',
+ resize = ""vertical"",
+ height = 100
+ ), content = 'Provide two lists of lipids; a ""hitlist"" containing lipids that are evaluated for enrichment (lipids associated with a condition of interest, a sublist obtained by data-clustering, etc.), and a background set containing all the lipids in the experiment.'),
+ textAreaInput(
+ ""background"",
+ label = h5(""lipid background list:""),
+ value = """",
+ placeholder = 'PC(16:0/18:1)\nPC(36:1)\nSM(d18:1/20:1)\nSLM:000088147\nLMGP01010007\n...\netc.',
+ resize = ""vertical"",
+ height = 250
+ ),
+ br(),
+ fluidRow(
+ #column(width = 1,actionButton(""FShelp"", """",icon = icon(name = ""question"",lib = ""font-awesome""))),
+ popify(placement = ""top"", title = ""Info"",
+ column(offset = 0,#style='margin-left:2%;' ,
+ width = 12,
+ actionButton(""submitA"","" Submit"",
+ icon = icon(""lightbulb"", lib = ""font-awesome""))
+ ), content = 'After clicking ""submit"", LION/web matches the input lipids to the LION-database. Only matched identifiers will be used in the enrichment analysis. Subsequently, LION/web calculates a score of every LION-term that is associated with the dataset, for both the hitlist as the background set. These scores are compared by Fisher-exact tests. A low p-value is returned when a certain LION-term is higher represented in the hitlist than one would expect by chance.')),
+ br(),
+ br(),
+ actionLink(""exampleA1"", ""example 1 (cluster 6 in Fig. 2A*)""),
+ br(),
+ actionLink(""exampleA2"", ""example 2 (cluster 7 in Fig. 2A*)""),
+ br(),
+ actionLink(""exampleA3"", ""example 3 (cluster 8 in Fig. 2A*)""),
+ br(),
+ br(),
+ ""* from Molenaar MR, et al., 2019""
+ # ),
+ # tabPanel(id = ""Contact"", title = """", icon = icon(""envelope-open-text"", lib = ""font-awesome""),
+ # br(),
+ # br(),
+ # 'Questions, feedback or a request to increase coverage? Contact us:',
+ # br(),
+ # br(),
+ # textAreaInput(""from"", label = ""From:"", value="""", resize = ""none"", rows = 1, placeholder = 'your_email@gmail.com'),
+ # selectizeInput(""subject"", label = ""Subject:"", selected = ""Question"", options = list(create = TRUE),
+ # choices = c(""Question"",""Feedback"",""Request to add lipids to LION"","""")),
+ #
+ # textAreaInput(""message"", label = ""Message:"",value = """", resize = ""vertical"",
+ # placeholder =""Write message here. Please include a list of identifiers if you want to request lipids to add.""),
+ # br(),
+ # actionButton(""send"", ""Send mail"")
+
+
+
+ )
+
+
+
+
+
+ )),
+
+ mainPanel(
+ tabsetPanel(id = ""tabs"", type = ""tabs"",
+ tabPanel(""General information"",
+
+ h3(""LION/web: LION enrichment analysis""),
+ br(),
+ img(src=""LIONicon enrich.png"", align = ""left"", height = '200px'), #, width = '550px'),
+ br(),br(),br(),br(),br(),br(),br(),br(),br(),br(),
+ p('The Lipid Ontology (LION) enrichment analysis web application (LION/web) is a novel bioinformatics tool for lipidomics that',
+ 'enables users to search for enriched LION-terms in lipidomic subsets. LION-terms contain detailed lipid classification',
+ 'by LIPIDMAPS, biophysical data, lipid functions and organelle associations.'),
+ p(""Any comments, questions or suggestions? Do you want to add lipid annotations? Please use our contact form.""),
+ br(),
+ p(""Please cite:""),
+ a('LION/web: a web-based ontology enrichment tool for lipidomic data analysis.',
+ href=""https://doi.org/10.1093/gigascience/giz061"", target=""_blank""),br(),
+ tags$b(""Gigascience. 2019 Jun 1;8(6). pii: giz061. doi: 10.1093/gigascience/giz061.""),
+ br(),
+ em(""Martijn R. Molenaar, Aike Jeucken, Tsjerk A. Wassenaar, Chris H. A. van de Lest, Jos F. Brouwers, J. Bernd Helms.""),
+ br(),
+ br(),
+ br(),
+ a('Lipidomic profiling of rat hepatic stellate cells during activation reveals a two-stage process accompanied by increased levels of lysosomal lipids.',
+ href=""https://doi.org/10.1016/j.jbc.2023.103042"", target=""_blank""),br(),
+ tags$b(""J Biol Chem. 2023 Feb 18;299(4):103042. doi: 10.1016/j.jbc.2023.103042.""),
+ br(),
+ em(""Martijn R Molenaar, Maya W Haaker, A Bas Vaandrager, Martin Houweling, J Bernd Helms.""),
+ br(),
+ br(),
+ br(),
+ p(""Division Cell Biology, Metabolism & Cancer, Department Biomolecular Health Sciences, Universiteit Utrecht, The Netherlands""),
+ 'v. 2024.01.28',
+ br(),
+
+ br(),
+
+ br()
+
+ ),
+ tabPanel(""LION input"",
+ br(),
+ #em(
+ htmlOutput(""mapping_percentage""), #textOutput(""mapping_percentage"") ),
+ br(),
+ formattableOutput(""value""),
+ uiOutput(""downloadInputCNTRL""),
+
+ br()
+
+
+ ),
+ tabPanel(""LION enrichment table"",
+ br(),
+ #tableOutput(""ontology.table""),
+ formattableOutput(""ontology.table""),
+ fluidRow(
+ column(
+ offset = 0,
+ width = 1,
+ style = ""margin-top: 5px;"",
+ align = ""right"",
+ popify(
+ placement = ""top"",
+ title = ""LION enrichment"",
+ options = list(container = ""body""),
+ el = icon(name = ""question"", lib = ""font-awesome"", ""fa-2x""),
+ content = 'This table includes all LION-terms that are associated with the provided dataset and is sorted by enrichment. N.B.: enrichment of terms related to membrane fluidity and bilayer thickness is based on phospholipid composition. Other factors that are not taken into account (including protein composition and cholesterol concentration) might affect these properties.'
+ )
+ ),
+ column(offset = 0,width = 10,
+ downloadButton(""downloadTable"", ""Download table""),
+ downloadButton(""downloadDetailTable"", ""Download report"")
+ )),
+ br(),
+ br()
+ ),
+
+ tabPanel(""LION enrichment graph"",
+ br(),
+ plotOutput(""ontology.graph"", height = 650
+ ),
+ fluidRow(
+ column(
+ offset = 0,
+ width = 1,
+ style = ""margin-top: 5px;"",
+ align = ""right"",
+ popify(
+ placement = ""top"",
+ title = ""LION enrichment"",
+ options = list(container = ""body""),
+ el = icon(name = ""question"", lib = ""font-awesome"", ""fa-2x""),
+ content = 'This graph represents the 40 most enriched LION-terms. N.B.: enrichment of terms related to membrane fluidity and bilayer thickness is based on phospholipid composition. Other factors that are not taken into account (including protein composition and cholesterol concentration) might affect these properties.'
+ )
+ ),
+ column(offset = 0,width = 10,
+ downloadButton(""downloadPlotSVG"", ""Download plot as SVG""),
+ downloadButton(""downloadPlotPNG"", ""Download plot as PNG""))
+
+ ),
+
+ br()
+ ),
+
+ tabPanel(""LION network view"",
+ visNetworkOutput(""ontology.plot"", height = 650),
+ img(src=""legend.png"", align = ""right"", height = '67px', width = '550px'),
+ br(),br(),br(),br(),
+ bsCollapse(id = ""download_network_bs"",
+ bsCollapsePanel(title = ""Download network"",
+ column(2, downloadButton(""networkcoord"", ""Download as ZIP"")))
+ ))
+
+
+ )
+ )
+ )
+)
+","R"
+"Lipidomics","martijnmolenaar/LION-web","OntologyApp/data/20190409 LION_tree_structure.R",".R","24673","353","options(stringsAsFactors = FALSE)
+
+LIONstructure <-
+ list('cellular component'=list('nucleus'='LION:0012079',
+ 'endoplasmic reticulum (ER)'='LION:0012080',
+ 'mitochondrion'='LION:0012081',
+ 'plasma membrane'='LION:0012082',
+ 'chloroplast'='LION:0012083',
+ 'lipid droplet'='LION:0012084',
+ 'golgi apparatus'='LION:0012085',
+ 'endosome/lysosome'='LION:0012086',
+ 'peroxisome'='LION:0012087'),
+ 'function'=
+ list('lipid-mediated signalling'='LION:0012009',
+ 'membrane component'='LION:0012010',
+ 'lipid storage'='LION:0012011'),
+ 'lipid classification'=
+ list('fatty acids [FA]'=
+ list('fatty acids and conjugates [FA01]'='LION:0001742',
+ 'eicosanoids [FA03]'=
+ list('prostaglandins [FA0301]'='LION:0014870',
+ 'leukotrienes [FA0302]'='LION:0014871',
+ 'thromboxanes [FA0303]'='LION:0014872')),
+ 'glycerolipids [GL]'=
+ list('other glycerolipids [GL00]'='LION:0000601',
+ 'monoradylglycerols [GL01]'=
+ list('monoacylglycerols [GL0101]'='LION:0000619',
+ 'monoalkylglycerols [GL0102]'='LION:0000620',
+ 'mono-(1z-alkenyl)-glycerols [GL0103]'='LION:0000621'),
+ 'diradylglycerols [GL02]'=
+ list('diacylglycerols [GL0201]'='LION:0000607',
+ '1-alkyl,2-acylglycerols [GL0202]'='LION:0000608',
+ '1-acyl,2-alkylglycerols [GL0207]'='LION:0000609',
+ 'dialkylglycerols [GL0203]'='LION:0000610',
+ '1z-alkenylacylglycerols [GL0204]'='LION:0000611',
+ 'di-glycerol tetraethers [GL0205]'='LION:0000612',
+ 'di-glycerol tetraether glycans [GL0206]'='LION:0000613'),
+ 'triradylglycerols [GL03]'=
+ list('triacylglycerols [GL0301]'='LION:0000622',
+ 'alkyldiacylglycerols [GL0302]'='LION:0000623',
+ 'dialkylmonoacylglycerols [GL0303]'='LION:0000624',
+ '1z-alkenyldiacylglycerols [GL0304]'='LION:0000625',
+ 'estolides [GL0305]'='LION:0000626'),
+ 'glycosylmonoradylglycerols [GL04]'=
+ list('glycosylmonoacylglycerols [GL0401]'='LION:0000617',
+ 'glycosylmonoalkylglycerols [GL0402]'='LION:0000618'),
+ 'glycosyldiradylglycerols [GL05]'=
+ list('glycosyldiacylglycerols [GL0501]'='LION:0000614',
+ 'glycosylalkylacylglycerols [GL0502]'='LION:0000615',
+ 'glycosyldialkylglycerols [GL0503]'='LION:0000616')),
+ 'glycerophospholipids [GP]'=
+ list('other glycerophospholipids [GP00]'='LION:0000009',
+ 'glycerophosphocholines [GP01]'=
+ list('diacylglycerophosphocholines [GP0101]'='LION:0000030',
+ '1-alkyl,2-acylglycerophosphocholines [GP0102]'='LION:0000031',
+ '1-(1z-alkenyl),2-acylglycerophosphocholines [GP0103]'='LION:0000032',
+ 'dialkylglycerophosphocholines [GP0104]'='LION:0000033',
+ 'monoacylglycerophosphocholines [GP0105]'='LION:0000034',
+ 'monoalkylglycerophosphocholines [GP0106]'='LION:0000035',
+ '1z-alkenylglycerophosphocholines [GP0107]'='LION:0000036',
+ '1-acyl,2-alkylglycerophosphocholines [GP0108]'='LION:0000037'),
+ 'glycerophosphoethanolamines [GP02]'=
+ list('diacylglycerophosphoethanolamines [GP0201]'='LION:0000038',
+ '1-alkyl,2-acylglycerophosphoethanolamines [GP0202]'='LION:0000039',
+ '1-(1z-alkenyl),2-acylglycerophosphoethanolamines [GP0203]'='LION:0000040',
+ 'dialkylglycerophosphoethanolamines [GP0204]'='LION:0000041',
+ 'monoacylglycerophosphoethanolamines [GP0205]'='LION:0000042',
+ 'monoalkylglycerophosphoethanolamines [GP0206]'='LION:0000043',
+ '1z-alkenylglycerophosphoethanolamines [GP0207]'='LION:0000044',
+ '1-acyl,2-alkylglycerophosphoethanolamines [GP0208]'='LION:0000045'),
+ 'glycerophosphoinositols [GP06]'=
+ list('monoacylglycerophosphoinositols [GP0605]'='LION:0000046',
+ 'diacylglycerophosphoinositols [GP0601]'='LION:0000047',
+ '1-alkyl,2-acylglycerophosphoinositols [GP0602]'='LION:0000048',
+ '1-(1z-alkenyl),2-acylglycerophosphoinositols [GP0603]'='LION:0000049',
+ 'dialkylglycerophosphoinositols [GP0604]'='LION:0000050',
+ 'monoalkylglycerophosphoinositols [GP0606]'='LION:0000051',
+ '1z-alkenylglycerophosphoinositols [GP0607]'='LION:0000052'),
+ 'glycerophosphoserines [GP03]'=
+ list('diacylglycerophosphoserines [GP0301]'='LION:0000053',
+ '1-alkyl,2-acylglycerophosphoserines [GP0302]'='LION:0000054',
+ '1-(1z-alkenyl),2-acylglycerophosphoserines [GP0303]'='LION:0000055',
+ 'monoacylglycerophosphoserines [GP0305]'='LION:0000056',
+ 'monoalkylglycerophosphoserines [GP0306]'='LION:0000057',
+ '1z-alkenylglycerophosphoserines [GP0307]'='LION:0000058'),
+ 'glycerophosphoglycerols [GP04]'=
+ list('diacylglycerophosphoglycerols [GP0401]'='LION:0000059',
+ '1-alkyl,2-acylglycerophosphoglycerols [GP0402]'='LION:0000060',
+ '1-(1z-alkenyl),2-acylglycerophosphoglycerols [GP0403]'='LION:0000061',
+ 'dialkylglycerophosphoglycerols [GP0404]'='LION:0000062',
+ 'monoacylglycerophosphoglycerols [GP0405]'='LION:0000063',
+ 'monoalkylglycerophosphoglycerols [GP0406]'='LION:0000064',
+ '1z-alkenylglycerophosphoglycerols [GP0407]'='LION:0000065',
+ 'diacylglycerophosphomonoradylglycerols [GP0409]'='LION:0000066',
+ 'monoacylglycerophosphomonoradylglycerols [GP0410]'='LION:0000067',
+ '1-acyl,2-alkylglycerophosphoglycerols [GP0411]'='LION:0000068'),
+ 'glycerophosphoglycerophosphates [GP05]'='LION:0000015',
+ 'glycerophosphoinositol monophosphates [GP07]'='LION:0000016',
+ 'glycerophosphoinositol bisphosphates [GP08]'='LION:0000017',
+ 'glycerophosphoinositol trisphosphates [GP09]'='LION:0000018',
+ 'glycerophosphates [GP10]'=
+ list('diacylglycerophosphates [GP1001]'='LION:0000069',
+ '1-alkyl,2-acylglycerophosphates [GP1002]'='LION:0000070',
+ '1-(1z-alkenyl),2-acylglycerophosphates [GP1003]'='LION:0000071',
+ 'monoacylglycerophosphates [GP1005]'='LION:0000072',
+ 'monoalkylglycerophosphates [GP1006]'='LION:0000073',
+ '1z-alkenylglycerophosphates [GP1007]'='LION:0000074'),
+ 'glyceropyrophosphates [GP11]'='LION:0000020',
+ 'glycerophosphoglycerophosphoglycerols [GP12]'=
+ list('diacylglycerophosphoglycerophosphodiradylglycerols [GP1201]'='LION:0000728',
+ 'diacylglycerophosphoglycerophosphomonoradylglycerols [GP1202]'='LION:0000940',
+ '1-alkyl,2-acylglycerophosphoglycerophosphodiradylglycerols [GP1203]'='LION:0000941',
+ '1-alkyl,2-acylglycerophosphoglycerophosphomonoradylglycerols [GP1204]'='LION:0000942',
+ '1-(1z-alkenyl),2-acylglycerophosphoglycerophosphodiradylglycerols [GP1205]'='LION:0000943',
+ '1-(1z-alkenyl),2-acylglycerophosphoglycerophosphomonoradylglycerols [GP1206]'='LION:0000944',
+ 'dialkylglycerophosphoglycerophosphodiradylglycerols [GP1212]'='LION:0000945',
+ 'dialkylglycerophosphoglycerophosphomonoradylglycerols [GP1213]'='LION:0000946',
+ 'monoacylglycerophosphoglycerophosphomonoradylglycerols [GP1207]'='LION:0000947',
+ 'monoalkylglycerophosphoglycerophosphodiradylglycerols [GP1208]'='LION:0000948',
+ 'monoalkylglycerophosphoglycerophosphomonoradylglycerols [GP1209]'='LION:0000949',
+ '1z-alkenylglycerophosphoglycerophosphodiradylglycerols [GP1210]'='LION:0000950',
+ '1z-alkenylglycerophosphoglycerophosphomonoradylglycerols [GP1211]'='LION:0000951'),
+ 'cdp-glycerols [GP13]'='LION:0000022',
+ 'glycosylglycerophospholipids [GP14]'='LION:0000023',
+ 'glycerophosphoinositolglycans [GP15]'='LION:0000024',
+ 'glycerophosphonocholines [GP16]'='LION:0000025',
+ 'glycerophosphonoethanolamines [GP17]'='LION:0000026',
+ 'di-glycerol tetraether phospholipids (caldarchaeols) [GP18]'='LION:0000027',
+ 'glycerol-nonitol tetraether phospholipids [GP19]'='LION:0000028',
+ 'oxidized glycerophospholipids [GP20]'='LION:0000029',
+ 'lysoglycerophospholipids'=
+ list('monoacylglycerophosphocholines [GP0105]'='LION:0000034',
+ 'monoacylglycerophosphoethanolamines [GP0205]'='LION:0000042',
+ 'monoacylglycerophosphoinositols [GP0605]'='LION:0000046',
+ 'monoacylglycerophosphoserines [GP0305]'='LION:0000056',
+ 'monoacylglycerophosphoglycerols [GP0405]'='LION:0000063',
+ 'monoacylglycerophosphates [GP1005]'='LION:0000072')),
+ 'sphingolipids [SP]'=
+ list('other sphingolipids [SP00]'='LION:0000075',
+ 'sphingoid bases [SP01]'='LION:0000076',
+ 'ceramides [SP02]'='LION:0000077',
+ 'phosphosphingolipids [SP03]'=
+ list('ceramide phosphocholines (sphingomyelins) [SP0301]'='LION:0000084',
+ 'ceramide phosphoethanolamines [SP0302]'='LION:0000085',
+ 'ceramide phosphoinositols [SP0303]'='LION:0000086'),
+ 'phosphonosphingolipids [SP04]'='LION:0000079',
+ 'neutral glycosphingolipids [SP05]'=
+ list('other neutral glycosphingolipids [SP0500]'='LION:0000452',
+ 'simple glc series [SP0501]'='LION:0000453',
+ 'galnacbeta1-3galalpha1-4galbeta1-4glc- (globo series) [SP0502]'='LION:0000454',
+ 'galnacbeta1-4galbeta1-4glc- (ganglio series) [SP0503]'='LION:0000455',
+ 'galbeta1-3glcnacbeta1-3galbeta1-4glc- (lacto series) [SP0504]'='LION:0000456',
+ 'galbeta1-4glcnacbeta1-3galbeta1-4glc- (neolacto series) [SP0505]'='LION:0000457',
+ 'galnacbeta1-3galalpha1-3galbeta1-4glc- (isoglobo series) [SP0506]'='LION:0000458',
+ 'glcnacbeta1-2manalpha1-3manbeta1-4glc- (mollu series) [SP0507]'='LION:0000459',
+ 'galnacbeta1-4glcnacbeta1-3manbeta1-4glc- (arthro series) [SP0508]'='LION:0000460',
+ 'gal- (gala series) [SP0509]'='LION:0000461'),
+ 'acidic glycosphingolipids [SP06]'=
+ list('gangliosides [SP0601]'='LION:0000087',
+ 'sulfoglycosphingolipids (sulfatides) [SP0602]'='LION:0000088',
+ 'glucuronosphingolipids [SP0603]'='LION:0000089',
+ 'phosphoglycosphingolipids [SP0604]'='LION:0000090'),
+ 'basic glycosphingolipids [SP07]'='LION:0000082',
+ 'amphoteric glycosphingolipids [SP08]'='LION:0000083'),
+ 'sterol lipids [ST]'=
+ list('other sterol lipids [ST00]'='LION:0000556',
+ 'sterols [ST01]'=
+ list('cholesterol and derivatives [ST0101]'=
+ list('cholesterol'='LION:0000541',
+ 'cholestenone'='LION:0000553',
+ 'oxysterol'='LION:0000600'),
+ 'steryl esters [ST0102]'='LION:0000563',
+ 'ergosterols and c24-methyl derivatives [ST0103]'='LION:0000564',
+ 'stigmasterols and c24-ethyl derivatives [ST0104]'='LION:0000565',
+ 'c24-propyl sterols and derivatives [ST0105]'='LION:0000566',
+ 'gorgosterols and derivatives [ST0106]'='LION:0000567',
+ 'furostanols and derivatives [ST0107]'='LION:0000568',
+ 'spirostanols and derivatives [ST0108]'='LION:0000569',
+ 'furospirostanols and derivatives [ST0109]'='LION:0000570',
+ 'cycloartanols and derivatives [ST0110]'='LION:0000571',
+ 'calysterols and cyclopropyl sidechain derivatives [ST0111]'='LION:0000572',
+ 'cardanolides and derivatives [ST0112]'='LION:0000573',
+ 'bufanolides and derivatives [ST0113]'='LION:0000574',
+ 'brassinolides and derivatives [ST0114]'='LION:0000575',
+ 'solanidines and alkaloid derivatives [ST0115]'='LION:0000576',
+ 'withanolides and derivatives [ST0116]'='LION:0000577'),
+ 'steroids [ST02]'='LION:0000558',
+ 'secosteroids [ST03]'='LION:0000559',
+ 'bile acids and derivatives [ST04]'='LION:0000560',
+ 'steroid conjugates [ST05]'='LION:0000561'),
+ 'prenol lipids [PR]'=
+ list('isoprenoids [PR01]'=
+ list('C5 isoprenoids (hemiterpenes) [PR0101]'='LION:0012013',
+ 'C10 isoprenoids (monoterpenes) [PR0102]'='LION:0012014',
+ 'C15 isoprenoids (sesquiterpenes) [PR0103]'='LION:0012015',
+ 'C20 isoprenoids (diterpenes) [PR0104]'='LION:0012016',
+ 'C25 isoprenoids (sesterterpenes) [PR0105]'='LION:0012019',
+ 'C30 isoprenoids (triterpenes) [PR0106]'='LION:0012020',
+ 'C40 isoprenoids (tetraterpenes) [PR0107]'='LION:0012021',
+ 'polyterpenes [PR0108]'='LION:0012022',
+ 'retinoids [PR0109]'=
+ list('all-trans-retinol'='LION:0012044',
+ '9-cis-retinol'='LION:0012045',
+ '13-cis-retinol'='LION:0012046',
+ 'all-trans-retinal'='LION:0012047',
+ '9-cis-retinal'='LION:0012048',
+ '13-cis-retinal'='LION:0012049',
+ 'all-trans-retinoic acid'='LION:0012050',
+ '9-cis-retinoic acid'='LION:0012054',
+ '13-cis-retinoic acid'='LION:0012055',
+ 'all-trans-retinyl esters'='LION:0012056')),
+ 'quinones and hydroquinones [PR02]'=
+ list('ubiquinones [PR0201]'='LION:0012025',
+ 'vitamin E [PR0202]'='LION:0012026',
+ 'vitamin K [PR0203]'='LION:0012027'),
+ 'polyprenols [PR03]'=
+ list('bactoprenols [PR0301]'='LION:0012029',
+ 'bactoprenol monophosphates [PR0302]'='LION:0012030',
+ 'bactoprenol diphosphates [PR0303]'='LION:0012035',
+ 'phytoprenols [PR0304]'='LION:0012036',
+ 'phytoprenol monophosphates [PR0305]'='LION:0012037',
+ 'phytoprenol diphosphates [PR0306]'='LION:0012038',
+ 'dolichols [PR0307]'='LION:0012039',
+ 'dolichol monophosphates [PR0308]'='LION:0012040',
+ 'dolichol diphosphates [PR0309]'='LION:0012041'),
+ 'hopanoids [PR04]'='LION:0012042',
+ 'other prenol lipids [PR00]'='LION:0012043'),
+ 'saccharolipids [SL]'='LION:0000007',
+ 'polyketides [PK]'='LION:0000008'),
+ 'physical or chemical properties'=
+ list('charge headgroup'=
+ list('headgroup with negative charge'='LION:0000093',
+ 'headgroup with neutral charge'='LION:0000094',
+ 'headgroup with positive charge / zwitter-ion'='LION:0000095'),
+ 'contains fatty acid'=
+ list('C12:0'='LION:0000254',
+ 'C14:0'='LION:0000259',
+ 'C14:1'='LION:0000462',
+ 'C16:0'='LION:0002882',
+ 'C16:1'='LION:0002900',
+ 'C18:0'='LION:0002921',
+ 'C18:1'='LION:0002922',
+ 'C18:2'='LION:0002923',
+ 'C18:3'='LION:0002924',
+ 'C20:0'='LION:0002925',
+ 'C20:1'='LION:0002926',
+ 'C20:2'='LION:0002927',
+ 'C20:3'='LION:0002928',
+ 'C20:4'='LION:0002929',
+ 'C20:5'='LION:0002930',
+ 'C22:0'='LION:0002931',
+ 'C22:1'='LION:0002932',
+ 'C22:2'='LION:0002933',
+ 'C22:3'='LION:0002934',
+ 'C22:4'='LION:0002935',
+ 'C22:5'='LION:0002936',
+ 'C22:6'='LION:0002937',
+ 'C24:0'='LION:0002938',
+ 'C24:1'='LION:0002939',
+ 'C24:2'='LION:0002940',
+ 'C24:3'='LION:0002941',
+ 'C24:4'='LION:0002942',
+ 'C24:5'='LION:0002943',
+ 'C24:6'='LION:0002944',
+ 'C26:0'='LION:0002979',
+ 'C26:1'='LION:0002981',
+ 'C26:2'='LION:0002982',
+ 'C26:3'='LION:0002983',
+ 'C26:4'='LION:0002984',
+ 'C26:5'='LION:0002985',
+ 'C26:6'='LION:0002986',
+ 'C26:7'='LION:0002987',
+ 'd18:1 (sphingosine)'='LION:0080947',
+ 'd18:0 (dihydrosphingosine)'='LION:0080948'),
+ 'type by bond'=
+ list('contains ether-bond'='LION:0000467',
+ 'contains vinyl ether bond (plasmalogen)'='LION:0001734'),
+ 'intrinsic curvature'=
+ list('negative intrinsic curvature'='LION:0000464',
+ 'neutral intrinsic curvature'='LION:0000465',
+ 'positive intrinsic curvature'='LION:0000466'),
+ 'chain-melting transition temperature'=
+ list('average transition temperature'='LION:0001737',
+ 'above average transition temperature'=
+ list('high transition temperature'='LION:0001738',
+ 'very high transition temperature'='LION:0001739'),
+ 'below average transition temperature'=
+ list('very low transition temperature'='LION:0001735',
+ 'low transition temperature'='LION:0001736')),
+ 'fatty acid unsaturation'=
+ list('fatty acid with less than 2 double bonds'=
+ list('saturated fatty acid'='LION:0002968',
+ 'monounsaturated fatty acid'='LION:0002969'),
+ 'polyunsaturated fatty acid'=
+ list('fatty acid with 2 double bonds'='LION:0002970',
+ 'fatty acid with more than 3 double bonds'=
+ list('fatty acid with 3-5 double bonds'=
+ list('fatty acid with 3 double bonds'='LION:0002971',
+ 'fatty acid with 4 double bonds'='LION:0002972',
+ 'fatty acid with 5 double bonds'='LION:0002973')),
+ 'fatty acid with more than 5 double bonds'=
+ list('fatty acid with 6 double bonds'='LION:0002974',
+ 'fatty acid with 7 double bonds'='LION:0002975'))),
+ 'fatty acid chain length'=
+ list('fatty acid with 18 carbons or less'=
+ list('fatty acid with less than 13 carbons'=
+ list('fatty acid with 12 carbons'='LION:0002980'),
+ 'fatty acid with 13-15 carbons'=
+ list('fatty acid with 13 carbons'='LION:0002952',
+ 'fatty acid with 14 carbons'='LION:0002953',
+ 'fatty acid with 15 carbons'='LION:0002954'),
+ 'fatty acid with 16-18 carbons'=
+ list('fatty acid with 16 carbons'='LION:0002955',
+ 'fatty acid with 17 carbons'='LION:0002956',
+ 'fatty acid with 18 carbons'='LION:0002957')),
+ 'fatty acid with more than 18 carbons'=
+ list('fatty acid with 19-21 carbons'=
+ list('fatty acids with 19 carbons'='LION:0002958',
+ 'fatty acid with 20 carbons'='LION:0002959',
+ 'fatty acid with 21 carbons'='LION:0002960'),
+ 'fatty acid with 22-24 carbons'=
+ list('fatty acid with 22 carbons'='LION:0002961',
+ 'fatty acid with 23 carbons'='LION:0002962',
+ 'fatty acid with 24 carbons'='LION:0002963'),
+ 'fatty acid with more than 24 carbons'=
+ list('fatty acid with 25 carbons'='LION:0002964',
+ 'fatty acid with 26 carbons'='LION:0002965'))),
+ 'lateral diffusion'=
+ list('average lateral diffusion'='LION:0080978',
+ 'below average lateral diffusion'=
+ list('very low lateral diffusion'='LION:0080976',
+ 'low lateral diffusion'='LION:0080977'),
+ 'above average lateral diffusion'=
+ list('high lateral diffusion'='LION:0080979',
+ 'very high lateral diffusion'='LION:0080980')),
+ 'bilayer thickness'=
+ list('average bilayer thickness'='LION:0080970',
+ 'below average bilayer thickness'=
+ list('very low bilayer thickness'='LION:0080968',
+ 'low bilayer thickness'='LION:0080969'),
+ 'above average bilayer thickness'=
+ list('high bilayer thickness'='LION:0080971',
+ 'very high bilayer thickness'='LION:0080972'))))
+
+
+LIONstructure <-
+ rapply(LIONstructure, function(element){
+ newelement <- element
+ attr(newelement, 'stselected') <- FALSE
+ newelement
+ }, how = ""list"")
+
+","R"
+"Lipidomics","martijnmolenaar/LION-web","OntologyApp/data/20190109 LION_tree_structure.R",".R","24698","353","options(stringsAsFactors = FALSE)
+
+LIONstructure <-
+ list('cellular component'=list('nucleus'='LION:0012079',
+ 'endoplasmic reticulum (ER)'='LION:0012080',
+ 'mitochondrion'='LION:0012081',
+ 'plasma membrane'='LION:0012082',
+ 'chloroplast'='LION:0012083',
+ 'lipid droplet'='LION:0012084',
+ 'golgi apparatus'='LION:0012085',
+ 'endosome/lysosome'='LION:0012086',
+ 'peroxisome'='LION:0012087'),
+ 'function'=
+ list('lipid-mediated signalling'='LION:0012009',
+ 'membrane component'='LION:0012010',
+ 'lipid storage'='LION:0012011'),
+ 'lipid classification'=
+ list('fatty acids [FA]'=
+ list('fatty acids and conjugates [FA01]'='LION:0001742',
+ 'eicosanoids [FA03]'=
+ list('prostaglandins [FA0301]'='LION:0014870',
+ 'leukotrienes [FA0302]'='LION:0014871',
+ 'thromboxanes [FA0303]'='LION:0014872')),
+ 'glycerolipids [GL]'=
+ list('other glycerolipids [GL00]'='LION:0000601',
+ 'monoradylglycerols [GL01]'=
+ list('monoacylglycerols [GL0101]'='LION:0000619',
+ 'monoalkylglycerols [GL0102]'='LION:0000620',
+ 'mono-(1z-alkenyl)-glycerols [GL0103]'='LION:0000621'),
+ 'diradylglycerols [GL02]'=
+ list('diacylglycerols [GL0201]'='LION:0000607',
+ '1-alkyl,2-acylglycerols [GL0202]'='LION:0000608',
+ '1-acyl,2-alkylglycerols [GL0207]'='LION:0000609',
+ 'dialkylglycerols [GL0203]'='LION:0000610',
+ '1z-alkenylacylglycerols [GL0204]'='LION:0000611',
+ 'di-glycerol tetraethers [GL0205]'='LION:0000612',
+ 'di-glycerol tetraether glycans [GL0206]'='LION:0000613'),
+ 'triradylglycerols [GL03]'=
+ list('triacylglycerols [GL0301]'='LION:0000622',
+ 'alkyldiacylglycerols [GL0302]'='LION:0000623',
+ 'dialkylmonoacylglycerols [GL0303]'='LION:0000624',
+ '1z-alkenyldiacylglycerols [GL0304]'='LION:0000625',
+ 'estolides [GL0305]'='LION:0000626'),
+ 'glycosylmonoradylglycerols [GL04]'=
+ list('glycosylmonoacylglycerols [GL0401]'='LION:0000617',
+ 'glycosylmonoalkylglycerols [GL0402]'='LION:0000618'),
+ 'glycosyldiradylglycerols [GL05]'=
+ list('glycosyldiacylglycerols [GL0501]'='LION:0000614',
+ 'glycosylalkylacylglycerols [GL0502]'='LION:0000615',
+ 'glycosyldialkylglycerols [GL0503]'='LION:0000616')),
+ 'glycerophospholipids [GP]'=
+ list('other glycerophospholipids [GP00]'='LION:0000009',
+ 'glycerophosphocholines [GP01]'=
+ list('diacylglycerophosphocholines [GP0101]'='LION:0000030',
+ '1-alkyl,2-acylglycerophosphocholines [GP0102]'='LION:0000031',
+ '1-(1z-alkenyl),2-acylglycerophosphocholines [GP0103]'='LION:0000032',
+ 'dialkylglycerophosphocholines [GP0104]'='LION:0000033',
+ 'monoacylglycerophosphocholines [GP0105]'='LION:0000034',
+ 'monoalkylglycerophosphocholines [GP0106]'='LION:0000035',
+ '1z-alkenylglycerophosphocholines [GP0107]'='LION:0000036',
+ '1-acyl,2-alkylglycerophosphocholines [GP0108]'='LION:0000037'),
+ 'glycerophosphoethanolamines [GP02]'=
+ list('diacylglycerophosphoethanolamines [GP0201]'='LION:0000038',
+ '1-alkyl,2-acylglycerophosphoethanolamines [GP0202]'='LION:0000039',
+ '1-(1z-alkenyl),2-acylglycerophosphoethanolamines [GP0203]'='LION:0000040',
+ 'dialkylglycerophosphoethanolamines [GP0204]'='LION:0000041',
+ 'monoacylglycerophosphoethanolamines [GP0205]'='LION:0000042',
+ 'monoalkylglycerophosphoethanolamines [GP0206]'='LION:0000043',
+ '1z-alkenylglycerophosphoethanolamines [GP0207]'='LION:0000044',
+ '1-acyl,2-alkylglycerophosphoethanolamines [GP0208]'='LION:0000045'),
+ 'glycerophosphoinositols [GP06]'=
+ list('monoacylglycerophosphoinositols [GP0605]'='LION:0000046',
+ 'diacylglycerophosphoinositols [GP0601]'='LION:0000047',
+ '1-alkyl,2-acylglycerophosphoinositols [GP0602]'='LION:0000048',
+ '1-(1z-alkenyl),2-acylglycerophosphoinositols [GP0603]'='LION:0000049',
+ 'dialkylglycerophosphoinositols [GP0604]'='LION:0000050',
+ 'monoalkylglycerophosphoinositols [GP0606]'='LION:0000051',
+ '1z-alkenylglycerophosphoinositols [GP0607]'='LION:0000052'),
+ 'glycerophosphoserines [GP03]'=
+ list('diacylglycerophosphoserines [GP0301]'='LION:0000053',
+ '1-alkyl,2-acylglycerophosphoserines [GP0302]'='LION:0000054',
+ '1-(1z-alkenyl),2-acylglycerophosphoserines [GP0303]'='LION:0000055',
+ 'monoacylglycerophosphoserines [GP0305]'='LION:0000056',
+ 'monoalkylglycerophosphoserines [GP0306]'='LION:0000057',
+ '1z-alkenylglycerophosphoserines [GP0307]'='LION:0000058'),
+ 'glycerophosphoglycerols [GP04]'=
+ list('diacylglycerophosphoglycerols [GP0401]'='LION:0000059',
+ '1-alkyl,2-acylglycerophosphoglycerols [GP0402]'='LION:0000060',
+ '1-(1z-alkenyl),2-acylglycerophosphoglycerols [GP0403]'='LION:0000061',
+ 'dialkylglycerophosphoglycerols [GP0404]'='LION:0000062',
+ 'monoacylglycerophosphoglycerols [GP0405]'='LION:0000063',
+ 'monoalkylglycerophosphoglycerols [GP0406]'='LION:0000064',
+ '1z-alkenylglycerophosphoglycerols [GP0407]'='LION:0000065',
+ 'diacylglycerophosphomonoradylglycerols [GP0409]'='LION:0000066',
+ 'monoacylglycerophosphomonoradylglycerols [GP0410]'='LION:0000067',
+ '1-acyl,2-alkylglycerophosphoglycerols [GP0411]'='LION:0000068'),
+ 'glycerophosphoglycerophosphates [GP05]'='LION:0000015',
+ 'glycerophosphoinositol monophosphates [GP07]'='LION:0000016',
+ 'glycerophosphoinositol bisphosphates [GP08]'='LION:0000017',
+ 'glycerophosphoinositol trisphosphates [GP09]'='LION:0000018',
+ 'glycerophosphates [GP10]'=
+ list('diacylglycerophosphates [GP1001]'='LION:0000069',
+ '1-alkyl,2-acylglycerophosphates [GP1002]'='LION:0000070',
+ '1-(1z-alkenyl),2-acylglycerophosphates [GP1003]'='LION:0000071',
+ 'monoacylglycerophosphates [GP1005]'='LION:0000072',
+ 'monoalkylglycerophosphates [GP1006]'='LION:0000073',
+ '1z-alkenylglycerophosphates [GP1007]'='LION:0000074'),
+ 'glyceropyrophosphates [GP11]'='LION:0000020',
+ 'glycerophosphoglycerophosphoglycerols [GP12]'=
+ list('diacylglycerophosphoglycerophosphodiradylglycerols [GP1201]'='LION:0000728',
+ 'diacylglycerophosphoglycerophosphomonoradylglycerols [GP1202]'='LION:0000940',
+ '1-alkyl,2-acylglycerophosphoglycerophosphodiradylglycerols [GP1203]'='LION:0000941',
+ '1-alkyl,2-acylglycerophosphoglycerophosphomonoradylglycerols [GP1204]'='LION:0000942',
+ '1-(1z-alkenyl),2-acylglycerophosphoglycerophosphodiradylglycerols [GP1205]'='LION:0000943',
+ '1-(1z-alkenyl),2-acylglycerophosphoglycerophosphomonoradylglycerols [GP1206]'='LION:0000944',
+ 'dialkylglycerophosphoglycerophosphodiradylglycerols [GP1212]'='LION:0000945',
+ 'dialkylglycerophosphoglycerophosphomonoradylglycerols [GP1213]'='LION:0000946',
+ 'monoacylglycerophosphoglycerophosphomonoradylglycerols [GP1207]'='LION:0000947',
+ 'monoalkylglycerophosphoglycerophosphodiradylglycerols [GP1208]'='LION:0000948',
+ 'monoalkylglycerophosphoglycerophosphomonoradylglycerols [GP1209]'='LION:0000949',
+ '1z-alkenylglycerophosphoglycerophosphodiradylglycerols [GP1210]'='LION:0000950',
+ '1z-alkenylglycerophosphoglycerophosphomonoradylglycerols [GP1211]'='LION:0000951'),
+ 'cdp-glycerols [GP13]'='LION:0000022',
+ 'glycosylglycerophospholipids [GP14]'='LION:0000023',
+ 'glycerophosphoinositolglycans [GP15]'='LION:0000024',
+ 'glycerophosphonocholines [GP16]'='LION:0000025',
+ 'glycerophosphonoethanolamines [GP17]'='LION:0000026',
+ 'di-glycerol tetraether phospholipids (caldarchaeols) [GP18]'='LION:0000027',
+ 'glycerol-nonitol tetraether phospholipids [GP19]'='LION:0000028',
+ 'oxidized glycerophospholipids [GP20]'='LION:0000029',
+ 'lysoglycerophospholipids'=
+ list('monoacylglycerophosphocholines [GP0105]'='LION:0000034',
+ 'monoacylglycerophosphoethanolamines [GP0205]'='LION:0000042',
+ 'monoacylglycerophosphoinositols [GP0605]'='LION:0000046',
+ 'monoacylglycerophosphoserines [GP0305]'='LION:0000056',
+ 'monoacylglycerophosphoglycerols [GP0405]'='LION:0000063',
+ 'monoacylglycerophosphates [GP1005]'='LION:0000072')),
+ 'sphingolipids [SP]'=
+ list('other sphingolipids [SP00]'='LION:0000075',
+ 'sphingoid bases [SP01]'='LION:0000076',
+ 'ceramides [SP02]'='LION:0000077',
+ 'phosphosphingolipids [SP03]'=
+ list('ceramide phosphocholines (sphingomyelins) [SP0301]'='LION:0000084',
+ 'ceramide phosphoethanolamines [SP0302]'='LION:0000085',
+ 'ceramide phosphoinositols [SP0303]'='LION:0000086'),
+ 'phosphonosphingolipids [SP04]'='LION:0000079',
+ 'neutral glycosphingolipids [SP05]'=
+ list('other neutral glycosphingolipids [SP0500]'='LION:0000452',
+ 'simple glc series [SP0501]'='LION:0000453',
+ 'galnacbeta1-3galalpha1-4galbeta1-4glc- (globo series) [SP0502]'='LION:0000454',
+ 'galnacbeta1-4galbeta1-4glc- (ganglio series) [SP0503]'='LION:0000455',
+ 'galbeta1-3glcnacbeta1-3galbeta1-4glc- (lacto series) [SP0504]'='LION:0000456',
+ 'galbeta1-4glcnacbeta1-3galbeta1-4glc- (neolacto series) [SP0505]'='LION:0000457',
+ 'galnacbeta1-3galalpha1-3galbeta1-4glc- (isoglobo series) [SP0506]'='LION:0000458',
+ 'glcnacbeta1-2manalpha1-3manbeta1-4glc- (mollu series) [SP0507]'='LION:0000459',
+ 'galnacbeta1-4glcnacbeta1-3manbeta1-4glc- (arthro series) [SP0508]'='LION:0000460',
+ 'gal- (gala series) [SP0509]'='LION:0000461'),
+ 'acidic glycosphingolipids [SP06]'=
+ list('gangliosides [SP0601]'='LION:0000087',
+ 'sulfoglycosphingolipids (sulfatides) [SP0602]'='LION:0000088',
+ 'glucuronosphingolipids [SP0603]'='LION:0000089',
+ 'phosphoglycosphingolipids [SP0604]'='LION:0000090'),
+ 'basic glycosphingolipids [SP07]'='LION:0000082',
+ 'amphoteric glycosphingolipids [SP08]'='LION:0000083'),
+ 'sterol lipids [ST]'=
+ list('other sterol lipids [ST00]'='LION:0000556',
+ 'sterols [ST01]'=
+ list('cholesterol and derivatives [ST0101]'=
+ list('cholesterol'='LION:0000541',
+ 'cholestenone'='LION:0000553',
+ 'oxysterol'='LION:0000600'),
+ 'steryl esters [ST0102]'='LION:0000563',
+ 'ergosterols and c24-methyl derivatives [ST0103]'='LION:0000564',
+ 'stigmasterols and c24-ethyl derivatives [ST0104]'='LION:0000565',
+ 'c24-propyl sterols and derivatives [ST0105]'='LION:0000566',
+ 'gorgosterols and derivatives [ST0106]'='LION:0000567',
+ 'furostanols and derivatives [ST0107]'='LION:0000568',
+ 'spirostanols and derivatives [ST0108]'='LION:0000569',
+ 'furospirostanols and derivatives [ST0109]'='LION:0000570',
+ 'cycloartanols and derivatives [ST0110]'='LION:0000571',
+ 'calysterols and cyclopropyl sidechain derivatives [ST0111]'='LION:0000572',
+ 'cardanolides and derivatives [ST0112]'='LION:0000573',
+ 'bufanolides and derivatives [ST0113]'='LION:0000574',
+ 'brassinolides and derivatives [ST0114]'='LION:0000575',
+ 'solanidines and alkaloid derivatives [ST0115]'='LION:0000576',
+ 'withanolides and derivatives [ST0116]'='LION:0000577'),
+ 'steroids [ST02]'='LION:0000558',
+ 'secosteroids [ST03]'='LION:0000559',
+ 'bile acids and derivatives [ST04]'='LION:0000560',
+ 'steroid conjugates [ST05]'='LION:0000561'),
+ 'prenol lipids [PR]'=
+ list('isoprenoids [PR01]'=
+ list('C5 isoprenoids (hemiterpenes) [PR0101]'='LION:0012013',
+ 'C10 isoprenoids (monoterpenes) [PR0102]'='LION:0012014',
+ 'C15 isoprenoids (sesquiterpenes) [PR0103]'='LION:0012015',
+ 'C20 isoprenoids (diterpenes) [PR0104]'='LION:0012016',
+ 'C25 isoprenoids (sesterterpenes) [PR0105]'='LION:0012019',
+ 'C30 isoprenoids (triterpenes) [PR0106]'='LION:0012020',
+ 'C40 isoprenoids (tetraterpenes) [PR0107]'='LION:0012021',
+ 'polyterpenes [PR0108]'='LION:0012022',
+ 'retinoids [PR0109]'=
+ list('all-trans-retinol'='LION:0012044',
+ '9-cis-retinol'='LION:0012045',
+ '13-cis-retinol'='LION:0012046',
+ 'all-trans-retinal'='LION:0012047',
+ '9-cis-retinal'='LION:0012048',
+ '13-cis-retinal'='LION:0012049',
+ 'all-trans-retinoic acid'='LION:0012050',
+ '9-cis-retinoic acid'='LION:0012054',
+ '13-cis-retinoic acid'='LION:0012055',
+ 'all-trans-retinyl esters'='LION:0012056')),
+ 'quinones and hydroquinones [PR02]'=
+ list('ubiquinones [PR0201]'='LION:0012025',
+ 'vitamin E [PR0202]'='LION:0012026',
+ 'vitamin K [PR0203]'='LION:0012027'),
+ 'polyprenols [PR03]'=
+ list('bactoprenols [PR0301]'='LION:0012029',
+ 'bactoprenol monophosphates [PR0302]'='LION:0012030',
+ 'bactoprenol diphosphates [PR0303]'='LION:0012035',
+ 'phytoprenols [PR0304]'='LION:0012036',
+ 'phytoprenol monophosphates [PR0305]'='LION:0012037',
+ 'phytoprenol diphosphates [PR0306]'='LION:0012038',
+ 'dolichols [PR0307]'='LION:0012039',
+ 'dolichol monophosphates [PR0308]'='LION:0012040',
+ 'dolichol diphosphates [PR0309]'='LION:0012041'),
+ 'hopanoids [PR04]'='LION:0012042',
+ 'other prenol lipids [PR00]'='LION:0012043'),
+ 'saccharolipids [SL]'='LION:0000007',
+ 'polyketides [PK]'='LION:0000008'),
+ 'physical or chemical properties'=
+ list('charge headgroup'=
+ list('headgroup with negative charge'='LION:0000093',
+ 'headgroup with neutral charge'='LION:0000094',
+ 'headgroup with positive charge / zwitter-ion'='LION:0000095'),
+ 'contains fatty acid'=
+ list('C12:0'='LION:0000254',
+ 'C14:0'='LION:0000259',
+ 'C14:1'='LION:0000462',
+ 'C16:0'='LION:0002882',
+ 'C16:1'='LION:0002900',
+ 'C18:0'='LION:0002921',
+ 'C18:1'='LION:0002922',
+ 'C18:2'='LION:0002923',
+ 'C18:3'='LION:0002924',
+ 'C20:0'='LION:0002925',
+ 'C20:1'='LION:0002926',
+ 'C20:2'='LION:0002927',
+ 'C20:3'='LION:0002928',
+ 'C20:4'='LION:0002929',
+ 'C20:5'='LION:0002930',
+ 'C22:0'='LION:0002931',
+ 'C22:1'='LION:0002932',
+ 'C22:2'='LION:0002933',
+ 'C22:3'='LION:0002934',
+ 'C22:4'='LION:0002935',
+ 'C22:5'='LION:0002936',
+ 'C22:6'='LION:0002937',
+ 'C24:0'='LION:0002938',
+ 'C24:1'='LION:0002939',
+ 'C24:2'='LION:0002940',
+ 'C24:3'='LION:0002941',
+ 'C24:4'='LION:0002942',
+ 'C24:5'='LION:0002943',
+ 'C24:6'='LION:0002944',
+ 'C26:0'='LION:0002979',
+ 'C26:1'='LION:0002981',
+ 'C26:2'='LION:0002982',
+ 'C26:3'='LION:0002983',
+ 'C26:4'='LION:0002984',
+ 'C26:5'='LION:0002985',
+ 'C26:6'='LION:0002986',
+ 'C26:7'='LION:0002987',
+ 'd18:1 (sphingosine)'='LION:0080947',
+ 'd18:0 (dihydrosphingosine)'='LION:0080948'),
+ 'type by bond'=
+ list('contains ether-bond'='LION:0000467',
+ 'contains vinyl ether bond (plasmalogen)'='LION:0001734'),
+ 'intrinsic curvature'=
+ list('negative intrinsic curvature'='LION:0000464',
+ 'neutral intrinsic curvature'='LION:0000465',
+ 'positive intrinsic curvature'='LION:0000466'),
+ 'chain-melting transition temperature'=
+ list('average transition temperature'='LION:0001737',
+ 'above average transition temperature'=
+ list('high transition temperature'='LION:0001738',
+ 'very high transition temperature'='LION:0001739'),
+ 'below average transition temperature'=
+ list('very low transition temperature'='LION:0001735',
+ 'low transition temperature'='LION:0001736')),
+ 'fatty acid unsaturation'=
+ list('fatty acid with less than 2 double bonds'=
+ list('fatty acid with 0 double bonds'='LION:0002968',
+ 'fatty acid with 1 double bond'='LION:0002969'),
+ 'fatty acid with 2 or more double bonds'=
+ list('fatty acid with 2 double bonds'='LION:0002970',
+ 'fatty acid with more than 3 double bonds'=
+ list('fatty acid with 3-5 double bonds'=
+ list('fatty acid with 3 double bonds'='LION:0002971',
+ 'fatty acid with 4 double bonds'='LION:0002972',
+ 'fatty acid with 5 double bonds'='LION:0002973')),
+ 'fatty acid with more than 5 double bonds'=
+ list('fatty acid with 6 double bonds'='LION:0002974',
+ 'fatty acid with 7 double bonds'='LION:0002975'))),
+ 'fatty acid chain length'=
+ list('fatty acid with 18 carbons or less'=
+ list('fatty acid with less than 13 carbons'=
+ list('fatty acid with 12 carbons'='LION:0002980'),
+ 'fatty acid with 13-15 carbons'=
+ list('fatty acid with 13 carbons'='LION:0002952',
+ 'fatty acid with 14 carbons'='LION:0002953',
+ 'fatty acid with 15 carbons'='LION:0002954'),
+ 'fatty acid with 16-18 carbons'=
+ list('fatty acid with 16 carbons'='LION:0002955',
+ 'fatty acid with 17 carbons'='LION:0002956',
+ 'fatty acid with 18 carbons'='LION:0002957')),
+ 'fatty acid with more than 18 carbons'=
+ list('fatty acid with 19-21 carbons'=
+ list('fatty acids with 19 carbons'='LION:0002958',
+ 'fatty acid with 20 carbons'='LION:0002959',
+ 'fatty acid with 21 carbons'='LION:0002960'),
+ 'fatty acid with 22-24 carbons'=
+ list('fatty acid with 22 carbons'='LION:0002961',
+ 'fatty acid with 23 carbons'='LION:0002962',
+ 'fatty acid with 24 carbons'='LION:0002963'),
+ 'fatty acid with more than 24 carbons'=
+ list('fatty acid with 25 carbons'='LION:0002964',
+ 'fatty acid with 26 carbons'='LION:0002965'))),
+ 'lateral diffusion'=
+ list('average lateral diffusion'='LION:0080978',
+ 'below average lateral diffusion'=
+ list('very low lateral diffusion'='LION:0080976',
+ 'low lateral diffusion'='LION:0080977'),
+ 'above average lateral diffusion'=
+ list('high lateral diffusion'='LION:0080979',
+ 'very high lateral diffusion'='LION:0080980')),
+ 'bilayer thickness'=
+ list('average bilayer thickness'='LION:0080970',
+ 'below average bilayer thickness'=
+ list('very low bilayer thickness'='LION:0080968',
+ 'low bilayer thickness'='LION:0080969'),
+ 'above average bilayer thickness'=
+ list('high bilayer thickness'='LION:0080971',
+ 'very high bilayer thickness'='LION:0080972'))))
+
+
+LIONstructure <-
+ rapply(LIONstructure, function(element){
+ newelement <- element
+ attr(newelement, 'stselected') <- FALSE
+ newelement
+ }, how = ""list"")
+
+","R"
+"Lipidomics","martijnmolenaar/LION-web","OntologyApp/data/display_network.R",".R","628","22","### R-script, network visualization
+### LION/web: www.lipidontology.com
+
+### please cite:
+### LION/web: a web-based ontology enrichment tool for lipidomic data analysis.
+### Gigascience. 2019 Jun 1;8(6). pii: giz061. doi: 10.1093/gigascience/giz061.
+### Martijn R. Molenaar, Aike Jeucken, Tsjerk A. Wassenaar, Chris H. A. van de Lest, Jos F. Brouwers, J. Bernd Helms.
+
+
+load(file = 'network.Rdata')
+
+library(igraph)
+
+plot(net, layout = layout,
+ vertex.label.cex=.5,
+ vertex.label.degree = 1.5*pi, edge.arrow.size = .40,
+ vertex.label.color='black')
+
+library(visNetwork)
+
+interactive_network
+","R"
+"Lipidomics","martijnmolenaar/LION-web","OntologyApp/data/20180604 LION_tree_structure.R",".R","24701","353","options(stringsAsFactors = FALSE)
+
+LIONstructure <-
+ list('cellular localization'=list('nucleus'='LION:0012079',
+ 'endoplasmic reticulum (ER)'='LION:0012080',
+ 'mitochondrion'='LION:0012081',
+ 'plasma membrane'='LION:0012082',
+ 'chloroplast'='LION:0012083',
+ 'lipid droplet'='LION:0012084',
+ 'golgi apparatus'='LION:0012085',
+ 'endosome/lysosome'='LION:0012086',
+ 'peroxisome'='LION:0012087'),
+ 'function'=
+ list('lipid-mediated signalling'='LION:0012009',
+ 'membrane component'='LION:0012010',
+ 'lipid storage'='LION:0012011'),
+ 'lipid classification'=
+ list('fatty acids [FA]'=
+ list('fatty acids and conjugates [FA01]'='LION:0001742',
+ 'eicosanoids [FA03]'=
+ list('prostaglandins [FA0301]'='LION:0014870',
+ 'leukotrienes [FA0302]'='LION:0014871',
+ 'thromboxanes [FA0303]'='LION:0014872')),
+ 'glycerolipids [GL]'=
+ list('other glycerolipids [GL00]'='LION:0000601',
+ 'monoradylglycerols [GL01]'=
+ list('monoacylglycerols [GL0101]'='LION:0000619',
+ 'monoalkylglycerols [GL0102]'='LION:0000620',
+ 'mono-(1z-alkenyl)-glycerols [GL0103]'='LION:0000621'),
+ 'diradylglycerols [GL02]'=
+ list('diacylglycerols [GL0201]'='LION:0000607',
+ '1-alkyl,2-acylglycerols [GL0202]'='LION:0000608',
+ '1-acyl,2-alkylglycerols [GL0207]'='LION:0000609',
+ 'dialkylglycerols [GL0203]'='LION:0000610',
+ '1z-alkenylacylglycerols [GL0204]'='LION:0000611',
+ 'di-glycerol tetraethers [GL0205]'='LION:0000612',
+ 'di-glycerol tetraether glycans [GL0206]'='LION:0000613'),
+ 'triradylglycerols [GL03]'=
+ list('triacylglycerols [GL0301]'='LION:0000622',
+ 'alkyldiacylglycerols [GL0302]'='LION:0000623',
+ 'dialkylmonoacylglycerols [GL0303]'='LION:0000624',
+ '1z-alkenyldiacylglycerols [GL0304]'='LION:0000625',
+ 'estolides [GL0305]'='LION:0000626'),
+ 'glycosylmonoradylglycerols [GL04]'=
+ list('glycosylmonoacylglycerols [GL0401]'='LION:0000617',
+ 'glycosylmonoalkylglycerols [GL0402]'='LION:0000618'),
+ 'glycosyldiradylglycerols [GL05]'=
+ list('glycosyldiacylglycerols [GL0501]'='LION:0000614',
+ 'glycosylalkylacylglycerols [GL0502]'='LION:0000615',
+ 'glycosyldialkylglycerols [GL0503]'='LION:0000616')),
+ 'glycerophospholipids [GP]'=
+ list('other glycerophospholipids [GP00]'='LION:0000009',
+ 'glycerophosphocholines [GP01]'=
+ list('diacylglycerophosphocholines [GP0101]'='LION:0000030',
+ '1-alkyl,2-acylglycerophosphocholines [GP0102]'='LION:0000031',
+ '1-(1z-alkenyl),2-acylglycerophosphocholines [GP0103]'='LION:0000032',
+ 'dialkylglycerophosphocholines [GP0104]'='LION:0000033',
+ 'monoacylglycerophosphocholines [GP0105]'='LION:0000034',
+ 'monoalkylglycerophosphocholines [GP0106]'='LION:0000035',
+ '1z-alkenylglycerophosphocholines [GP0107]'='LION:0000036',
+ '1-acyl,2-alkylglycerophosphocholines [GP0108]'='LION:0000037'),
+ 'glycerophosphoethanolamines [GP02]'=
+ list('diacylglycerophosphoethanolamines [GP0201]'='LION:0000038',
+ '1-alkyl,2-acylglycerophosphoethanolamines [GP0202]'='LION:0000039',
+ '1-(1z-alkenyl),2-acylglycerophosphoethanolamines [GP0203]'='LION:0000040',
+ 'dialkylglycerophosphoethanolamines [GP0204]'='LION:0000041',
+ 'monoacylglycerophosphoethanolamines [GP0205]'='LION:0000042',
+ 'monoalkylglycerophosphoethanolamines [GP0206]'='LION:0000043',
+ '1z-alkenylglycerophosphoethanolamines [GP0207]'='LION:0000044',
+ '1-acyl,2-alkylglycerophosphoethanolamines [GP0208]'='LION:0000045'),
+ 'glycerophosphoinositols [GP06]'=
+ list('monoacylglycerophosphoinositols [GP0605]'='LION:0000046',
+ 'diacylglycerophosphoinositols [GP0601]'='LION:0000047',
+ '1-alkyl,2-acylglycerophosphoinositols [GP0602]'='LION:0000048',
+ '1-(1z-alkenyl),2-acylglycerophosphoinositols [GP0603]'='LION:0000049',
+ 'dialkylglycerophosphoinositols [GP0604]'='LION:0000050',
+ 'monoalkylglycerophosphoinositols [GP0606]'='LION:0000051',
+ '1z-alkenylglycerophosphoinositols [GP0607]'='LION:0000052'),
+ 'glycerophosphoserines [GP03]'=
+ list('diacylglycerophosphoserines [GP0301]'='LION:0000053',
+ '1-alkyl,2-acylglycerophosphoserines [GP0302]'='LION:0000054',
+ '1-(1z-alkenyl),2-acylglycerophosphoserines [GP0303]'='LION:0000055',
+ 'monoacylglycerophosphoserines [GP0305]'='LION:0000056',
+ 'monoalkylglycerophosphoserines [GP0306]'='LION:0000057',
+ '1z-alkenylglycerophosphoserines [GP0307]'='LION:0000058'),
+ 'glycerophosphoglycerols [GP04]'=
+ list('diacylglycerophosphoglycerols [GP0401]'='LION:0000059',
+ '1-alkyl,2-acylglycerophosphoglycerols [GP0402]'='LION:0000060',
+ '1-(1z-alkenyl),2-acylglycerophosphoglycerols [GP0403]'='LION:0000061',
+ 'dialkylglycerophosphoglycerols [GP0404]'='LION:0000062',
+ 'monoacylglycerophosphoglycerols [GP0405]'='LION:0000063',
+ 'monoalkylglycerophosphoglycerols [GP0406]'='LION:0000064',
+ '1z-alkenylglycerophosphoglycerols [GP0407]'='LION:0000065',
+ 'diacylglycerophosphomonoradylglycerols [GP0409]'='LION:0000066',
+ 'monoacylglycerophosphomonoradylglycerols [GP0410]'='LION:0000067',
+ '1-acyl,2-alkylglycerophosphoglycerols [GP0411]'='LION:0000068'),
+ 'glycerophosphoglycerophosphates [GP05]'='LION:0000015',
+ 'glycerophosphoinositol monophosphates [GP07]'='LION:0000016',
+ 'glycerophosphoinositol bisphosphates [GP08]'='LION:0000017',
+ 'glycerophosphoinositol trisphosphates [GP09]'='LION:0000018',
+ 'glycerophosphates [GP10]'=
+ list('diacylglycerophosphates [GP1001]'='LION:0000069',
+ '1-alkyl,2-acylglycerophosphates [GP1002]'='LION:0000070',
+ '1-(1z-alkenyl),2-acylglycerophosphates [GP1003]'='LION:0000071',
+ 'monoacylglycerophosphates [GP1005]'='LION:0000072',
+ 'monoalkylglycerophosphates [GP1006]'='LION:0000073',
+ '1z-alkenylglycerophosphates [GP1007]'='LION:0000074'),
+ 'glyceropyrophosphates [GP11]'='LION:0000020',
+ 'glycerophosphoglycerophosphoglycerols [GP12]'=
+ list('diacylglycerophosphoglycerophosphodiradylglycerols [GP1201]'='LION:0000728',
+ 'diacylglycerophosphoglycerophosphomonoradylglycerols [GP1202]'='LION:0000940',
+ '1-alkyl,2-acylglycerophosphoglycerophosphodiradylglycerols [GP1203]'='LION:0000941',
+ '1-alkyl,2-acylglycerophosphoglycerophosphomonoradylglycerols [GP1204]'='LION:0000942',
+ '1-(1z-alkenyl),2-acylglycerophosphoglycerophosphodiradylglycerols [GP1205]'='LION:0000943',
+ '1-(1z-alkenyl),2-acylglycerophosphoglycerophosphomonoradylglycerols [GP1206]'='LION:0000944',
+ 'dialkylglycerophosphoglycerophosphodiradylglycerols [GP1212]'='LION:0000945',
+ 'dialkylglycerophosphoglycerophosphomonoradylglycerols [GP1213]'='LION:0000946',
+ 'monoacylglycerophosphoglycerophosphomonoradylglycerols [GP1207]'='LION:0000947',
+ 'monoalkylglycerophosphoglycerophosphodiradylglycerols [GP1208]'='LION:0000948',
+ 'monoalkylglycerophosphoglycerophosphomonoradylglycerols [GP1209]'='LION:0000949',
+ '1z-alkenylglycerophosphoglycerophosphodiradylglycerols [GP1210]'='LION:0000950',
+ '1z-alkenylglycerophosphoglycerophosphomonoradylglycerols [GP1211]'='LION:0000951'),
+ 'cdp-glycerols [GP13]'='LION:0000022',
+ 'glycosylglycerophospholipids [GP14]'='LION:0000023',
+ 'glycerophosphoinositolglycans [GP15]'='LION:0000024',
+ 'glycerophosphonocholines [GP16]'='LION:0000025',
+ 'glycerophosphonoethanolamines [GP17]'='LION:0000026',
+ 'di-glycerol tetraether phospholipids (caldarchaeols) [GP18]'='LION:0000027',
+ 'glycerol-nonitol tetraether phospholipids [GP19]'='LION:0000028',
+ 'oxidized glycerophospholipids [GP20]'='LION:0000029',
+ 'lysoglycerophospholipids'=
+ list('monoacylglycerophosphocholines [GP0105]'='LION:0000034',
+ 'monoacylglycerophosphoethanolamines [GP0205]'='LION:0000042',
+ 'monoacylglycerophosphoinositols [GP0605]'='LION:0000046',
+ 'monoacylglycerophosphoserines [GP0305]'='LION:0000056',
+ 'monoacylglycerophosphoglycerols [GP0405]'='LION:0000063',
+ 'monoacylglycerophosphates [GP1005]'='LION:0000072')),
+ 'sphingolipids [SP]'=
+ list('other sphingolipids [SP00]'='LION:0000075',
+ 'sphingoid bases [SP01]'='LION:0000076',
+ 'ceramides [SP02]'='LION:0000077',
+ 'phosphosphingolipids [SP03]'=
+ list('ceramide phosphocholines (sphingomyelins) [SP0301]'='LION:0000084',
+ 'ceramide phosphoethanolamines [SP0302]'='LION:0000085',
+ 'ceramide phosphoinositols [SP0303]'='LION:0000086'),
+ 'phosphonosphingolipids [SP04]'='LION:0000079',
+ 'neutral glycosphingolipids [SP05]'=
+ list('other neutral glycosphingolipids [SP0500]'='LION:0000452',
+ 'simple glc series [SP0501]'='LION:0000453',
+ 'galnacbeta1-3galalpha1-4galbeta1-4glc- (globo series) [SP0502]'='LION:0000454',
+ 'galnacbeta1-4galbeta1-4glc- (ganglio series) [SP0503]'='LION:0000455',
+ 'galbeta1-3glcnacbeta1-3galbeta1-4glc- (lacto series) [SP0504]'='LION:0000456',
+ 'galbeta1-4glcnacbeta1-3galbeta1-4glc- (neolacto series) [SP0505]'='LION:0000457',
+ 'galnacbeta1-3galalpha1-3galbeta1-4glc- (isoglobo series) [SP0506]'='LION:0000458',
+ 'glcnacbeta1-2manalpha1-3manbeta1-4glc- (mollu series) [SP0507]'='LION:0000459',
+ 'galnacbeta1-4glcnacbeta1-3manbeta1-4glc- (arthro series) [SP0508]'='LION:0000460',
+ 'gal- (gala series) [SP0509]'='LION:0000461'),
+ 'acidic glycosphingolipids [SP06]'=
+ list('gangliosides [SP0601]'='LION:0000087',
+ 'sulfoglycosphingolipids (sulfatides) [SP0602]'='LION:0000088',
+ 'glucuronosphingolipids [SP0603]'='LION:0000089',
+ 'phosphoglycosphingolipids [SP0604]'='LION:0000090'),
+ 'basic glycosphingolipids [SP07]'='LION:0000082',
+ 'amphoteric glycosphingolipids [SP08]'='LION:0000083'),
+ 'sterol lipids [ST]'=
+ list('other sterol lipids [ST00]'='LION:0000556',
+ 'sterols [ST01]'=
+ list('cholesterol and derivatives [ST0101]'=
+ list('cholesterol'='LION:0000541',
+ 'cholestenone'='LION:0000553',
+ 'oxysterol'='LION:0000600'),
+ 'steryl esters [ST0102]'='LION:0000563',
+ 'ergosterols and c24-methyl derivatives [ST0103]'='LION:0000564',
+ 'stigmasterols and c24-ethyl derivatives [ST0104]'='LION:0000565',
+ 'c24-propyl sterols and derivatives [ST0105]'='LION:0000566',
+ 'gorgosterols and derivatives [ST0106]'='LION:0000567',
+ 'furostanols and derivatives [ST0107]'='LION:0000568',
+ 'spirostanols and derivatives [ST0108]'='LION:0000569',
+ 'furospirostanols and derivatives [ST0109]'='LION:0000570',
+ 'cycloartanols and derivatives [ST0110]'='LION:0000571',
+ 'calysterols and cyclopropyl sidechain derivatives [ST0111]'='LION:0000572',
+ 'cardanolides and derivatives [ST0112]'='LION:0000573',
+ 'bufanolides and derivatives [ST0113]'='LION:0000574',
+ 'brassinolides and derivatives [ST0114]'='LION:0000575',
+ 'solanidines and alkaloid derivatives [ST0115]'='LION:0000576',
+ 'withanolides and derivatives [ST0116]'='LION:0000577'),
+ 'steroids [ST02]'='LION:0000558',
+ 'secosteroids [ST03]'='LION:0000559',
+ 'bile acids and derivatives [ST04]'='LION:0000560',
+ 'steroid conjugates [ST05]'='LION:0000561'),
+ 'prenol lipids [PR]'=
+ list('isoprenoids [PR01]'=
+ list('C5 isoprenoids (hemiterpenes) [PR0101]'='LION:0012013',
+ 'C10 isoprenoids (monoterpenes) [PR0102]'='LION:0012014',
+ 'C15 isoprenoids (sesquiterpenes) [PR0103]'='LION:0012015',
+ 'C20 isoprenoids (diterpenes) [PR0104]'='LION:0012016',
+ 'C25 isoprenoids (sesterterpenes) [PR0105]'='LION:0012019',
+ 'C30 isoprenoids (triterpenes) [PR0106]'='LION:0012020',
+ 'C40 isoprenoids (tetraterpenes) [PR0107]'='LION:0012021',
+ 'polyterpenes [PR0108]'='LION:0012022',
+ 'retinoids [PR0109]'=
+ list('all-trans-retinol'='LION:0012044',
+ '9-cis-retinol'='LION:0012045',
+ '13-cis-retinol'='LION:0012046',
+ 'all-trans-retinal'='LION:0012047',
+ '9-cis-retinal'='LION:0012048',
+ '13-cis-retinal'='LION:0012049',
+ 'all-trans-retinoic acid'='LION:0012050',
+ '9-cis-retinoic acid'='LION:0012054',
+ '13-cis-retinoic acid'='LION:0012055',
+ 'all-trans-retinyl esters'='LION:0012056')),
+ 'quinones and hydroquinones [PR02]'=
+ list('ubiquinones [PR0201]'='LION:0012025',
+ 'vitamin E [PR0202]'='LION:0012026',
+ 'vitamin K [PR0203]'='LION:0012027'),
+ 'polyprenols [PR03]'=
+ list('bactoprenols [PR0301]'='LION:0012029',
+ 'bactoprenol monophosphates [PR0302]'='LION:0012030',
+ 'bactoprenol diphosphates [PR0303]'='LION:0012035',
+ 'phytoprenols [PR0304]'='LION:0012036',
+ 'phytoprenol monophosphates [PR0305]'='LION:0012037',
+ 'phytoprenol diphosphates [PR0306]'='LION:0012038',
+ 'dolichols [PR0307]'='LION:0012039',
+ 'dolichol monophosphates [PR0308]'='LION:0012040',
+ 'dolichol diphosphates [PR0309]'='LION:0012041'),
+ 'hopanoids [PR04]'='LION:0012042',
+ 'other prenol lipids [PR00]'='LION:0012043'),
+ 'saccharolipids [SL]'='LION:0000007',
+ 'polyketides [PK]'='LION:0000008'),
+ 'physical or chemical properties'=
+ list('charge headgroup'=
+ list('headgroup with negative charge'='LION:0000093',
+ 'headgroup with neutral charge'='LION:0000094',
+ 'headgroup with positive charge / zwitter-ion'='LION:0000095'),
+ 'contains fatty acid'=
+ list('C12:0'='LION:0000254',
+ 'C14:0'='LION:0000259',
+ 'C14:1'='LION:0000462',
+ 'C16:0'='LION:0002882',
+ 'C16:1'='LION:0002900',
+ 'C18:0'='LION:0002921',
+ 'C18:1'='LION:0002922',
+ 'C18:2'='LION:0002923',
+ 'C18:3'='LION:0002924',
+ 'C20:0'='LION:0002925',
+ 'C20:1'='LION:0002926',
+ 'C20:2'='LION:0002927',
+ 'C20:3'='LION:0002928',
+ 'C20:4'='LION:0002929',
+ 'C20:5'='LION:0002930',
+ 'C22:0'='LION:0002931',
+ 'C22:1'='LION:0002932',
+ 'C22:2'='LION:0002933',
+ 'C22:3'='LION:0002934',
+ 'C22:4'='LION:0002935',
+ 'C22:5'='LION:0002936',
+ 'C22:6'='LION:0002937',
+ 'C24:0'='LION:0002938',
+ 'C24:1'='LION:0002939',
+ 'C24:2'='LION:0002940',
+ 'C24:3'='LION:0002941',
+ 'C24:4'='LION:0002942',
+ 'C24:5'='LION:0002943',
+ 'C24:6'='LION:0002944',
+ 'C26:0'='LION:0002979',
+ 'C26:1'='LION:0002981',
+ 'C26:2'='LION:0002982',
+ 'C26:3'='LION:0002983',
+ 'C26:4'='LION:0002984',
+ 'C26:5'='LION:0002985',
+ 'C26:6'='LION:0002986',
+ 'C26:7'='LION:0002987',
+ 'd18:1 (sphingosine)'='LION:0080947',
+ 'd18:0 (dihydrosphingosine)'='LION:0080948'),
+ 'type by bond'=
+ list('contains ether-bond'='LION:0000467',
+ 'contains vinyl ether bond (plasmalogen)'='LION:0001734'),
+ 'intrinsic curvature'=
+ list('negative intrinsic curvature'='LION:0000464',
+ 'neutral intrinsic curvature'='LION:0000465',
+ 'positive intrinsic curvature'='LION:0000466'),
+ 'chain-melting transition temperature'=
+ list('average transition temperature'='LION:0001737',
+ 'above average transition temperature'=
+ list('high transition temperature'='LION:0001738',
+ 'very high transition temperature'='LION:0001739'),
+ 'below average transition temperature'=
+ list('very low transition temperature'='LION:0001735',
+ 'low transition temperature'='LION:0001736')),
+ 'fatty acid unsaturation'=
+ list('fatty acid with less than 2 double bonds'=
+ list('fatty acid with 0 double bonds'='LION:0002968',
+ 'fatty acid with 1 double bond'='LION:0002969'),
+ 'fatty acid with 2 or more double bonds'=
+ list('fatty acid with 2 double bonds'='LION:0002970',
+ 'fatty acid with more than 3 double bonds'=
+ list('fatty acid with 3-5 double bonds'=
+ list('fatty acid with 3 double bonds'='LION:0002971',
+ 'fatty acid with 4 double bonds'='LION:0002972',
+ 'fatty acid with 5 double bonds'='LION:0002973')),
+ 'fatty acid with more than 5 double bonds'=
+ list('fatty acid with 6 double bonds'='LION:0002974',
+ 'fatty acid with 7 double bonds'='LION:0002975'))),
+ 'fatty acid chain length'=
+ list('fatty acid with 18 carbons or less'=
+ list('fatty acid with less than 13 carbons'=
+ list('fatty acid with 12 carbons'='LION:0002980'),
+ 'fatty acid with 13-15 carbons'=
+ list('fatty acid with 13 carbons'='LION:0002952',
+ 'fatty acid with 14 carbons'='LION:0002953',
+ 'fatty acid with 15 carbons'='LION:0002954'),
+ 'fatty acid with 16-18 carbons'=
+ list('fatty acid with 16 carbons'='LION:0002955',
+ 'fatty acid with 17 carbons'='LION:0002956',
+ 'fatty acid with 18 carbons'='LION:0002957')),
+ 'fatty acid with more than 18 carbons'=
+ list('fatty acid with 19-21 carbons'=
+ list('fatty acids with 19 carbons'='LION:0002958',
+ 'fatty acid with 20 carbons'='LION:0002959',
+ 'fatty acid with 21 carbons'='LION:0002960'),
+ 'fatty acid with 22-24 carbons'=
+ list('fatty acid with 22 carbons'='LION:0002961',
+ 'fatty acid with 23 carbons'='LION:0002962',
+ 'fatty acid with 24 carbons'='LION:0002963'),
+ 'fatty acid with more than 24 carbons'=
+ list('fatty acid with 25 carbons'='LION:0002964',
+ 'fatty acid with 26 carbons'='LION:0002965'))),
+ 'lateral diffusion'=
+ list('average lateral diffusion'='LION:0080978',
+ 'below average lateral diffusion'=
+ list('very low lateral diffusion'='LION:0080976',
+ 'low lateral diffusion'='LION:0080977'),
+ 'above average lateral diffusion'=
+ list('high lateral diffusion'='LION:0080979',
+ 'very high lateral diffusion'='LION:0080980')),
+ 'bilayer thickness'=
+ list('average bilayer thickness'='LION:0080970',
+ 'below average bilayer thickness'=
+ list('very low bilayer thickness'='LION:0080968',
+ 'low bilayer thickness'='LION:0080969'),
+ 'above average bilayer thickness'=
+ list('high bilayer thickness'='LION:0080971',
+ 'very high bilayer thickness'='LION:0080972'))))
+
+
+LIONstructure <-
+ rapply(LIONstructure, function(element){
+ newelement <- element
+ attr(newelement, 'stselected') <- FALSE
+ newelement
+ }, how = ""list"")
+
+","R"
+"Lipidomics","martijnmolenaar/LION-web","OntologyApp/data/20180209 LION_tree_structure.R",".R","26222","377","options(stringsAsFactors = FALSE)
+
+LIONstructure <-
+ list('cellular localization'=list('nucleus'='LION:0012079',
+ 'endoplasmic reticulum (ER)'='LION:0012080',
+ 'mitochondrion'='LION:0012081',
+ 'plasma membrane'='LION:0012082',
+ 'chloroplast'='LION:0012083',
+ 'lipid droplet'='LION:0012084',
+ 'golgi apparatus'='LION:0012085',
+ 'endosome/lysosome'='LION:0012086',
+ 'peroxisome'='LION:0012087'),
+ 'function'=
+ list('lipid-mediated signalling'='LION:0012009',
+ 'membrane component'='LION:0012010',
+ 'lipid storage'='LION:0012011'),
+ 'lipid classification'=
+ list('fatty acids [FA]'=
+ list('fatty acids and conjugates [FA01]'='LION:0001742',
+ 'eicosanoids [FA03]'=
+ list('prostaglandins [FA0301]'='LION:0014870',
+ 'leukotrienes [FA0302]'='LION:0014871',
+ 'thromboxanes [FA0303]'='LION:0014872')),
+ 'glycerolipids [GL]'=
+ list('other glycerolipids [GL00]'='LION:0000601',
+ 'monoradylglycerols [GL01]'=
+ list('monoacylglycerols [GL0101]'='LION:0000619',
+ 'monoalkylglycerols [GL0102]'='LION:0000620',
+ 'mono-(1z-alkenyl)-glycerols [GL0103]'='LION:0000621'),
+ 'diradylglycerols [GL02]'=
+ list('diacylglycerols [GL0201]'='LION:0000607',
+ '1-alkyl,2-acylglycerols [GL0202]'='LION:0000608',
+ '1-acyl,2-alkylglycerols [GL0207]'='LION:0000609',
+ 'dialkylglycerols [GL0203]'='LION:0000610',
+ '1z-alkenylacylglycerols [GL0204]'='LION:0000611',
+ 'di-glycerol tetraethers [GL0205]'='LION:0000612',
+ 'di-glycerol tetraether glycans [GL0206]'='LION:0000613'),
+ 'triradylglycerols [GL03]'=
+ list('triacylglycerols [GL0301]'='LION:0000622',
+ 'alkyldiacylglycerols [GL0302]'='LION:0000623',
+ 'dialkylmonoacylglycerols [GL0303]'='LION:0000624',
+ '1z-alkenyldiacylglycerols [GL0304]'='LION:0000625',
+ 'estolides [GL0305]'='LION:0000626'),
+ 'glycosylmonoradylglycerols [GL04]'=
+ list('glycosylmonoacylglycerols [GL0401]'='LION:0000617',
+ 'glycosylmonoalkylglycerols [GL0402]'='LION:0000618'),
+ 'glycosyldiradylglycerols [GL05]'=
+ list('glycosyldiacylglycerols [GL0501]'='LION:0000614',
+ 'glycosylalkylacylglycerols [GL0502]'='LION:0000615',
+ 'glycosyldialkylglycerols [GL0503]'='LION:0000616')),
+ 'glycerophospholipids [GP]'=
+ list('other glycerophospholipids [GP00]'='LION:0000009',
+ 'glycerophosphocholines [GP01]'=
+ list('diacylglycerophosphocholines [GP0101]'='LION:0000030',
+ '1-alkyl,2-acylglycerophosphocholines [GP0102]'='LION:0000031',
+ '1-(1z-alkenyl),2-acylglycerophosphocholines [GP0103]'='LION:0000032',
+ 'dialkylglycerophosphocholines [GP0104]'='LION:0000033',
+ 'monoacylglycerophosphocholines [GP0105]'='LION:0000034',
+ 'monoalkylglycerophosphocholines [GP0106]'='LION:0000035',
+ '1z-alkenylglycerophosphocholines [GP0107]'='LION:0000036',
+ '1-acyl,2-alkylglycerophosphocholines [GP0108]'='LION:0000037'),
+ 'glycerophosphoethanolamines [GP02]'=
+ list('diacylglycerophosphoethanolamines [GP0201]'='LION:0000038',
+ '1-alkyl,2-acylglycerophosphoethanolamines [GP0202]'='LION:0000039',
+ '1-(1z-alkenyl),2-acylglycerophosphoethanolamines [GP0203]'='LION:0000040',
+ 'dialkylglycerophosphoethanolamines [GP0204]'='LION:0000041',
+ 'monoacylglycerophosphoethanolamines [GP0205]'='LION:0000042',
+ 'monoalkylglycerophosphoethanolamines [GP0206]'='LION:0000043',
+ '1z-alkenylglycerophosphoethanolamines [GP0207]'='LION:0000044',
+ '1-acyl,2-alkylglycerophosphoethanolamines [GP0208]'='LION:0000045'),
+ 'glycerophosphoinositols [GP06]'=
+ list('monoacylglycerophosphoinositols [GP0605]'='LION:0000046',
+ 'diacylglycerophosphoinositols [GP0601]'='LION:0000047',
+ '1-alkyl,2-acylglycerophosphoinositols [GP0602]'='LION:0000048',
+ '1-(1z-alkenyl),2-acylglycerophosphoinositols [GP0603]'='LION:0000049',
+ 'dialkylglycerophosphoinositols [GP0604]'='LION:0000050',
+ 'monoalkylglycerophosphoinositols [GP0606]'='LION:0000051',
+ '1z-alkenylglycerophosphoinositols [GP0607]'='LION:0000052'),
+ 'glycerophosphoserines [GP03]'=
+ list('diacylglycerophosphoserines [GP0301]'='LION:0000053',
+ '1-alkyl,2-acylglycerophosphoserines [GP0302]'='LION:0000054',
+ '1-(1z-alkenyl),2-acylglycerophosphoserines [GP0303]'='LION:0000055',
+ 'monoacylglycerophosphoserines [GP0305]'='LION:0000056',
+ 'monoalkylglycerophosphoserines [GP0306]'='LION:0000057',
+ '1z-alkenylglycerophosphoserines [GP0307]'='LION:0000058'),
+ 'glycerophosphoglycerols [GP04]'=
+ list('diacylglycerophosphoglycerols [GP0401]'='LION:0000059',
+ '1-alkyl,2-acylglycerophosphoglycerols [GP0402]'='LION:0000060',
+ '1-(1z-alkenyl),2-acylglycerophosphoglycerols [GP0403]'='LION:0000061',
+ 'dialkylglycerophosphoglycerols [GP0404]'='LION:0000062',
+ 'monoacylglycerophosphoglycerols [GP0405]'='LION:0000063',
+ 'monoalkylglycerophosphoglycerols [GP0406]'='LION:0000064',
+ '1z-alkenylglycerophosphoglycerols [GP0407]'='LION:0000065',
+ 'diacylglycerophosphomonoradylglycerols [GP0409]'='LION:0000066',
+ 'monoacylglycerophosphomonoradylglycerols [GP0410]'='LION:0000067',
+ '1-acyl,2-alkylglycerophosphoglycerols [GP0411]'='LION:0000068'),
+ 'glycerophosphoglycerophosphates [GP05]'='LION:0000015',
+ 'glycerophosphoinositol monophosphates [GP07]'='LION:0000016',
+ 'glycerophosphoinositol bisphosphates [GP08]'='LION:0000017',
+ 'glycerophosphoinositol trisphosphates [GP09]'='LION:0000018',
+ 'glycerophosphates [GP10]'=
+ list('diacylglycerophosphates [GP1001]'='LION:0000069',
+ '1-alkyl,2-acylglycerophosphates [GP1002]'='LION:0000070',
+ '1-(1z-alkenyl),2-acylglycerophosphates [GP1003]'='LION:0000071',
+ 'monoacylglycerophosphates [GP1005]'='LION:0000072',
+ 'monoalkylglycerophosphates [GP1006]'='LION:0000073',
+ '1z-alkenylglycerophosphates [GP1007]'='LION:0000074'),
+ 'glyceropyrophosphates [GP11]'='LION:0000020',
+ 'glycerophosphoglycerophosphoglycerols [GP12]'=
+ list('diacylglycerophosphoglycerophosphodiradylglycerols [GP1201]'='LION:0000728',
+ 'diacylglycerophosphoglycerophosphomonoradylglycerols [GP1202]'='LION:0000940',
+ '1-alkyl,2-acylglycerophosphoglycerophosphodiradylglycerols [GP1203]'='LION:0000941',
+ '1-alkyl,2-acylglycerophosphoglycerophosphomonoradylglycerols [GP1204]'='LION:0000942',
+ '1-(1z-alkenyl),2-acylglycerophosphoglycerophosphodiradylglycerols [GP1205]'='LION:0000943',
+ '1-(1z-alkenyl),2-acylglycerophosphoglycerophosphomonoradylglycerols [GP1206]'='LION:0000944',
+ 'dialkylglycerophosphoglycerophosphodiradylglycerols [GP1212]'='LION:0000945',
+ 'dialkylglycerophosphoglycerophosphomonoradylglycerols [GP1213]'='LION:0000946',
+ 'monoacylglycerophosphoglycerophosphomonoradylglycerols [GP1207]'='LION:0000947',
+ 'monoalkylglycerophosphoglycerophosphodiradylglycerols [GP1208]'='LION:0000948',
+ 'monoalkylglycerophosphoglycerophosphomonoradylglycerols [GP1209]'='LION:0000949',
+ '1z-alkenylglycerophosphoglycerophosphodiradylglycerols [GP1210]'='LION:0000950',
+ '1z-alkenylglycerophosphoglycerophosphomonoradylglycerols [GP1211]'='LION:0000951'),
+ 'cdp-glycerols [GP13]'='LION:0000022',
+ 'glycosylglycerophospholipids [GP14]'='LION:0000023',
+ 'glycerophosphoinositolglycans [GP15]'='LION:0000024',
+ 'glycerophosphonocholines [GP16]'='LION:0000025',
+ 'glycerophosphonoethanolamines [GP17]'='LION:0000026',
+ 'di-glycerol tetraether phospholipids (caldarchaeols) [GP18]'='LION:0000027',
+ 'glycerol-nonitol tetraether phospholipids [GP19]'='LION:0000028',
+ 'oxidized glycerophospholipids [GP20]'='LION:0000029',
+ 'lysoglycerophospholipids'=
+ list('monoacylglycerophosphocholines [GP0105]'='LION:0000034',
+ 'monoacylglycerophosphoethanolamines [GP0205]'='LION:0000042',
+ 'monoacylglycerophosphoinositols [GP0605]'='LION:0000046',
+ 'monoacylglycerophosphoserines [GP0305]'='LION:0000056',
+ 'monoacylglycerophosphoglycerols [GP0405]'='LION:0000063',
+ 'monoacylglycerophosphates [GP1005]'='LION:0000072')),
+ 'sphingolipids [SP]'=
+ list('other sphingolipids [SP00]'='LION:0000075',
+ 'sphingoid bases [SP01]'='LION:0000076',
+ 'ceramides [SP02]'='LION:0000077',
+ 'phosphosphingolipids [SP03]'=
+ list('ceramide phosphocholines (sphingomyelins) [SP0301]'='LION:0000084',
+ 'ceramide phosphoethanolamines [SP0302]'='LION:0000085',
+ 'ceramide phosphoinositols [SP0303]'='LION:0000086'),
+ 'phosphonosphingolipids [SP04]'='LION:0000079',
+ 'neutral glycosphingolipids [SP05]'=
+ list('other neutral glycosphingolipids [SP0500]'='LION:0000452',
+ 'simple glc series [SP0501]'='LION:0000453',
+ 'galnacbeta1-3galalpha1-4galbeta1-4glc- (globo series) [SP0502]'='LION:0000454',
+ 'galnacbeta1-4galbeta1-4glc- (ganglio series) [SP0503]'='LION:0000455',
+ 'galbeta1-3glcnacbeta1-3galbeta1-4glc- (lacto series) [SP0504]'='LION:0000456',
+ 'galbeta1-4glcnacbeta1-3galbeta1-4glc- (neolacto series) [SP0505]'='LION:0000457',
+ 'galnacbeta1-3galalpha1-3galbeta1-4glc- (isoglobo series) [SP0506]'='LION:0000458',
+ 'glcnacbeta1-2manalpha1-3manbeta1-4glc- (mollu series) [SP0507]'='LION:0000459',
+ 'galnacbeta1-4glcnacbeta1-3manbeta1-4glc- (arthro series) [SP0508]'='LION:0000460',
+ 'gal- (gala series) [SP0509]'='LION:0000461'),
+ 'acidic glycosphingolipids [SP06]'=
+ list('gangliosides [SP0601]'='LION:0000087',
+ 'sulfoglycosphingolipids (sulfatides) [SP0602]'='LION:0000088',
+ 'glucuronosphingolipids [SP0603]'='LION:0000089',
+ 'phosphoglycosphingolipids [SP0604]'='LION:0000090'),
+ 'basic glycosphingolipids [SP07]'='LION:0000082',
+ 'amphoteric glycosphingolipids [SP08]'='LION:0000083'),
+ 'sterol lipids [ST]'=
+ list('other sterol lipids [ST00]'='LION:0000556',
+ 'sterols [ST01]'=
+ list('cholesterol and derivatives [ST0101]'=
+ list('cholesterol'='LION:0000541',
+ 'cholestenone'='LION:0000553',
+ 'oxysterol'='LION:0000600'),
+ 'steryl esters [ST0102]'='LION:0000563',
+ 'ergosterols and c24-methyl derivatives [ST0103]'='LION:0000564',
+ 'stigmasterols and c24-ethyl derivatives [ST0104]'='LION:0000565',
+ 'c24-propyl sterols and derivatives [ST0105]'='LION:0000566',
+ 'gorgosterols and derivatives [ST0106]'='LION:0000567',
+ 'furostanols and derivatives [ST0107]'='LION:0000568',
+ 'spirostanols and derivatives [ST0108]'='LION:0000569',
+ 'furospirostanols and derivatives [ST0109]'='LION:0000570',
+ 'cycloartanols and derivatives [ST0110]'='LION:0000571',
+ 'calysterols and cyclopropyl sidechain derivatives [ST0111]'='LION:0000572',
+ 'cardanolides and derivatives [ST0112]'='LION:0000573',
+ 'bufanolides and derivatives [ST0113]'='LION:0000574',
+ 'brassinolides and derivatives [ST0114]'='LION:0000575',
+ 'solanidines and alkaloid derivatives [ST0115]'='LION:0000576',
+ 'withanolides and derivatives [ST0116]'='LION:0000577'),
+ 'steroids [ST02]'='LION:0000558',
+ 'secosteroids [ST03]'='LION:0000559',
+ 'bile acids and derivatives [ST04]'='LION:0000560',
+ 'steroid conjugates [ST05]'='LION:0000561'),
+ 'prenol lipids [PR]'=
+ list('isoprenoids [PR01]'=
+ list('C5 isoprenoids (hemiterpenes) [PR0101]'='LION:0012013',
+ 'C10 isoprenoids (monoterpenes) [PR0102]'='LION:0012014',
+ 'C15 isoprenoids (sesquiterpenes) [PR0103]'='LION:0012015',
+ 'C20 isoprenoids (diterpenes) [PR0104]'='LION:0012016',
+ 'C25 isoprenoids (sesterterpenes) [PR0105]'='LION:0012019',
+ 'C30 isoprenoids (triterpenes) [PR0106]'='LION:0012020',
+ 'C40 isoprenoids (tetraterpenes) [PR0107]'='LION:0012021',
+ 'polyterpenes [PR0108]'='LION:0012022',
+ 'retinoids [PR0109]'=
+ list('all-trans-retinol'='LION:0012044',
+ '9-cis-retinol'='LION:0012045',
+ '13-cis-retinol'='LION:0012046',
+ 'all-trans-retinal'='LION:0012047',
+ '9-cis-retinal'='LION:0012048',
+ '13-cis-retinal'='LION:0012049',
+ 'all-trans-retinoic acid'='LION:0012050',
+ '9-cis-retinoic acid'='LION:0012054',
+ '13-cis-retinoic acid'='LION:0012055',
+ 'all-trans-retinyl esters'='LION:0012056')),
+ 'quinones and hydroquinones [PR02]'=
+ list('ubiquinones [PR0201]'='LION:0012025',
+ 'vitamin E [PR0202]'='LION:0012026',
+ 'vitamin K [PR0203]'='LION:0012027'),
+ 'polyprenols [PR03]'=
+ list('bactoprenols [PR0301]'='LION:0012029',
+ 'bactoprenol monophosphates [PR0302]'='LION:0012030',
+ 'bactoprenol diphosphates [PR0303]'='LION:0012035',
+ 'phytoprenols [PR0304]'='LION:0012036',
+ 'phytoprenol monophosphates [PR0305]'='LION:0012037',
+ 'phytoprenol diphosphates [PR0306]'='LION:0012038',
+ 'dolichols [PR0307]'='LION:0012039',
+ 'dolichol monophosphates [PR0308]'='LION:0012040',
+ 'dolichol diphosphates [PR0309]'='LION:0012041'),
+ 'hopanoids [PR04]'='LION:0012042',
+ 'other prenol lipids [PR00]'='LION:0012043'),
+ 'saccharolipids [SL]'='LION:0000007',
+ 'polyketides [PK]'='LION:0000008'),
+ 'physical or chemical properties'=
+ list('charge headgroup'=
+ list('headgroup with negative charge'='LION:0000093',
+ 'headgroup with neutral charge'='LION:0000094',
+ 'headgroup with positive charge / zwitter-ion'='LION:0000095'),
+ 'contains fatty acid'=
+ list('C12:0'='LION:0000254',
+ 'C14:0'='LION:0000259',
+ 'C14:1'='LION:0000462',
+ 'C16:0'='LION:0002882',
+ 'C16:1'='LION:0002900',
+ 'C18:0'='LION:0002921',
+ 'C18:1'='LION:0002922',
+ 'C18:2'='LION:0002923',
+ 'C18:3'='LION:0002924',
+ 'C20:0'='LION:0002925',
+ 'C20:1'='LION:0002926',
+ 'C20:2'='LION:0002927',
+ 'C20:3'='LION:0002928',
+ 'C20:4'='LION:0002929',
+ 'C20:5'='LION:0002930',
+ 'C22:0'='LION:0002931',
+ 'C22:1'='LION:0002932',
+ 'C22:2'='LION:0002933',
+ 'C22:3'='LION:0002934',
+ 'C22:4'='LION:0002935',
+ 'C22:5'='LION:0002936',
+ 'C22:6'='LION:0002937',
+ 'C24:0'='LION:0002938',
+ 'C24:1'='LION:0002939',
+ 'C24:2'='LION:0002940',
+ 'C24:3'='LION:0002941',
+ 'C24:4'='LION:0002942',
+ 'C24:5'='LION:0002943',
+ 'C24:6'='LION:0002944',
+ 'C26:0'='LION:0002979',
+ 'C26:1'='LION:0002981',
+ 'C26:2'='LION:0002982',
+ 'C26:3'='LION:0002983',
+ 'C26:4'='LION:0002984',
+ 'C26:5'='LION:0002985',
+ 'C26:6'='LION:0002986',
+ 'C26:7'='LION:0002987',
+ 'd18:1 (sphingosine)'='LION:0080947',
+ 'd18:0 (dihydrosphingosine)'='LION:0080948'),
+ 'type by bond'=
+ list('contains ether-bond'='LION:0000467',
+ 'contains vinyl ether bond (plasmalogen)'='LION:0001734'),
+ 'intrinsic curvature'=
+ list('negative intrinsic curvature'='LION:0000464',
+ 'neutral intrinsic curvature'='LION:0000465',
+ 'positve intrinsic curvature'='LION:0000466'),
+ 'chain-melting transition temperature'=
+ list('average transition temperature'='LION:0001737',
+ 'above average transition temperature'=
+ list('high transition temperature'='LION:0001738',
+ 'very high transition temperature'='LION:0001739'),
+ 'below average transition temperature'=
+ list('very low transition temperature'='LION:0001735',
+ 'low transition temperature'='LION:0001736')),
+ 'fatty acid unsaturation'=
+ list('fatty acid with less than 2 double bonds'=
+ list('fatty acid with 0 double bonds'='LION:0002968',
+ 'fatty acid with 1 double bond'='LION:0002969'),
+ 'fatty acid with 2 or more double bonds'=
+ list('fatty acid with 2 double bonds'='LION:0002970',
+ 'fatty acid with more than 3 double bonds'=
+ list('fatty acid with 3-5 double bonds'=
+ list('fatty acid with 3 double bonds'='LION:0002971',
+ 'fatty acid with 4 double bonds'='LION:0002972',
+ 'fatty acid with 5 double bonds'='LION:0002973')),
+ 'fatty acid with more than 5 double bonds'=
+ list('fatty acid with 6 double bonds'='LION:0002974',
+ 'fatty acid with 7 double bonds'='LION:0002975'))),
+ 'fatty acid chain length'=
+ list('fatty acid with 18 carbons or less'=
+ list('fatty acid with less than 13 carbons'=
+ list('fatty acid with 12 carbons'='LION:0002980'),
+ 'fatty acid with 13-15 carbons'=
+ list('fatty acid with 13 carbons'='LION:0002952',
+ 'fatty acid with 14 carbons'='LION:0002953',
+ 'fatty acid with 15 carbons'='LION:0002954'),
+ 'fatty acid with 16-18 carbons'=
+ list('fatty acid with 16 carbons'='LION:0002955',
+ 'fatty acid with 17 carbons'='LION:0002956',
+ 'fatty acid with 18 carbons'='LION:0002957')),
+ 'fatty acid with more than 18 carbons'=
+ list('fatty acid with 19-21 carbons'=
+ list('fatty acids with 19 carbons'='LION:0002958',
+ 'fatty acid with 20 carbons'='LION:0002959',
+ 'fatty acid with 21 carbons'='LION:0002960'),
+ 'fatty acid with 22-24 carbons'=
+ list('fatty acid with 22 carbons'='LION:0002961',
+ 'fatty acid with 23 carbons'='LION:0002962',
+ 'fatty acid with 24 carbons'='LION:0002963'),
+ 'fatty acid with more than 24 carbons'=
+ list('fatty acid with 25 carbons'='LION:0002964',
+ 'fatty acid with 26 carbons'='LION:0002965'))),
+ 'area per lipid'=
+ list('average area per lipid'='LION:0080962',
+ 'below average area per lipid'=
+ list('very low area per lipid'='LION:0080960',
+ 'low area per lipid'='LION:0080961'),
+ 'above average area per lipid'=
+ list('high area per lipid'='LION:0080963',
+ 'very high area per lipid'='LION:0080964')),
+ 'area compressibility'=
+ list('average area compressibility'='LION:0080954',
+ 'below average area compressibility'=
+ list('very low area compressibility'='LION:0080952',
+ 'low area compressibility'='LION:0080953'),
+ 'above average area compressibility'=
+ list('high area compressibility'='LION:0080955',
+ 'very high area compressibility'='LION:0080956')),
+ 'tail order parameter'=
+ list('average tail order parameter'='LION:0080986',
+ 'below average tail order parameter'=
+ list('very low tail order parameter'='LION:0080984',
+ 'low tail order parameter'='LION:0080985'),
+ 'above average tail order parameter'=
+ list('high tail order parameter'='LION:0080987',
+ 'very high tail order parameter'='LION:0080988')),
+ 'lateral diffusion'=
+ list('average lateral diffusion'='LION:0080978',
+ 'below average lateral diffusion'=
+ list('very low lateral diffusion'='LION:0080976',
+ 'low lateral diffusion'='LION:0080977'),
+ 'above average lateral diffusion'=
+ list('high lateral diffusion'='LION:0080979',
+ 'very high lateral diffusion'='LION:0080980')),
+ 'bilayer thickness'=
+ list('average bilayer thickness'='LION:0080970',
+ 'below average bilayer thickness'=
+ list('very low bilayer thickness'='LION:0080968',
+ 'low bilayer thickness'='LION:0080969'),
+ 'above average bilayer thickness'=
+ list('high bilayer thickness'='LION:0080971',
+ 'very high bilayer thickness'='LION:0080972'))))
+
+
+LIONstructure <-
+ rapply(LIONstructure, function(element){
+ newelement <- element
+ attr(newelement, 'stselected') <- FALSE
+ newelement
+ }, how = ""list"")
+
+","R"
+"Lipidomics","martijnmolenaar/LION-web","OntologyApp/data/20191008 LIONweb functions.R",".R","18738","467","convertLipidNames <- function(name){
+
+ options(stringsAsFactors = FALSE)
+
+ sapply(name, function(input) {
+ processed_input <- input
+ if (processed_input==""""){processed_input <- "" ""}
+
+ # remove MWB prefix *
+ processed_input <- gsub(""^\\* "","""",processed_input)
+ # remove MWB suffix _n,{n}
+ processed_input <- gsub(""_\\d{1}$"","""",processed_input)
+ processed_input <- gsub(""\\{\\d{1}\\}$"","""",processed_input)
+
+ #aliases
+ {
+ processed_input <- gsub(""DAG|diacylglycerol"",""DG"",processed_input)
+ processed_input <- gsub(""TAG|triacylglycerol"",""TG"",processed_input)
+
+ processed_input <- gsub(""GPA"",""PA"",processed_input)
+ processed_input <- gsub(""GPEtn|phosphatidylethanolamine|Phosphatidylethanolamine"",""PE"",processed_input)
+ processed_input <- gsub(""GPCho|phosphatidylcholine|Phosphatidylcholine"",""PC"",processed_input)
+ processed_input <- gsub(""GPSer|phosphatidylserine|Phosphatidylserine"",""PS"",processed_input)
+ processed_input <- gsub(""GPIns|phosphatidylinositol|Phosphatidylinositol"",""PI"",processed_input)
+ processed_input <- gsub(""GPGro|phosphatidylglycerol|Phosphatidylglycerol"",""PG"",processed_input)
+
+
+ processed_input <- gsub(""LBPA"",""BMP"",processed_input)
+ processed_input <- gsub(""lyso|Lyso"",""L"",processed_input)
+
+ processed_input <- gsub(""^FA"",""FFA"",processed_input)
+ processed_input <- gsub(""ChE|CholE"",""CE"",processed_input)
+
+ processed_input <- gsub(""\\Q(3'-sulfo)Galβ-Cer\\E|\\Q(3'-sulfo)LacCer\\E|\\Q(3'-sulfo)GalCer\\E|Sulfogalactosyl ceramide[ ]*|[Ss]+(Gal|Hex)Cer|Sulfatide"",
+ ""SHexCer"",processed_input)
+
+
+ processed_input <- gsub(""LacCer"",""Hex2Cer"",processed_input)
+ processed_input <- gsub(""Gl[u]*c[β-]*Cer|Gal[β-]*Cer|GluCer"",""HexCer"",processed_input)
+
+ processed_input <- gsub(""^aPE"",""NAPE"",processed_input)
+
+ } ### end aliases
+
+ ### special cases: 'DG(0:0/18:1/16:0)' >> DG(18:1/16:0)
+ if(grepl('DG',processed_input) & grepl('\\D0:0',processed_input)){
+ processed_input <- gsub('/0:0',"""",processed_input)
+ processed_input <- gsub('\\(0:0/',""("",processed_input)
+
+ }
+
+ ### end special cases
+ if(grepl(""\\d+:\\d+;\\d+"",processed_input) & !grepl(""\\d+:\\d+;\\d+:\\d+"",processed_input)){ ### 32:1;1 format >> 32:1
+
+ FA <- regmatches(processed_input, regexpr(""\\d+:\\d+;\\d+"", processed_input))
+
+ if(grepl("";1\\D|;1$"",processed_input)){
+ FA_new <- paste(""m"",gsub("";\\d+"","""",FA), sep ="""")
+ } else if(grepl("";2\\D|;2$"",processed_input)){
+ FA_new <- paste(""d"",gsub("";\\d+"","""",FA), sep ="""")
+ } else if(grepl("";3\\D|;3$"",processed_input)){
+ FA_new <- paste(""t"",gsub("";\\d+"","""",FA), sep ="""")
+ }
+
+ processed_input <- gsub( paste(""\\Q"",FA,""\\E"",sep = """"),FA_new,processed_input)
+ }
+ if(grepl(""\\d+:\\d+[cΔ]\\d+"",processed_input) & !grepl(""\\d+:\\d+[cΔ]\\d+:\\d+"",processed_input)){ ### 32:1c1 format >> 32:1
+ processed_input <- gsub(""[cΔ]\\d+"","""",processed_input)
+ }
+
+ if(grepl(""\\d+:\\d+:\\d+"",processed_input)){ ### 32:1:1 format >> 32:1
+ parts <- unlist(strsplit(x = paste(""_"",processed_input,""_"",sep=""""), split = ""\\d+:\\d+:\\d+""))
+ specialFAs <- unlist(regmatches(processed_input, gregexpr(""\\d+:\\d+:\\d+"", processed_input)))
+ specialFAs <- unlist(regmatches(processed_input, gregexpr(""\\d+:\\d+"", processed_input)))
+ processed_input[seq(from = 1, to = length(parts)*2, by = 2)] <- parts
+ processed_input[seq(from = 2, to = length(specialFAs)*2, by = 2)] <- specialFAs
+ processed_input <- gsub(""^_|_$"","""",paste(processed_input, collapse = """"))
+
+ }
+
+ ### >> remove (FA 16:0), not intensively tested
+ processed_input <- gsub(""\\(FA( )*"", ""("",processed_input)
+
+ ### 'CL(32:0)(34:1)' or 'TAG 32:0(FA 16:0)' >> sum FAs between (), not intensively tested
+ FAs <- unlist(regmatches(processed_input, gregexpr(""\\d+:\\d+"", processed_input)))
+ if(length(FAs)>0){
+ FAs <- FAs[sapply(regmatches(FAs, gregexpr(""\\d+"", FAs)), function(i){ as.numeric(i)[1] >= as.numeric(i)[2] })] ## C should be higher than DB
+ }
+ if((grepl(""CL"", processed_input ) & (length(FAs) == 2 | length(FAs) == 3)) |
+ (grepl(""TAG|TG"", processed_input ) & (length(FAs) == 2))) {
+ parts <- unlist(regmatches(processed_input, gregexpr(""[\\(]*\\d+:\\d+[\\)]*"", processed_input)) )
+ prefix <- unlist(strsplit(processed_input, ""[\\(]*\\d+:\\d+[\\)]*""))[1]
+ suffix <- unlist(strsplit(processed_input, ""[\\(]*\\d+:\\d+[\\)]*""))[2]
+ processed_input <- paste(prefix, ""("",
+ sum(sapply(regmatches(
+ parts, gregexpr(""\\d+"", parts)
+ ), function(i) {
+ as.numeric(i)[1]
+ })), ## number of Cs
+ "":"",
+ sum(sapply(regmatches(
+ parts, gregexpr(""\\d+"", parts)
+ ), function(i) {
+ as.numeric(i)[2]
+ })), ## number of DBs
+ "")"", suffix, sep = """")
+ }
+ ### end 'CL(32:0)(34:1)'
+
+
+ if(length(FAs)==2 & grepl(""^SM"", processed_input)){ ### voor 'SM 18/16:0)'
+ if(!grepl(""[dt]\\d+"",processed_input)){ ### double check: no 'd'18...?
+ processed_input <- gsub(""SM 18"",""SM d18"",processed_input) ### add 'd'
+ processed_input <- gsub(""SM\\(18"",""SM(d18"",processed_input)
+ }
+
+ }
+
+
+ processed_input <- gsub(""_\\d*\\.*\\d*/\\d*\\.*\\d*"", """",processed_input) ## remove amu/RT info
+
+ processed_input <- gsub("";\\d$"","""",processed_input) ### in case of SHexCer 30:2;1
+
+ if (grepl(""DHHexosylceramide|Hexosylceramide|DHSphingomyelin|Sphingomyelin|DHCeramide|Ceramide"", processed_input)){ ## for notation 'DHSphingomyelin 16'
+ if (grepl(""C\\d+"",processed_input)){ ## replace 'C20:3 to 20:3
+ C_containing_notation <- unlist(regmatches(processed_input, gregexpr(""C\\d+"", processed_input)))
+ processed_input <- sub(C_containing_notation, gsub('C',"""",C_containing_notation), processed_input)
+ }
+
+ if (!grepl(""\\d+:\\d+"",processed_input)){ ## replace 'C16 to 16:0
+ C_number <- regmatches(processed_input, regexpr(""\\d+"", processed_input))
+ processed_input <- sub(C_number, paste(C_number,"":0"",sep=""""), processed_input)
+ }
+
+ if (grepl(""^DH"",processed_input)){ ## DH >> d18:0, otherwise >> d18:1
+ processed_input <- gsub(""DH"","""",processed_input)
+ FAs <- regmatches(processed_input, regexpr(""\\d+.*\\d*"", processed_input))
+ processed_input <- sub(FAs, paste(""d18:0/"",FAs,sep=""""), processed_input)
+ } else {
+ #processed_input <- gsub(""DH"","""",processed_input)
+ FAs <- regmatches(processed_input, regexpr(""\\d+.*\\d*"", processed_input))
+ processed_input <- sub(FAs, paste(""d18:1/"",FAs,sep=""""), processed_input)
+ }
+
+ processed_input <- gsub(""Hexosylceramide"",""HexCer"",processed_input)
+ processed_input <- gsub(""Sphingomyelin"",""SM"",processed_input)
+ processed_input <- gsub(""Ceramide"",""Cer"",processed_input)
+ }
+
+ processed_input <-
+ gsub(""_|;"", ""/"", processed_input) ## _ and ; into /
+
+ for(substitute in unlist(regmatches(processed_input, gregexpr(""\\d+-\\d+"", processed_input)) )){
+ processed_input <- gsub(substitute, gsub(""-"",""/"",substitute), processed_input)
+ } ## - into / if it's between numbers
+
+
+ processed_input <-
+ gsub(""\\((\\d+[EZ]{1},*)+\\)"", """", processed_input) ## removing (5Z,8Z,11Z,14Z)-like info
+
+ processed_input <-
+ gsub(""<.+>"", """",processed_input) ## remove eg <{9Z,12Z}> in 'TG(16:0/18:2<{9Z,12Z}>/18:0)',
+ #regmatches(processed_input, regexpr(""<.+>"", processed_input))
+
+ if (grepl(""\\d+:\\d+[pe]{1}"", processed_input)){ ### ether lipids: in case of 18:1p in stead of P-18:1
+
+ ether_FAs <- unlist(regmatches(processed_input, gregexpr(""\\d+:\\d+[pe]{1}"", processed_input))) ## extract 18:1
+
+ for(i in 1:length(ether_FAs)){
+ processed_input <-
+ gsub(ether_FAs[i], ## replace 18:1p for P-18:1
+ paste(
+ ifelse(grepl(""p"", ether_FAs[i]), ""P-"", ""O-""),
+ regmatches(ether_FAs[i], regexpr(""\\d+:\\d+"", ether_FAs[i])),
+ sep = """"
+ ),
+ processed_input)
+ }
+ }
+
+ if (grepl(""^FFA\\d"", processed_input)) { ## add space between FFA and 16:0 in FFA16:0
+ processed_input <- gsub(""^FFA"", ""FFA "", processed_input)
+ }
+
+ if (!grepl(""\\("", processed_input)) {
+ ## if they don't contain /
+ ## process PC 18:1/20:4 format to PC(..)
+
+ middlePart <- ### ..O-18:1/16:0
+ regmatches(processed_input,
+ regexpr(""[mdtAOP-]*(\\d+:\\d+/*)+"", processed_input))
+ otherParts <- ## SM
+ unlist(strsplit(processed_input, ""[mdtAOP-]*(\\d+:\\d+/*)+""))
+ otherParts <- gsub("" "", """", otherParts)
+ text <- """"
+
+ for (i in 1:max(c(length(otherParts), length(middlePart)))) {
+ ## reconstruct
+ if (!is.na(otherParts[i])) {
+ text <- paste(text, otherParts[i], sep = """")
+ }
+
+ if (!is.na(middlePart[i])) {
+ text <- paste(text, ""("", middlePart[i], "")"", sep = """")
+ }
+ }
+ processed_input <- text
+ }
+
+
+ if(grepl(""-DiHex"",processed_input)){ # in case of d18:0/12:0-DiHex
+ processed_input <- gsub(""-DiHex"","""",processed_input)
+ processed_input <- paste(""Hex2Cer"",processed_input,sep="""")
+ }
+
+ if(grepl(""-MonoHex"",processed_input)){ # in case of d18:2/26:0-MonoHex
+ processed_input <- gsub(""-MonoHex"","""",processed_input)
+ processed_input <- paste(""HexCer"",processed_input,sep="""")
+ }
+
+ if(grepl(""\\D+ [\\(|\\d+]"", processed_input)){ ## in case of 'CL (70:2)'
+ processed_input <- gsub(""\\D+ [\\(|\\d+]"",
+ gsub("" "","""", regmatches(processed_input, regexpr(""\\D+ [\\(|\\d+]"", processed_input)) ),
+ processed_input)
+ }
+
+ if (grepl(""^L[PC].*\\((\\d+:\\d+/*)+"", processed_input)) {
+ ## if LPC format >> format to PC(xx:0:0)
+
+
+ middlePart <- ### ..18:1 + /0:0
+ paste(regmatches(
+ processed_input,
+ #regexpr(""(\\d+:\\d+/*)+"", processed_input)
+ regexpr(""([OP-]*\\d+:\\d+[ep/]*)+"", processed_input)
+ ), sep = """")
+
+ if(identical(middlePart,character(0))){middlePart <- """"}
+ ### if no 0:0 yet, add this
+ if(!grepl(""\\D0:0|^0:0"", middlePart)){middlePart <- paste(middlePart,""/0:0"",sep="""")}
+
+
+ otherParts <- ## LPC
+ unlist(strsplit(processed_input, ""([OP-]*\\d+:\\d+[ep/]*)+""))
+ otherParts <- gsub(""^L"", """", otherParts)
+ if(identical(otherParts,character(0))){otherParts <- """"}
+
+ text <- """"
+
+ for (i in 1:max(c(length(otherParts), length(middlePart)))) {
+ ## reconstruct
+ if (!is.na(otherParts[i])) {
+ text <- paste(text, otherParts[i], sep = """")
+ }
+
+ if (!is.na(middlePart[i])) {
+ text <- paste(text, middlePart[i], sep = """")
+ }
+ }
+ processed_input <- text
+
+
+ }
+
+
+ if(grepl('^P\\D\\(A-*',processed_input) ){ ########## ether lipids 20180605
+ processed_input <- gsub('\\(A-*',""(O-"",processed_input) ##gsub('A-*',""(O-"",processed_input)
+ }
+ if(grepl('^P\\D\\([OP]\\d+',processed_input) ){ ########## ether lipids 20180219
+ processed_input <- gsub('\\(O',""(O-"",processed_input)
+ processed_input <- gsub('\\(P',""(P-"",processed_input)
+ }
+
+ if(grepl(""[[:upper:]]{1}[[:lower:]]{2}.+(sterol|enone)"", processed_input)){ ### in case of Lanosterol / Cholestenone
+ UpperLower <- regmatches(processed_input, regexpr(""[[:upper:]]{1}[[:lower:]]{2}"", processed_input))
+ processed_input <- gsub(""[[:upper:]]{1}[[:lower:]]{2}"", tolower(UpperLower),processed_input )
+ }
+
+
+ ## reorder FAs
+ if (
+ (length(unlist(regmatches(processed_input, gregexpr(""\\d+:\\d+"", processed_input)))) > 1) & ## when more than 1 FA)
+ (length(unlist(regmatches(processed_input, gregexpr(""[dtm](\\d+:\\d+)|[PO]-(\\d+:\\d+)"", processed_input)))) < 1)
+ # (!grepl(""0:0"", processed_input)) ## unless it's containing a 0:0 FA (=lyso, should be on second position))
+ ){
+ FAs <- t(as.data.frame(strsplit(unlist(
+ regmatches(
+ processed_input,
+ gregexpr(""\\d+:\\d+"", processed_input)
+ )
+ ), "":"")))
+ FAs <- as.data.frame(sapply(as.data.frame(FAs), as.numeric))
+
+ ## added to sort lysoPCs
+ FAs[apply(FAs,1,function(i){paste(i, collapse = "":"")}) == ""0:0"",1] <- 999 ## set 0:0 to 999:0 to order right
+
+ FAs <- FAs[order(FAs$V1, FAs$V2), ]
+ ## added to sort lysoPCs
+ FAs[apply(FAs,1,function(i){paste(i, collapse = "":"")}) == ""999:0"",1] <- 0 ## reset
+
+ FAs <- apply(FAs, 1, function(row) {
+ paste(row[1], "":"", row[2], sep = """")
+ })
+
+ parts <- unlist(strsplit(processed_input, ""\\d+:\\d+""))
+ text <- """"
+
+ for (i in 1:length(parts)) {
+ if (!is.na(parts[i])) {
+ text <- paste(text, parts[i], sep = """")
+ }
+
+ if (!is.na(FAs[i])) {
+ text <- paste(text, FAs[i], sep = """")
+ }
+ }
+ processed_input <- text
+ }
+
+ if(grepl(""\\([dtm]\\d+:\\d+\\)"", processed_input)){ ## SM(d32:0) is not supported in LION >> SM(32:0), in contrast to SM(d18:1/16:0), which is supported
+ processed_input <- gsub(""[dtm]"","""",processed_input)
+ }
+
+ return(processed_input)
+
+ })
+
+
+
+} ## 20200420 updated in apps!!
+
+
+simplifyLipidnames <- function(name){
+ options(stringsAsFactors = FALSE)
+
+ sapply(name, function(input) {
+ processed_input <- input
+
+ to_simplify <-
+ unlist(regmatches(processed_input, gregexpr(""(iso-)*[dt]*\\d+:\\d+([/_]+\\d+:\\d+)+"", processed_input) ))
+ to_simplify <- to_simplify[!grepl(""^0:0|[_/]+0:0"",to_simplify)]
+
+ if (length(to_simplify) > 0) {
+ simplified <- sapply(to_simplify, function(part_i) {
+ FAs <- unlist(regmatches(part_i, gregexpr(""\\d+:\\d+"", part_i)))
+ Cs <- sum(sapply(strsplit(FAs, split = "":""), function(i) { as.numeric(i[1]) }))
+ DBs <- sum(sapply(strsplit(FAs, split = "":""), function(i) { as.numeric(i[2]) }))
+ paste(Cs, "":"", DBs, sep = """")
+ })
+
+ nameLUT <-
+ data.frame(original = paste('\\Q', to_simplify, '\\E', sep = """"),
+ simplified = simplified)
+
+ for (i in 1:dim(nameLUT)[1]) {
+ processed_input <-
+ gsub(nameLUT$original[i], nameLUT$simplified[i], processed_input)
+ }
+
+ processed_input
+ } else {processed_input}
+ })
+
+} ### 20191001
+
+getFAs <- function(lipids){
+ output <- sapply(lipids, function(lipid_i){
+ FAs <- unlist(regmatches(lipid_i, gregexpr(""(iso-)*[dt]*\\d+:\\d+"", lipid_i)))
+ FAs[grepl(""^\\d+"",FAs)] <- paste(""C"",FAs[grepl(""^\\d+"",FAs)], sep = """")
+ FAs <- gsub(""d18:0"",""d18:0 (dihydrosphingosine)"",FAs)
+ FAs <- gsub(""d18:1"",""d18:1 (sphingosine)"",FAs)
+
+ FAs
+ }, simplify = FALSE)
+ if(length(output)<2){
+ output <- unlist(output)
+ names(output) <- NULL
+ output
+ } else {
+ output
+ }
+}
+
+getLipidHeadgroup <- function(lipids){ ### 20191030
+ sapply(lipids, function(lipid_i){
+ HG <- gsub(""\\(|\\[.+\\]"","""",regmatches(lipid_i, regexpr(""^.+\\("", lipid_i)) )
+ if(length(HG)==0){HG <- """"}
+
+ if(HG %in% c(""PC"",""PE"",""PA"",""PG"",""PI"",""PS"",""CL"") &
+ any(getFAs(lipid_i) %in% ""C0:0"")){
+ HG <- paste(""L"",HG,sep = """")
+ }
+ HG
+ })
+
+}
+
+getLipidLinkage <- function(lipids){
+ ifelse(grepl(""P-\\d+"", lipids), ""P"",
+ ifelse(grepl(""O-\\d+"", lipids), ""O"", ""D""))
+}
+
+predict_FAs <- function(headgroup = NULL, summedFA = NULL, composition_table = NULL){ ## v 20191101
+ FA_n <- ## number of FAs associated, based on headgroup
+ switch(
+ c(which(c(
+ headgroup %in% c(""PA"", ""PS"", ""PG"", ""PE"", ""PC"", ""PI"", ""BMP"", ""DG""),
+ headgroup %in% c(""TG"",""aPG"",""NAPE""),
+ headgroup %in% c(""CL"")
+ )),4)[1], 2, 3, 4,NA)
+
+ FA_output <- composition_table$FAs[composition_table$nr_of_FAs == FA_n & composition_table$FA_summed == summedFA][1]
+
+ if(!is.na(FA_output)){
+ return(paste(""C"",strsplit(x = FA_output, split = ""\\|"")[[1]],sep = """"))
+ } else {
+ return(NULL)
+ }
+
+}
+
+
+associatedTerms <- function(lipid, ontologyObject, all = FALSE, reformat = FALSE) { ## function: which LION-terms are associated with a lipid?
+ lipidInTerms <- genesInTerm(ontologyObject)
+ if (!reformat) {
+ associations <- sapply(lipid, function(lipid_i) {
+ terms <-
+ ontologyObject@termName[names(ontologyObject@termName) %in% names(lipidInTerms)[sapply(lipidInTerms, function(term) {
+ any(term == lipid_i)
+ })]] ## find terms
+
+ if (!all) {
+ terms <- terms[grepl(""LION"", names(terms))]
+ } ## is all == TRUE, than remove CAT and all terms
+ return(terms)
+ })
+ return(associations)
+
+ } else if (reformat) {
+
+ terms <- names(lipidInTerms)
+ if (!all) {
+ terms <- terms[grepl(""LION"", terms)]
+ } ## is all == TRUE, than remove CAT and all terms
+
+ lipid_term_table <- t(sapply(lipid, function(lipid_i) {
+ terms_per_lipid <-
+ names(ontologyObject@termName[names(ontologyObject@termName) %in% names(lipidInTerms)[sapply(lipidInTerms, function(term) {
+ any(term == lipid_i)
+ })]])
+ return(ifelse(terms %in% terms_per_lipid, ""x"", """"))
+ }))
+
+ names <- ontologyObject@termName[match(terms, names(ontologyObject@termName))]
+
+ lipid_term_table <- rbind(terms, names, lipid_term_table)
+ lipid_term_table <- cbind(rownames(lipid_term_table), lipid_term_table)
+ rownames(lipid_term_table) <- NULL
+ colnames(lipid_term_table) <- NULL
+ lipid_term_table <- as.data.frame(lipid_term_table)
+ lipid_term_table[[1]][1:2] <- c(""LION-term"", ""LION-name"")
+ return(lipid_term_table)
+ }
+
+} ## which LION-terms are associated with a lipid?
+
+","R"
+"Lipidomics","martijnmolenaar/LION-web","OntologyApp/data/20191010 LION_tree_structure.R",".R","30333","471","options(stringsAsFactors = FALSE)
+
+LIONstructure <-
+ list('cellular component'=list('nucleus'='LION:0012079',
+ 'endoplasmic reticulum (ER)'='LION:0012080',
+ 'mitochondrion'='LION:0012081',
+ 'plasma membrane'='LION:0012082',
+ 'chloroplast'='LION:0012083',
+ 'lipid droplet'='LION:0012084',
+ 'golgi apparatus'='LION:0012085',
+ 'endosome/lysosome'='LION:0012086',
+ 'peroxisome'='LION:0012087'),
+ 'function'=
+ list('lipid-mediated signalling'='LION:0012009',
+ 'membrane component'='LION:0012010',
+ 'lipid storage'='LION:0012011'),
+ 'lipid classification'=
+ list('fatty acids [FA]'=
+ list('fatty acids and conjugates [FA01]'='LION:0001742',
+ 'eicosanoids [FA03]'=
+ list('prostaglandins [FA0301]'='LION:0014870',
+ 'leukotrienes [FA0302]'='LION:0014871',
+ 'thromboxanes [FA0303]'='LION:0014872')),
+ 'glycerolipids [GL]'=
+ list('other glycerolipids [GL00]'='LION:0000601',
+ 'monoradylglycerols [GL01]'=
+ list('monoacylglycerols [GL0101]'='LION:0000619',
+ 'monoalkylglycerols [GL0102]'='LION:0000620',
+ 'mono-(1z-alkenyl)-glycerols [GL0103]'='LION:0000621'),
+ 'diradylglycerols [GL02]'=
+ list('diacylglycerols [GL0201]'='LION:0000607',
+ '1-alkyl,2-acylglycerols [GL0202]'='LION:0000608',
+ '1-acyl,2-alkylglycerols [GL0207]'='LION:0000609',
+ 'dialkylglycerols [GL0203]'='LION:0000610',
+ '1z-alkenylacylglycerols [GL0204]'='LION:0000611',
+ 'di-glycerol tetraethers [GL0205]'='LION:0000612',
+ 'di-glycerol tetraether glycans [GL0206]'='LION:0000613'),
+ 'triradylglycerols [GL03]'=
+ list('triacylglycerols [GL0301]'='LION:0000622',
+ 'alkyldiacylglycerols [GL0302]'='LION:0000623',
+ 'dialkylmonoacylglycerols [GL0303]'='LION:0000624',
+ '1z-alkenyldiacylglycerols [GL0304]'='LION:0000625',
+ 'estolides [GL0305]'='LION:0000626'),
+ 'glycosylmonoradylglycerols [GL04]'=
+ list('glycosylmonoacylglycerols [GL0401]'='LION:0000617',
+ 'glycosylmonoalkylglycerols [GL0402]'='LION:0000618'),
+ 'glycosyldiradylglycerols [GL05]'=
+ list('glycosyldiacylglycerols [GL0501]'='LION:0000614',
+ 'glycosylalkylacylglycerols [GL0502]'='LION:0000615',
+ 'glycosyldialkylglycerols [GL0503]'='LION:0000616')),
+ 'glycerophospholipids [GP]'=
+ list('other glycerophospholipids [GP00]'='LION:0000009',
+ 'glycerophosphocholines [GP01]'=
+ list('diacylglycerophosphocholines [GP0101]'='LION:0000030',
+ '1-alkyl,2-acylglycerophosphocholines [GP0102]'='LION:0000031',
+ '1-(1z-alkenyl),2-acylglycerophosphocholines [GP0103]'='LION:0000032',
+ 'dialkylglycerophosphocholines [GP0104]'='LION:0000033',
+ 'monoacylglycerophosphocholines [GP0105]'='LION:0000034',
+ 'monoalkylglycerophosphocholines [GP0106]'='LION:0000035',
+ '1z-alkenylglycerophosphocholines [GP0107]'='LION:0000036',
+ '1-acyl,2-alkylglycerophosphocholines [GP0108]'='LION:0000037'),
+ 'glycerophosphoethanolamines [GP02]'=
+ list('diacylglycerophosphoethanolamines [GP0201]'='LION:0000038',
+ '1-alkyl,2-acylglycerophosphoethanolamines [GP0202]'='LION:0000039',
+ '1-(1z-alkenyl),2-acylglycerophosphoethanolamines [GP0203]'='LION:0000040',
+ 'dialkylglycerophosphoethanolamines [GP0204]'='LION:0000041',
+ 'diacylglycerophospho-N-acylethanolamines'='LION:0012447',
+ 'monoacylglycerophosphoethanolamines [GP0205]'='LION:0000042',
+ 'monoalkylglycerophosphoethanolamines [GP0206]'='LION:0000043',
+ '1z-alkenylglycerophosphoethanolamines [GP0207]'='LION:0000044',
+ '1-acyl,2-alkylglycerophosphoethanolamines [GP0208]'='LION:0000045'),
+ 'glycerophosphoinositols [GP06]'=
+ list('monoacylglycerophosphoinositols [GP0605]'='LION:0000046',
+ 'diacylglycerophosphoinositols [GP0601]'='LION:0000047',
+ '1-alkyl,2-acylglycerophosphoinositols [GP0602]'='LION:0000048',
+ '1-(1z-alkenyl),2-acylglycerophosphoinositols [GP0603]'='LION:0000049',
+ 'dialkylglycerophosphoinositols [GP0604]'='LION:0000050',
+ 'monoalkylglycerophosphoinositols [GP0606]'='LION:0000051',
+ '1z-alkenylglycerophosphoinositols [GP0607]'='LION:0000052'),
+ 'glycerophosphoserines [GP03]'=
+ list('diacylglycerophosphoserines [GP0301]'='LION:0000053',
+ '1-alkyl,2-acylglycerophosphoserines [GP0302]'='LION:0000054',
+ '1-(1z-alkenyl),2-acylglycerophosphoserines [GP0303]'='LION:0000055',
+ 'monoacylglycerophosphoserines [GP0305]'='LION:0000056',
+ 'monoalkylglycerophosphoserines [GP0306]'='LION:0000057',
+ '1z-alkenylglycerophosphoserines [GP0307]'='LION:0000058'),
+ 'glycerophosphoglycerols [GP04]'=
+ list('diacylglycerophosphoglycerols [GP0401]'='LION:0000059',
+ '1-alkyl,2-acylglycerophosphoglycerols [GP0402]'='LION:0000060',
+ '1-(1z-alkenyl),2-acylglycerophosphoglycerols [GP0403]'='LION:0000061',
+ 'dialkylglycerophosphoglycerols [GP0404]'='LION:0000062',
+ 'monoacylglycerophosphoglycerols [GP0405]'='LION:0000063',
+ 'monoalkylglycerophosphoglycerols [GP0406]'='LION:0000064',
+ '1z-alkenylglycerophosphoglycerols [GP0407]'='LION:0000065',
+ 'diacylglycerophosphomonoradylglycerols [GP0409]'='LION:0000066',
+ 'diacylglycerophosphoacylglycerols'='LION:0012449',
+ 'monoacylglycerophosphomonoradylglycerols [GP0410]'='LION:0000067',
+ '1-acyl,2-alkylglycerophosphoglycerols [GP0411]'='LION:0000068'),
+ 'glycerophosphoglycerophosphates [GP05]'='LION:0000015',
+ 'glycerophosphoinositol monophosphates [GP07]'='LION:0000016',
+ 'glycerophosphoinositol bisphosphates [GP08]'='LION:0000017',
+ 'glycerophosphoinositol trisphosphates [GP09]'='LION:0000018',
+ 'glycerophosphates [GP10]'=
+ list('diacylglycerophosphates [GP1001]'='LION:0000069',
+ '1-alkyl,2-acylglycerophosphates [GP1002]'='LION:0000070',
+ '1-(1z-alkenyl),2-acylglycerophosphates [GP1003]'='LION:0000071',
+ 'monoacylglycerophosphates [GP1005]'='LION:0000072',
+ 'monoalkylglycerophosphates [GP1006]'='LION:0000073',
+ '1z-alkenylglycerophosphates [GP1007]'='LION:0000074'),
+ 'glyceropyrophosphates [GP11]'='LION:0000020',
+ 'glycerophosphoglycerophosphoglycerols [GP12]'=
+ list('diacylglycerophosphoglycerophosphodiradylglycerols [GP1201]'='LION:0000728',
+ 'diacylglycerophosphoglycerophosphomonoradylglycerols [GP1202]'='LION:0000940',
+ '1-alkyl,2-acylglycerophosphoglycerophosphodiradylglycerols [GP1203]'='LION:0000941',
+ '1-alkyl,2-acylglycerophosphoglycerophosphomonoradylglycerols [GP1204]'='LION:0000942',
+ '1-(1z-alkenyl),2-acylglycerophosphoglycerophosphodiradylglycerols [GP1205]'='LION:0000943',
+ '1-(1z-alkenyl),2-acylglycerophosphoglycerophosphomonoradylglycerols [GP1206]'='LION:0000944',
+ 'dialkylglycerophosphoglycerophosphodiradylglycerols [GP1212]'='LION:0000945',
+ 'dialkylglycerophosphoglycerophosphomonoradylglycerols [GP1213]'='LION:0000946',
+ 'monoacylglycerophosphoglycerophosphomonoradylglycerols [GP1207]'='LION:0000947',
+ 'monoalkylglycerophosphoglycerophosphodiradylglycerols [GP1208]'='LION:0000948',
+ 'monoalkylglycerophosphoglycerophosphomonoradylglycerols [GP1209]'='LION:0000949',
+ '1z-alkenylglycerophosphoglycerophosphodiradylglycerols [GP1210]'='LION:0000950',
+ '1z-alkenylglycerophosphoglycerophosphomonoradylglycerols [GP1211]'='LION:0000951'),
+ 'cdp-glycerols [GP13]'='LION:0000022',
+ 'glycosylglycerophospholipids [GP14]'='LION:0000023',
+ 'glycerophosphoinositolglycans [GP15]'='LION:0000024',
+ 'glycerophosphonocholines [GP16]'='LION:0000025',
+ 'glycerophosphonoethanolamines [GP17]'='LION:0000026',
+ 'di-glycerol tetraether phospholipids (caldarchaeols) [GP18]'='LION:0000027',
+ 'glycerol-nonitol tetraether phospholipids [GP19]'='LION:0000028',
+ 'oxidized glycerophospholipids [GP20]'='LION:0000029',
+ 'lysoglycerophospholipids'=
+ list('monoacylglycerophosphocholines [GP0105]'='LION:0000034',
+ 'monoacylglycerophosphoethanolamines [GP0205]'='LION:0000042',
+ 'monoacylglycerophosphoinositols [GP0605]'='LION:0000046',
+ 'monoacylglycerophosphoserines [GP0305]'='LION:0000056',
+ 'monoacylglycerophosphoglycerols [GP0405]'='LION:0000063',
+ 'monoacylglycerophosphates [GP1005]'='LION:0000072')),
+ 'sphingolipids [SP]'=
+ list('other sphingolipids [SP00]'='LION:0000075',
+ 'sphingoid bases [SP01]'='LION:0000076',
+ 'ceramides [SP02]'=
+ list(
+ 'N-acylsphingosines (ceramides) [SP0201]' = 'LION:0012441',
+ 'N-acylsphinganines (dihydroceramides) [SP0202]' = 'LION:0012443',
+ 'N-acyl-4-hydroxysphinganines (phytoceramides) [SP0203]' = 'LION:0012444',
+ 'Acylceramides [SP0204]' = 'LION:0012445',
+ 'Ceramide 1-phosphates [SP0205]' = 'LION:0012446'), ##'LION:0000077',
+ 'phosphosphingolipids [SP03]'=
+ list('ceramide phosphocholines (sphingomyelins) [SP0301]'='LION:0000084',
+ 'ceramide phosphoethanolamines [SP0302]'='LION:0000085',
+ 'ceramide phosphoinositols [SP0303]'='LION:0000086'),
+ 'phosphonosphingolipids [SP04]'='LION:0000079',
+ 'neutral glycosphingolipids [SP05]'=
+ list('other neutral glycosphingolipids [SP0500]'='LION:0000452',
+ 'simple glc series [SP0501]'=
+ list('hexosylceramides'='LION:0012017',
+ 'dihexosylceramides'='LION:0012018'), ###'LION:0000453',
+ 'galnacbeta1-3galalpha1-4galbeta1-4glc- (globo series) [SP0502]'='LION:0000454',
+ 'galnacbeta1-4galbeta1-4glc- (ganglio series) [SP0503]'='LION:0000455',
+ 'galbeta1-3glcnacbeta1-3galbeta1-4glc- (lacto series) [SP0504]'='LION:0000456',
+ 'galbeta1-4glcnacbeta1-3galbeta1-4glc- (neolacto series) [SP0505]'='LION:0000457',
+ 'galnacbeta1-3galalpha1-3galbeta1-4glc- (isoglobo series) [SP0506]'='LION:0000458',
+ 'glcnacbeta1-2manalpha1-3manbeta1-4glc- (mollu series) [SP0507]'='LION:0000459',
+ 'galnacbeta1-4glcnacbeta1-3manbeta1-4glc- (arthro series) [SP0508]'='LION:0000460',
+ 'gal- (gala series) [SP0509]'='LION:0000461'),
+ 'acidic glycosphingolipids [SP06]'=
+ list('gangliosides [SP0601]'='LION:0000087',
+ 'sulfoglycosphingolipids (sulfatides) [SP0602]'='LION:0000088',
+ 'glucuronosphingolipids [SP0603]'='LION:0000089',
+ 'phosphoglycosphingolipids [SP0604]'='LION:0000090'),
+ 'basic glycosphingolipids [SP07]'='LION:0000082',
+ 'amphoteric glycosphingolipids [SP08]'='LION:0000083'),
+ 'sterol lipids [ST]'=
+ list('other sterol lipids [ST00]'='LION:0000556',
+ 'sterols [ST01]'=
+ list('cholesterol and derivatives [ST0101]'=
+ list('cholesterol'='LION:0000541',
+ 'cholestenone'='LION:0000553',
+ 'oxysterol'='LION:0000600'),
+ 'steryl esters [ST0102]'='LION:0000563',
+ 'ergosterols and c24-methyl derivatives [ST0103]'='LION:0000564',
+ 'stigmasterols and c24-ethyl derivatives [ST0104]'='LION:0000565',
+ 'c24-propyl sterols and derivatives [ST0105]'='LION:0000566',
+ 'gorgosterols and derivatives [ST0106]'='LION:0000567',
+ 'furostanols and derivatives [ST0107]'='LION:0000568',
+ 'spirostanols and derivatives [ST0108]'='LION:0000569',
+ 'furospirostanols and derivatives [ST0109]'='LION:0000570',
+ 'cycloartanols and derivatives [ST0110]'='LION:0000571',
+ 'calysterols and cyclopropyl sidechain derivatives [ST0111]'='LION:0000572',
+ 'cardanolides and derivatives [ST0112]'='LION:0000573',
+ 'bufanolides and derivatives [ST0113]'='LION:0000574',
+ 'brassinolides and derivatives [ST0114]'='LION:0000575',
+ 'solanidines and alkaloid derivatives [ST0115]'='LION:0000576',
+ 'withanolides and derivatives [ST0116]'='LION:0000577'),
+ 'steroids [ST02]'='LION:0000558',
+ 'secosteroids [ST03]'='LION:0000559',
+ 'bile acids and derivatives [ST04]'='LION:0000560',
+ 'steroid conjugates [ST05]'='LION:0000561'),
+ 'prenol lipids [PR]'=
+ list('isoprenoids [PR01]'=
+ list('C5 isoprenoids (hemiterpenes) [PR0101]'='LION:0012013',
+ 'C10 isoprenoids (monoterpenes) [PR0102]'='LION:0012014',
+ 'C15 isoprenoids (sesquiterpenes) [PR0103]'='LION:0012015',
+ 'C20 isoprenoids (diterpenes) [PR0104]'='LION:0012016',
+ 'C25 isoprenoids (sesterterpenes) [PR0105]'='LION:0012019',
+ 'C30 isoprenoids (triterpenes) [PR0106]'='LION:0012020',
+ 'C40 isoprenoids (tetraterpenes) [PR0107]'='LION:0012021',
+ 'polyterpenes [PR0108]'='LION:0012022',
+ 'retinoids [PR0109]'=
+ list('all-trans-retinol'='LION:0012044',
+ '9-cis-retinol'='LION:0012045',
+ '13-cis-retinol'='LION:0012046',
+ 'all-trans-retinal'='LION:0012047',
+ '9-cis-retinal'='LION:0012048',
+ '13-cis-retinal'='LION:0012049',
+ 'all-trans-retinoic acid'='LION:0012050',
+ '9-cis-retinoic acid'='LION:0012054',
+ '13-cis-retinoic acid'='LION:0012055',
+ 'all-trans-retinyl esters'='LION:0012056')),
+ 'quinones and hydroquinones [PR02]'=
+ list('ubiquinones [PR0201]'='LION:0012025',
+ 'vitamin E [PR0202]'='LION:0012026',
+ 'vitamin K [PR0203]'='LION:0012027'),
+ 'polyprenols [PR03]'=
+ list('bactoprenols [PR0301]'='LION:0012029',
+ 'bactoprenol monophosphates [PR0302]'='LION:0012030',
+ 'bactoprenol diphosphates [PR0303]'='LION:0012035',
+ 'phytoprenols [PR0304]'='LION:0012036',
+ 'phytoprenol monophosphates [PR0305]'='LION:0012037',
+ 'phytoprenol diphosphates [PR0306]'='LION:0012038',
+ 'dolichols [PR0307]'='LION:0012039',
+ 'dolichol monophosphates [PR0308]'='LION:0012040',
+ 'dolichol diphosphates [PR0309]'='LION:0012041'),
+ 'hopanoids [PR04]'='LION:0012042',
+ 'other prenol lipids [PR00]'='LION:0012043'),
+ 'saccharolipids [SL]'='LION:0000007',
+ 'polyketides [PK]'='LION:0000008'),
+ 'physical or chemical properties'=
+ list('charge headgroup'=
+ list('headgroup with negative charge'='LION:0000093',
+ 'headgroup with neutral charge'='LION:0000094',
+ 'headgroup with positive charge / zwitter-ion'='LION:0000095'),
+ 'contains fatty acid'=
+ list('C12:0'='LION:0000254',
+ 'C13:0'='LION:0022223',
+ 'C14:0'='LION:0000259',
+ 'C14:1'='LION:0000462',
+ 'C15:0'='LION:0022229',
+ 'C15:1'='LION:0022230',
+ 'C16:0'='LION:0002882',
+ 'C16:1'='LION:0002900',
+ 'C17:0'='LION:0022231',
+ 'C17:1'='LION:0022234',
+ 'C17:2'='LION:0022236',
+ 'C18:0'='LION:0002921',
+ 'C18:1'='LION:0002922',
+ 'C18:2'='LION:0002923',
+ 'C18:3'='LION:0002924',
+ 'C19:0'='LION:0022241',
+ 'C19:1'='LION:0022242',
+ 'C19:2'='LION:0022245',
+ 'C19:3'='LION:0022247',
+ 'C20:0'='LION:0002925',
+ 'C20:1'='LION:0002926',
+ 'C20:2'='LION:0002927',
+ 'C20:3'='LION:0002928',
+ 'C20:4'='LION:0002929',
+ 'C20:5'='LION:0002930',
+ 'C21:0'='LION:0022261',
+ 'C21:1'='LION:0022262',
+ 'C21:2'='LION:0022263',
+ 'C21:3'='LION:0022264',
+ 'C21:4'='LION:0022265',
+ 'C22:0'='LION:0002931',
+ 'C22:1'='LION:0002932',
+ 'C22:2'='LION:0002933',
+ 'C22:3'='LION:0002934',
+ 'C22:4'='LION:0002935',
+ 'C22:5'='LION:0002936',
+ 'C22:6'='LION:0002937',
+ 'C23:0'='LION:0022266',
+ 'C23:1'='LION:0022267',
+ 'C23:2'='LION:0022268',
+ 'C23:3'='LION:0022269',
+ 'C23:4'='LION:0022270',
+ 'C23:5'='LION:0022271',
+ 'C24:0'='LION:0002938',
+ 'C24:1'='LION:0002939',
+ 'C24:2'='LION:0002940',
+ 'C24:3'='LION:0002941',
+ 'C24:4'='LION:0002942',
+ 'C24:5'='LION:0002943',
+ 'C24:6'='LION:0002944',
+ 'C25:0'='LION:0022272',
+ 'C25:1'='LION:0022273',
+ 'C25:2'='LION:0022274',
+ 'C25:3'='LION:0022275',
+ 'C25:4'='LION:0022276',
+ 'C25:5'='LION:0022277',
+ 'C25:6'='LION:0022278',
+ 'C25:7'='LION:0022279',
+ 'C26:0'='LION:0002979',
+ 'C26:1'='LION:0002981',
+ 'C26:2'='LION:0002982',
+ 'C26:3'='LION:0002983',
+ 'C26:4'='LION:0002984',
+ 'C26:5'='LION:0002985',
+ 'C26:6'='LION:0002986',
+ 'C26:7'='LION:0002987',
+ 'd18:1 (sphingosine)'='LION:0080947',
+ 'd18:0 (dihydrosphingosine)'='LION:0080948',
+ 'd14:0'='LION:0012031',
+ 'd14:1'='LION:0012032',
+ 'd14:2'='LION:0012033',
+ 't14:0'='LION:0012034',
+ 't14:1'='LION:0012051',
+ 't14:2'='LION:0012052',
+ 'm14:0'='LION:0012053',
+ 'm14:1'='LION:0012070',
+ 'm14:2'='LION:0012071',
+ 'd15:0'='LION:0012072',
+ 'd15:1'='LION:0012073',
+ 'd15:2'='LION:0012089',
+ 't15:0'='LION:0012090',
+ 't15:1'='LION:0012104',
+ 't15:2'='LION:0012120',
+ 'm15:0'='LION:0012121',
+ 'm15:1'='LION:0012122',
+ 'm15:2'='LION:0012123',
+ 'd16:0'='LION:0012124',
+ 'd16:1'='LION:0012125',
+ 'd16:2'='LION:0012149',
+ 't16:0'='LION:0012150',
+ 't16:1'='LION:0012151',
+ 't16:2'='LION:0012152',
+ 'm16:0'='LION:0012153',
+ 'm16:1'='LION:0012154',
+ 'm16:2'='LION:0012180',
+ 'd17:0'='LION:0012182',
+ 'd17:1'='LION:0012183',
+ 'd17:2'='LION:0012184',
+ 't17:0'='LION:0012185',
+ 't17:1'='LION:0012186',
+ 't17:2'='LION:0012212',
+ 'm17:0'='LION:0012213',
+ 'm17:1'='LION:0012214',
+ 'm17:2'='LION:0012215',
+ 'd18:2'='LION:0012216',
+ 't18:0'='LION:0012217',
+ 't18:1'='LION:0012218',
+ 't18:2'='LION:0012243',
+ 'm18:0'='LION:0012244',
+ 'm18:1'='LION:0012245',
+ 'm18:2'='LION:0012246',
+ 'd19:0'='LION:0012247',
+ 'd19:1'='LION:0012268',
+ 'd19:2'='LION:0012269',
+ 't19:0'='LION:0012270',
+ 't19:1'='LION:0012300',
+ 't19:2'='LION:0012301',
+ 'm19:0'='LION:0012302',
+ 'm19:1'='LION:0012303',
+ 'm19:2'='LION:0012304',
+ 'd20:0'='LION:0012305',
+ 'd20:1'='LION:0012306',
+ 'd20:2'='LION:0012307',
+ 't20:0'='LION:0012308',
+ 't20:1'='LION:0012337',
+ 't20:2'='LION:0012339',
+ 'm20:0'='LION:0012341',
+ 'm20:1'='LION:0012342',
+ 'm20:2'='LION:0012344',
+ 'd21:0'='LION:0012345',
+ 'd21:1'='LION:0012346',
+ 'd21:2'='LION:0012347',
+ 't21:0'='LION:0012348',
+ 't21:1'='LION:0012384',
+ 't21:2'='LION:0012387',
+ 'm21:0'='LION:0012389',
+ 'm21:1'='LION:0012390',
+ 'm21:2'='LION:0012391',
+ 'd22:0'='LION:0012393',
+ 'd22:1'='LION:0012394',
+ 'd22:2'='LION:0012395',
+ 't22:0'='LION:0012396',
+ 't22:1'='LION:0012397',
+ 't22:2'='LION:0012398',
+ 'm22:0'='LION:0012437',
+ 'm22:1'='LION:0012438',
+ 'm22:2'='LION:0012440'),
+ 'type by bond'=
+ list('contains ether-bond'='LION:0000467',
+ 'contains vinyl ether bond (plasmalogen)'='LION:0001734'),
+ 'intrinsic curvature'=
+ list('negative intrinsic curvature'='LION:0000464',
+ 'neutral intrinsic curvature'='LION:0000465',
+ 'positive intrinsic curvature'='LION:0000466'),
+ 'chain-melting transition temperature'=
+ list('average transition temperature'='LION:0001737',
+ 'above average transition temperature'=
+ list('high transition temperature'='LION:0001738',
+ 'very high transition temperature'='LION:0001739'),
+ 'below average transition temperature'=
+ list('very low transition temperature'='LION:0001735',
+ 'low transition temperature'='LION:0001736')),
+ 'fatty acid unsaturation'=
+ list('fatty acid with less than 2 double bonds'=
+ list('saturated fatty acid'='LION:0002968',
+ 'monounsaturated fatty acid'='LION:0002969'),
+ 'polyunsaturated fatty acid'=
+ list('fatty acid with 2 double bonds'='LION:0002970',
+ 'fatty acid with more than 3 double bonds'=
+ list('fatty acid with 3-5 double bonds'=
+ list('fatty acid with 3 double bonds'='LION:0002971',
+ 'fatty acid with 4 double bonds'='LION:0002972',
+ 'fatty acid with 5 double bonds'='LION:0002973')),
+ 'fatty acid with more than 5 double bonds'=
+ list('fatty acid with 6 double bonds'='LION:0002974',
+ 'fatty acid with 7 double bonds'='LION:0002975'))),
+ 'fatty acid chain length'=
+ list('fatty acid with 18 carbons or less'=
+ list('fatty acid with less than 13 carbons'=
+ list('fatty acid with 12 carbons'='LION:0002980'),
+ 'fatty acid with 13-15 carbons'=
+ list('fatty acid with 13 carbons'='LION:0002952',
+ 'fatty acid with 14 carbons'='LION:0002953',
+ 'fatty acid with 15 carbons'='LION:0002954'),
+ 'fatty acid with 16-18 carbons'=
+ list('fatty acid with 16 carbons'='LION:0002955',
+ 'fatty acid with 17 carbons'='LION:0002956',
+ 'fatty acid with 18 carbons'='LION:0002957')),
+ 'fatty acid with more than 18 carbons'=
+ list('fatty acid with 19-21 carbons'=
+ list('fatty acids with 19 carbons'='LION:0002958',
+ 'fatty acid with 20 carbons'='LION:0002959',
+ 'fatty acid with 21 carbons'='LION:0002960'),
+ 'fatty acid with 22-24 carbons'=
+ list('fatty acid with 22 carbons'='LION:0002961',
+ 'fatty acid with 23 carbons'='LION:0002962',
+ 'fatty acid with 24 carbons'='LION:0002963'),
+ 'fatty acid with more than 24 carbons'=
+ list('fatty acid with 25 carbons'='LION:0002964',
+ 'fatty acid with 26 carbons'='LION:0002965'))),
+ 'lateral diffusion'=
+ list('average lateral diffusion'='LION:0080978',
+ 'below average lateral diffusion'=
+ list('very low lateral diffusion'='LION:0080976',
+ 'low lateral diffusion'='LION:0080977'),
+ 'above average lateral diffusion'=
+ list('high lateral diffusion'='LION:0080979',
+ 'very high lateral diffusion'='LION:0080980')),
+ 'bilayer thickness'=
+ list('average bilayer thickness'='LION:0080970',
+ 'below average bilayer thickness'=
+ list('very low bilayer thickness'='LION:0080968',
+ 'low bilayer thickness'='LION:0080969'),
+ 'above average bilayer thickness'=
+ list('high bilayer thickness'='LION:0080971',
+ 'very high bilayer thickness'='LION:0080972'))))
+
+
+LIONstructure <-
+ rapply(LIONstructure, function(element){
+ newelement <- element
+ attr(newelement, 'stselected') <- FALSE
+ newelement
+ }, how = ""list"")
+
+","R"
+"Lipidomics","martijnmolenaar/LION-web","OntologyApp/data/20190704 LION_tree_structure.R",".R","25978","382","options(stringsAsFactors = FALSE)
+
+LIONstructure <-
+ list('cellular component'=list('nucleus'='LION:0012079',
+ 'endoplasmic reticulum (ER)'='LION:0012080',
+ 'mitochondrion'='LION:0012081',
+ 'plasma membrane'='LION:0012082',
+ 'chloroplast'='LION:0012083',
+ 'lipid droplet'='LION:0012084',
+ 'golgi apparatus'='LION:0012085',
+ 'endosome/lysosome'='LION:0012086',
+ 'peroxisome'='LION:0012087'),
+ 'function'=
+ list('lipid-mediated signalling'='LION:0012009',
+ 'membrane component'='LION:0012010',
+ 'lipid storage'='LION:0012011'),
+ 'lipid classification'=
+ list('fatty acids [FA]'=
+ list('fatty acids and conjugates [FA01]'='LION:0001742',
+ 'eicosanoids [FA03]'=
+ list('prostaglandins [FA0301]'='LION:0014870',
+ 'leukotrienes [FA0302]'='LION:0014871',
+ 'thromboxanes [FA0303]'='LION:0014872')),
+ 'glycerolipids [GL]'=
+ list('other glycerolipids [GL00]'='LION:0000601',
+ 'monoradylglycerols [GL01]'=
+ list('monoacylglycerols [GL0101]'='LION:0000619',
+ 'monoalkylglycerols [GL0102]'='LION:0000620',
+ 'mono-(1z-alkenyl)-glycerols [GL0103]'='LION:0000621'),
+ 'diradylglycerols [GL02]'=
+ list('diacylglycerols [GL0201]'='LION:0000607',
+ '1-alkyl,2-acylglycerols [GL0202]'='LION:0000608',
+ '1-acyl,2-alkylglycerols [GL0207]'='LION:0000609',
+ 'dialkylglycerols [GL0203]'='LION:0000610',
+ '1z-alkenylacylglycerols [GL0204]'='LION:0000611',
+ 'di-glycerol tetraethers [GL0205]'='LION:0000612',
+ 'di-glycerol tetraether glycans [GL0206]'='LION:0000613'),
+ 'triradylglycerols [GL03]'=
+ list('triacylglycerols [GL0301]'='LION:0000622',
+ 'alkyldiacylglycerols [GL0302]'='LION:0000623',
+ 'dialkylmonoacylglycerols [GL0303]'='LION:0000624',
+ '1z-alkenyldiacylglycerols [GL0304]'='LION:0000625',
+ 'estolides [GL0305]'='LION:0000626'),
+ 'glycosylmonoradylglycerols [GL04]'=
+ list('glycosylmonoacylglycerols [GL0401]'='LION:0000617',
+ 'glycosylmonoalkylglycerols [GL0402]'='LION:0000618'),
+ 'glycosyldiradylglycerols [GL05]'=
+ list('glycosyldiacylglycerols [GL0501]'='LION:0000614',
+ 'glycosylalkylacylglycerols [GL0502]'='LION:0000615',
+ 'glycosyldialkylglycerols [GL0503]'='LION:0000616')),
+ 'glycerophospholipids [GP]'=
+ list('other glycerophospholipids [GP00]'='LION:0000009',
+ 'glycerophosphocholines [GP01]'=
+ list('diacylglycerophosphocholines [GP0101]'='LION:0000030',
+ '1-alkyl,2-acylglycerophosphocholines [GP0102]'='LION:0000031',
+ '1-(1z-alkenyl),2-acylglycerophosphocholines [GP0103]'='LION:0000032',
+ 'dialkylglycerophosphocholines [GP0104]'='LION:0000033',
+ 'monoacylglycerophosphocholines [GP0105]'='LION:0000034',
+ 'monoalkylglycerophosphocholines [GP0106]'='LION:0000035',
+ '1z-alkenylglycerophosphocholines [GP0107]'='LION:0000036',
+ '1-acyl,2-alkylglycerophosphocholines [GP0108]'='LION:0000037'),
+ 'glycerophosphoethanolamines [GP02]'=
+ list('diacylglycerophosphoethanolamines [GP0201]'='LION:0000038',
+ '1-alkyl,2-acylglycerophosphoethanolamines [GP0202]'='LION:0000039',
+ '1-(1z-alkenyl),2-acylglycerophosphoethanolamines [GP0203]'='LION:0000040',
+ 'dialkylglycerophosphoethanolamines [GP0204]'='LION:0000041',
+ 'monoacylglycerophosphoethanolamines [GP0205]'='LION:0000042',
+ 'monoalkylglycerophosphoethanolamines [GP0206]'='LION:0000043',
+ '1z-alkenylglycerophosphoethanolamines [GP0207]'='LION:0000044',
+ '1-acyl,2-alkylglycerophosphoethanolamines [GP0208]'='LION:0000045'),
+ 'glycerophosphoinositols [GP06]'=
+ list('monoacylglycerophosphoinositols [GP0605]'='LION:0000046',
+ 'diacylglycerophosphoinositols [GP0601]'='LION:0000047',
+ '1-alkyl,2-acylglycerophosphoinositols [GP0602]'='LION:0000048',
+ '1-(1z-alkenyl),2-acylglycerophosphoinositols [GP0603]'='LION:0000049',
+ 'dialkylglycerophosphoinositols [GP0604]'='LION:0000050',
+ 'monoalkylglycerophosphoinositols [GP0606]'='LION:0000051',
+ '1z-alkenylglycerophosphoinositols [GP0607]'='LION:0000052'),
+ 'glycerophosphoserines [GP03]'=
+ list('diacylglycerophosphoserines [GP0301]'='LION:0000053',
+ '1-alkyl,2-acylglycerophosphoserines [GP0302]'='LION:0000054',
+ '1-(1z-alkenyl),2-acylglycerophosphoserines [GP0303]'='LION:0000055',
+ 'monoacylglycerophosphoserines [GP0305]'='LION:0000056',
+ 'monoalkylglycerophosphoserines [GP0306]'='LION:0000057',
+ '1z-alkenylglycerophosphoserines [GP0307]'='LION:0000058'),
+ 'glycerophosphoglycerols [GP04]'=
+ list('diacylglycerophosphoglycerols [GP0401]'='LION:0000059',
+ '1-alkyl,2-acylglycerophosphoglycerols [GP0402]'='LION:0000060',
+ '1-(1z-alkenyl),2-acylglycerophosphoglycerols [GP0403]'='LION:0000061',
+ 'dialkylglycerophosphoglycerols [GP0404]'='LION:0000062',
+ 'monoacylglycerophosphoglycerols [GP0405]'='LION:0000063',
+ 'monoalkylglycerophosphoglycerols [GP0406]'='LION:0000064',
+ '1z-alkenylglycerophosphoglycerols [GP0407]'='LION:0000065',
+ 'diacylglycerophosphomonoradylglycerols [GP0409]'='LION:0000066',
+ 'monoacylglycerophosphomonoradylglycerols [GP0410]'='LION:0000067',
+ '1-acyl,2-alkylglycerophosphoglycerols [GP0411]'='LION:0000068'),
+ 'glycerophosphoglycerophosphates [GP05]'='LION:0000015',
+ 'glycerophosphoinositol monophosphates [GP07]'='LION:0000016',
+ 'glycerophosphoinositol bisphosphates [GP08]'='LION:0000017',
+ 'glycerophosphoinositol trisphosphates [GP09]'='LION:0000018',
+ 'glycerophosphates [GP10]'=
+ list('diacylglycerophosphates [GP1001]'='LION:0000069',
+ '1-alkyl,2-acylglycerophosphates [GP1002]'='LION:0000070',
+ '1-(1z-alkenyl),2-acylglycerophosphates [GP1003]'='LION:0000071',
+ 'monoacylglycerophosphates [GP1005]'='LION:0000072',
+ 'monoalkylglycerophosphates [GP1006]'='LION:0000073',
+ '1z-alkenylglycerophosphates [GP1007]'='LION:0000074'),
+ 'glyceropyrophosphates [GP11]'='LION:0000020',
+ 'glycerophosphoglycerophosphoglycerols [GP12]'=
+ list('diacylglycerophosphoglycerophosphodiradylglycerols [GP1201]'='LION:0000728',
+ 'diacylglycerophosphoglycerophosphomonoradylglycerols [GP1202]'='LION:0000940',
+ '1-alkyl,2-acylglycerophosphoglycerophosphodiradylglycerols [GP1203]'='LION:0000941',
+ '1-alkyl,2-acylglycerophosphoglycerophosphomonoradylglycerols [GP1204]'='LION:0000942',
+ '1-(1z-alkenyl),2-acylglycerophosphoglycerophosphodiradylglycerols [GP1205]'='LION:0000943',
+ '1-(1z-alkenyl),2-acylglycerophosphoglycerophosphomonoradylglycerols [GP1206]'='LION:0000944',
+ 'dialkylglycerophosphoglycerophosphodiradylglycerols [GP1212]'='LION:0000945',
+ 'dialkylglycerophosphoglycerophosphomonoradylglycerols [GP1213]'='LION:0000946',
+ 'monoacylglycerophosphoglycerophosphomonoradylglycerols [GP1207]'='LION:0000947',
+ 'monoalkylglycerophosphoglycerophosphodiradylglycerols [GP1208]'='LION:0000948',
+ 'monoalkylglycerophosphoglycerophosphomonoradylglycerols [GP1209]'='LION:0000949',
+ '1z-alkenylglycerophosphoglycerophosphodiradylglycerols [GP1210]'='LION:0000950',
+ '1z-alkenylglycerophosphoglycerophosphomonoradylglycerols [GP1211]'='LION:0000951'),
+ 'cdp-glycerols [GP13]'='LION:0000022',
+ 'glycosylglycerophospholipids [GP14]'='LION:0000023',
+ 'glycerophosphoinositolglycans [GP15]'='LION:0000024',
+ 'glycerophosphonocholines [GP16]'='LION:0000025',
+ 'glycerophosphonoethanolamines [GP17]'='LION:0000026',
+ 'di-glycerol tetraether phospholipids (caldarchaeols) [GP18]'='LION:0000027',
+ 'glycerol-nonitol tetraether phospholipids [GP19]'='LION:0000028',
+ 'oxidized glycerophospholipids [GP20]'='LION:0000029',
+ 'lysoglycerophospholipids'=
+ list('monoacylglycerophosphocholines [GP0105]'='LION:0000034',
+ 'monoacylglycerophosphoethanolamines [GP0205]'='LION:0000042',
+ 'monoacylglycerophosphoinositols [GP0605]'='LION:0000046',
+ 'monoacylglycerophosphoserines [GP0305]'='LION:0000056',
+ 'monoacylglycerophosphoglycerols [GP0405]'='LION:0000063',
+ 'monoacylglycerophosphates [GP1005]'='LION:0000072')),
+ 'sphingolipids [SP]'=
+ list('other sphingolipids [SP00]'='LION:0000075',
+ 'sphingoid bases [SP01]'='LION:0000076',
+ 'ceramides [SP02]'='LION:0000077',
+ 'phosphosphingolipids [SP03]'=
+ list('ceramide phosphocholines (sphingomyelins) [SP0301]'='LION:0000084',
+ 'ceramide phosphoethanolamines [SP0302]'='LION:0000085',
+ 'ceramide phosphoinositols [SP0303]'='LION:0000086'),
+ 'phosphonosphingolipids [SP04]'='LION:0000079',
+ 'neutral glycosphingolipids [SP05]'=
+ list('other neutral glycosphingolipids [SP0500]'='LION:0000452',
+ 'simple glc series [SP0501]'='LION:0000453',
+ 'galnacbeta1-3galalpha1-4galbeta1-4glc- (globo series) [SP0502]'='LION:0000454',
+ 'galnacbeta1-4galbeta1-4glc- (ganglio series) [SP0503]'='LION:0000455',
+ 'galbeta1-3glcnacbeta1-3galbeta1-4glc- (lacto series) [SP0504]'='LION:0000456',
+ 'galbeta1-4glcnacbeta1-3galbeta1-4glc- (neolacto series) [SP0505]'='LION:0000457',
+ 'galnacbeta1-3galalpha1-3galbeta1-4glc- (isoglobo series) [SP0506]'='LION:0000458',
+ 'glcnacbeta1-2manalpha1-3manbeta1-4glc- (mollu series) [SP0507]'='LION:0000459',
+ 'galnacbeta1-4glcnacbeta1-3manbeta1-4glc- (arthro series) [SP0508]'='LION:0000460',
+ 'gal- (gala series) [SP0509]'='LION:0000461'),
+ 'acidic glycosphingolipids [SP06]'=
+ list('gangliosides [SP0601]'='LION:0000087',
+ 'sulfoglycosphingolipids (sulfatides) [SP0602]'='LION:0000088',
+ 'glucuronosphingolipids [SP0603]'='LION:0000089',
+ 'phosphoglycosphingolipids [SP0604]'='LION:0000090'),
+ 'basic glycosphingolipids [SP07]'='LION:0000082',
+ 'amphoteric glycosphingolipids [SP08]'='LION:0000083'),
+ 'sterol lipids [ST]'=
+ list('other sterol lipids [ST00]'='LION:0000556',
+ 'sterols [ST01]'=
+ list('cholesterol and derivatives [ST0101]'=
+ list('cholesterol'='LION:0000541',
+ 'cholestenone'='LION:0000553',
+ 'oxysterol'='LION:0000600'),
+ 'steryl esters [ST0102]'='LION:0000563',
+ 'ergosterols and c24-methyl derivatives [ST0103]'='LION:0000564',
+ 'stigmasterols and c24-ethyl derivatives [ST0104]'='LION:0000565',
+ 'c24-propyl sterols and derivatives [ST0105]'='LION:0000566',
+ 'gorgosterols and derivatives [ST0106]'='LION:0000567',
+ 'furostanols and derivatives [ST0107]'='LION:0000568',
+ 'spirostanols and derivatives [ST0108]'='LION:0000569',
+ 'furospirostanols and derivatives [ST0109]'='LION:0000570',
+ 'cycloartanols and derivatives [ST0110]'='LION:0000571',
+ 'calysterols and cyclopropyl sidechain derivatives [ST0111]'='LION:0000572',
+ 'cardanolides and derivatives [ST0112]'='LION:0000573',
+ 'bufanolides and derivatives [ST0113]'='LION:0000574',
+ 'brassinolides and derivatives [ST0114]'='LION:0000575',
+ 'solanidines and alkaloid derivatives [ST0115]'='LION:0000576',
+ 'withanolides and derivatives [ST0116]'='LION:0000577'),
+ 'steroids [ST02]'='LION:0000558',
+ 'secosteroids [ST03]'='LION:0000559',
+ 'bile acids and derivatives [ST04]'='LION:0000560',
+ 'steroid conjugates [ST05]'='LION:0000561'),
+ 'prenol lipids [PR]'=
+ list('isoprenoids [PR01]'=
+ list('C5 isoprenoids (hemiterpenes) [PR0101]'='LION:0012013',
+ 'C10 isoprenoids (monoterpenes) [PR0102]'='LION:0012014',
+ 'C15 isoprenoids (sesquiterpenes) [PR0103]'='LION:0012015',
+ 'C20 isoprenoids (diterpenes) [PR0104]'='LION:0012016',
+ 'C25 isoprenoids (sesterterpenes) [PR0105]'='LION:0012019',
+ 'C30 isoprenoids (triterpenes) [PR0106]'='LION:0012020',
+ 'C40 isoprenoids (tetraterpenes) [PR0107]'='LION:0012021',
+ 'polyterpenes [PR0108]'='LION:0012022',
+ 'retinoids [PR0109]'=
+ list('all-trans-retinol'='LION:0012044',
+ '9-cis-retinol'='LION:0012045',
+ '13-cis-retinol'='LION:0012046',
+ 'all-trans-retinal'='LION:0012047',
+ '9-cis-retinal'='LION:0012048',
+ '13-cis-retinal'='LION:0012049',
+ 'all-trans-retinoic acid'='LION:0012050',
+ '9-cis-retinoic acid'='LION:0012054',
+ '13-cis-retinoic acid'='LION:0012055',
+ 'all-trans-retinyl esters'='LION:0012056')),
+ 'quinones and hydroquinones [PR02]'=
+ list('ubiquinones [PR0201]'='LION:0012025',
+ 'vitamin E [PR0202]'='LION:0012026',
+ 'vitamin K [PR0203]'='LION:0012027'),
+ 'polyprenols [PR03]'=
+ list('bactoprenols [PR0301]'='LION:0012029',
+ 'bactoprenol monophosphates [PR0302]'='LION:0012030',
+ 'bactoprenol diphosphates [PR0303]'='LION:0012035',
+ 'phytoprenols [PR0304]'='LION:0012036',
+ 'phytoprenol monophosphates [PR0305]'='LION:0012037',
+ 'phytoprenol diphosphates [PR0306]'='LION:0012038',
+ 'dolichols [PR0307]'='LION:0012039',
+ 'dolichol monophosphates [PR0308]'='LION:0012040',
+ 'dolichol diphosphates [PR0309]'='LION:0012041'),
+ 'hopanoids [PR04]'='LION:0012042',
+ 'other prenol lipids [PR00]'='LION:0012043'),
+ 'saccharolipids [SL]'='LION:0000007',
+ 'polyketides [PK]'='LION:0000008'),
+ 'physical or chemical properties'=
+ list('charge headgroup'=
+ list('headgroup with negative charge'='LION:0000093',
+ 'headgroup with neutral charge'='LION:0000094',
+ 'headgroup with positive charge / zwitter-ion'='LION:0000095'),
+ 'contains fatty acid'=
+ list('C12:0'='LION:0000254',
+ 'C13:0'='LION:0022223',
+ 'C14:0'='LION:0000259',
+ 'C14:1'='LION:0000462',
+ 'C15:0'='LION:0022229',
+ 'C15:1'='LION:0022230',
+ 'C16:0'='LION:0002882',
+ 'C16:1'='LION:0002900',
+ 'C17:0'='LION:0022231',
+ 'C17:1'='LION:0022234',
+ 'C17:2'='LION:0022236',
+ 'C18:0'='LION:0002921',
+ 'C18:1'='LION:0002922',
+ 'C18:2'='LION:0002923',
+ 'C18:3'='LION:0002924',
+ 'C19:0'='LION:0022241',
+ 'C19:1'='LION:0022242',
+ 'C19:2'='LION:0022245',
+ 'C19:3'='LION:0022247',
+ 'C20:0'='LION:0002925',
+ 'C20:1'='LION:0002926',
+ 'C20:2'='LION:0002927',
+ 'C20:3'='LION:0002928',
+ 'C20:4'='LION:0002929',
+ 'C20:5'='LION:0002930',
+ 'C21:0'='LION:0022261',
+ 'C21:1'='LION:0022262',
+ 'C21:2'='LION:0022263',
+ 'C21:3'='LION:0022264',
+ 'C21:4'='LION:0022265',
+ 'C22:0'='LION:0002931',
+ 'C22:1'='LION:0002932',
+ 'C22:2'='LION:0002933',
+ 'C22:3'='LION:0002934',
+ 'C22:4'='LION:0002935',
+ 'C22:5'='LION:0002936',
+ 'C22:6'='LION:0002937',
+ 'C23:0'='LION:0022266',
+ 'C23:1'='LION:0022267',
+ 'C23:2'='LION:0022268',
+ 'C23:3'='LION:0022269',
+ 'C23:4'='LION:0022270',
+ 'C23:5'='LION:0022271',
+ 'C24:0'='LION:0002938',
+ 'C24:1'='LION:0002939',
+ 'C24:2'='LION:0002940',
+ 'C24:3'='LION:0002941',
+ 'C24:4'='LION:0002942',
+ 'C24:5'='LION:0002943',
+ 'C24:6'='LION:0002944',
+ 'C25:0'='LION:0022272',
+ 'C25:1'='LION:0022273',
+ 'C25:2'='LION:0022274',
+ 'C25:3'='LION:0022275',
+ 'C25:4'='LION:0022276',
+ 'C25:5'='LION:0022277',
+ 'C25:6'='LION:0022278',
+ 'C25:7'='LION:0022279',
+ 'C26:0'='LION:0002979',
+ 'C26:1'='LION:0002981',
+ 'C26:2'='LION:0002982',
+ 'C26:3'='LION:0002983',
+ 'C26:4'='LION:0002984',
+ 'C26:5'='LION:0002985',
+ 'C26:6'='LION:0002986',
+ 'C26:7'='LION:0002987',
+ 'd18:1 (sphingosine)'='LION:0080947',
+ 'd18:0 (dihydrosphingosine)'='LION:0080948'),
+ 'type by bond'=
+ list('contains ether-bond'='LION:0000467',
+ 'contains vinyl ether bond (plasmalogen)'='LION:0001734'),
+ 'intrinsic curvature'=
+ list('negative intrinsic curvature'='LION:0000464',
+ 'neutral intrinsic curvature'='LION:0000465',
+ 'positive intrinsic curvature'='LION:0000466'),
+ 'chain-melting transition temperature'=
+ list('average transition temperature'='LION:0001737',
+ 'above average transition temperature'=
+ list('high transition temperature'='LION:0001738',
+ 'very high transition temperature'='LION:0001739'),
+ 'below average transition temperature'=
+ list('very low transition temperature'='LION:0001735',
+ 'low transition temperature'='LION:0001736')),
+ 'fatty acid unsaturation'=
+ list('fatty acid with less than 2 double bonds'=
+ list('saturated fatty acid'='LION:0002968',
+ 'monounsaturated fatty acid'='LION:0002969'),
+ 'polyunsaturated fatty acid'=
+ list('fatty acid with 2 double bonds'='LION:0002970',
+ 'fatty acid with more than 3 double bonds'=
+ list('fatty acid with 3-5 double bonds'=
+ list('fatty acid with 3 double bonds'='LION:0002971',
+ 'fatty acid with 4 double bonds'='LION:0002972',
+ 'fatty acid with 5 double bonds'='LION:0002973')),
+ 'fatty acid with more than 5 double bonds'=
+ list('fatty acid with 6 double bonds'='LION:0002974',
+ 'fatty acid with 7 double bonds'='LION:0002975'))),
+ 'fatty acid chain length'=
+ list('fatty acid with 18 carbons or less'=
+ list('fatty acid with less than 13 carbons'=
+ list('fatty acid with 12 carbons'='LION:0002980'),
+ 'fatty acid with 13-15 carbons'=
+ list('fatty acid with 13 carbons'='LION:0002952',
+ 'fatty acid with 14 carbons'='LION:0002953',
+ 'fatty acid with 15 carbons'='LION:0002954'),
+ 'fatty acid with 16-18 carbons'=
+ list('fatty acid with 16 carbons'='LION:0002955',
+ 'fatty acid with 17 carbons'='LION:0002956',
+ 'fatty acid with 18 carbons'='LION:0002957')),
+ 'fatty acid with more than 18 carbons'=
+ list('fatty acid with 19-21 carbons'=
+ list('fatty acids with 19 carbons'='LION:0002958',
+ 'fatty acid with 20 carbons'='LION:0002959',
+ 'fatty acid with 21 carbons'='LION:0002960'),
+ 'fatty acid with 22-24 carbons'=
+ list('fatty acid with 22 carbons'='LION:0002961',
+ 'fatty acid with 23 carbons'='LION:0002962',
+ 'fatty acid with 24 carbons'='LION:0002963'),
+ 'fatty acid with more than 24 carbons'=
+ list('fatty acid with 25 carbons'='LION:0002964',
+ 'fatty acid with 26 carbons'='LION:0002965'))),
+ 'lateral diffusion'=
+ list('average lateral diffusion'='LION:0080978',
+ 'below average lateral diffusion'=
+ list('very low lateral diffusion'='LION:0080976',
+ 'low lateral diffusion'='LION:0080977'),
+ 'above average lateral diffusion'=
+ list('high lateral diffusion'='LION:0080979',
+ 'very high lateral diffusion'='LION:0080980')),
+ 'bilayer thickness'=
+ list('average bilayer thickness'='LION:0080970',
+ 'below average bilayer thickness'=
+ list('very low bilayer thickness'='LION:0080968',
+ 'low bilayer thickness'='LION:0080969'),
+ 'above average bilayer thickness'=
+ list('high bilayer thickness'='LION:0080971',
+ 'very high bilayer thickness'='LION:0080972'))))
+
+
+LIONstructure <-
+ rapply(LIONstructure, function(element){
+ newelement <- element
+ attr(newelement, 'stselected') <- FALSE
+ newelement
+ }, how = ""list"")
+
+","R"