Skip to content
Snippets Groups Projects
Commit d139bfd5 authored by Zhiyu Zhao's avatar Zhiyu Zhao
Browse files

08302024

parent 4a573f8e
No related merge requests found
No preview for this file type
......@@ -31,7 +31,7 @@ CalculateOraScore1 <- function(mSetObj=NA, nodeImp, method){
}
q.size<-length(ora.vec);
if(is.na(ora.vec) || q.size==0) {
if(q.size==0) { #Removed "|| is.na(ora.vec)" by ZZY on 7/31/24.
if(mSetObj$pathwaylibtype == "KEGG"){
AddErrMsg("No valid KEGG compounds found!");
} else if(mSetObj$pathwaylibtype == "SMPDB"){
......
......@@ -26,7 +26,7 @@ CalculateHyperScore1 <- function(mSetObj=NA){
q.size<-length(ora.vec);
if(is.na(ora.vec) || q.size==0) {
if(q.size==0) { #Removed "|| is.na(ora.vec)" by ZZY on 7/31/24.
AddErrMsg("No valid HMDB compound names found!");
return(0);
}
......
No preview for this file type
No preview for this file type
......@@ -94,31 +94,32 @@ if (odaObj$attributes$nInterestedFeatures>0) {
rowOffset=rowOffset+odaObj$attributes$nInterestedFeatures+3
wbObj=writeTable(wbObj,'Selected_Features',odaObj$presentGroups[odaObj$features$interested,,drop=F],'Group_Counts',odaObj$featureDescription,rowOffset,0)
}
##############################End Writing Selected Features#####################################
##############################Begin MSEA-ORA Analysis by MetaboAnalyst#####################################
if (odaObj$parameters$oraMethod=='msea-ora'&&odaObj$parameters$eaDB!='no'&&!is.null(odaObj$features$eaMetabolites)) {
eaPath=file.path(odaObj$eaPath,paste0(odaObj$parameters$eaDB,'_MSEA-ORA'))
if (file.exists(eaPath)&&!rlang::is_empty(dir(eaPath))) {
stop('ORA folder is not empty.')
} else {
dir.create(eaPath,recursive=T,showWarnings=F)
MSEA_ORA(file.path(eaPath,'msea_ora'),rownames(odaObj$features$eaMetabolites),odaObj$features$refMetabolites,idType=odaObj$features$eaMetaboliteIDType,dbType=odaObj$parameters$eaDB,lipid=(odaObj$parameters$featureType=='lipid'),eaFile=odaObj$parameters$eaFile)
}
if (odaObj$parameters$oraMethod=='msea-ora'&&odaObj$parameters$eaDB!='no'&&!is.null(odaObj$features$eaMetabolites)) {
eaPath=file.path(odaObj$eaPath,paste0(odaObj$parameters$eaDB,'_MSEA-ORA'))
if (file.exists(eaPath)&&!rlang::is_empty(dir(eaPath))) {
stop('ORA folder is not empty.')
} else {
dir.create(eaPath,recursive=T,showWarnings=F)
MSEA_ORA(file.path(eaPath,'msea_ora'),rownames(odaObj$features$eaMetabolites),odaObj$features$refMetabolites,idType=odaObj$features$eaMetaboliteIDType,dbType=odaObj$parameters$eaDB,lipid=(odaObj$parameters$featureType=='lipid'),eaFile=odaObj$parameters$eaFile)
}
}
##############################End MSEA-ORA Analysis by MetaboAnalyst#####################################
##############################Begin MSPA-ORA Analysis by MetaboAnalyst#####################################
if (odaObj$parameters$oraMethod=='mspa-ora'&&odaObj$parameters$eaDB!='no'&&!is.null(odaObj$features$eaMetabolites)) {
eaPath=file.path(odaObj$eaPath,paste0(odaObj$parameters$eaDB,'_MSPA-ORA'))
if (file.exists(eaPath)&&!rlang::is_empty(dir(eaPath))) {
stop('ORA folder is not empty.')
} else {
dir.create(eaPath,recursive=T,showWarnings=F)
MSPA_ORA(file.path(eaPath,'mspa_ora'),rownames(odaObj$features$eaMetabolites),odaObj$features$refMetabolites,idType=odaObj$features$eaMetaboliteIDType,dbType=odaObj$parameters$eaDB,odaObj$parameters$species,eaFile=odaObj$parameters$eaFile)
}
if (odaObj$parameters$oraMethod=='mspa-ora'&&odaObj$parameters$eaDB!='no'&&!is.null(odaObj$features$eaMetabolites)) {
eaPath=file.path(odaObj$eaPath,paste0(odaObj$parameters$eaDB,'_MSPA-ORA'))
if (file.exists(eaPath)&&!rlang::is_empty(dir(eaPath))) {
stop('ORA folder is not empty.')
} else {
dir.create(eaPath,recursive=T,showWarnings=F)
MSPA_ORA(file.path(eaPath,'mspa_ora'),rownames(odaObj$features$eaMetabolites),odaObj$features$refMetabolites,idType=odaObj$features$eaMetaboliteIDType,dbType=odaObj$parameters$eaDB,odaObj$parameters$species,eaFile=odaObj$parameters$eaFile)
}
##############################End MSPA-ORA Analysis by MetaboAnalyst#####################################
}
##############################End Writing Selected Features#####################################
##############################End MSPA-ORA Analysis by MetaboAnalyst#####################################
##############################Begin JointPA Analysis by MetaboAnalyst#####################################
if ((!is.null(odaObj$features$eaMetabolites)||!is.null(odaObj$features$eaGenes))&&odaObj$parameters$jointPA!='no') {
......
File moved
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment