Open kohlkopf opened 3 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...
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
Thank you for your fast and efficient response.
In regards to the function
lilikoi.PDSfun()
wherepathifier::quantify_pathways_deregulation()
is called.Where do the objects
metabolites.list
andpathways.list
come from? It appears they are global variables imported in the scriptlilikoi.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)
}