lanagarmire / lilikoi2

GNU General Public License v3.0
2 stars 4 forks source link

lilikoi.PDSfun() pathifier input #4

Open kohlkopf opened 3 years ago

kohlkopf commented 3 years ago

In regards to the function lilikoi.PDSfun() where pathifier::quantify_pathways_deregulation() is called.

Where do the objects metabolites.list and pathways.list come from? It appears they are global variables imported in the script lilikoi.globals.R.

function (qvec) {Metadata$Label <- as.factor(Metadata$Label) phe = (Metadata$Label) %>% as.numeric %>% -1 newData1 = qvec %>% filter(pathway != "NA") %>% select(Query, HMDB) newData = Metadata[, t(newData1["Query"])] colnames(newData) = t(newData1["HMDB"]) newData = t(newData) PDS <- quantify_pathways_deregulation(as.matrix(newData), row.names(newData), metabolites.list, pathway.list, as.logical(phe), attempts = 5, min_exp = 0, min_std = 0) qpdmat <- matrix(as.data.frame(PDS$scores), nrow = length(names(PDS$scores)), byrow = TRUE) colnames(qpdmat) <- colnames(newData) rownames(qpdmat) <- names(PDS$scores) mode(qpdmat) <- "numeric" return(qpdmat) }

vmonbet commented 2 years ago

Same question for the function lilikoi.meta_path : Where does the object metabolites.list come from?

An error occurs when one uses the function...

lanagarmire commented 2 years ago

What error did you encounter? metabolites.list is an internal dataset, containing the metabolites information. It is declared globally, so there should be no problem using the functions directly.

If you want to access and modify this particular data, you can (1) directly access this in R usinglilikoi:::metabolites.list command, or (2) download sysdata.rdata from github and load it into R. Link: https://github.com/lanagarmire/lilikoi2/blob/master/R/sysdata.rda

vmonbet commented 2 years ago

Thank you for your fast and efficient response.