Andres Suarez

Generation

generate functionWed, 07 Jun 2023

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) }

function that: library(msigdb) msig_genes <- function(msig, db=GREAT_HG19) { genes <- NULL for (i in msig) { tryCatch({ res <- db[i]$genes }, warning = function(warn) { res <- NULL }) genes <- append(genes, res) } return(genes) }

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