Andres Suarez

Generation

generate functionWed, 07 Jun 2023

I can find out if the compounds I have in a list belong to an organism using Keggrest.

list_of_compounds = list(c('C00001', 'C00002', 'C00003', 'C00004')) get_compound_belongs_to <- function(compound) { url <- paste('https://www.genome.jp/dbget-bin/www_bget?-f+m+cpd:', compound, sep="") page <- read_html(url) node <- html_node(page, '#pathway_tab_1 > ul > li > a') text <- html_text(node) return(text) } get_compound_belongs_to(list_of_compounds)

Want to kickstart your project?Use the new AI Studio to create your code