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.

library(keggrest) find_organism <- function(compounds) { organism <- NULL for (i in compounds) { tryCatch({ res <- kegg_search(i)$org }, warning = function(warn) { res <- NULL }) organism <- append(organism, res) } organism <- unique(organism) }

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