Skip to content

Commit

Permalink
New vignette - meta ms peaks!
Browse files Browse the repository at this point in the history
  • Loading branch information
jsychong committed Nov 18, 2020
1 parent f603a56 commit 57e0abe
Show file tree
Hide file tree
Showing 27 changed files with 14,356 additions and 151 deletions.
2 changes: 2 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ Suggests:
devtools,
testthat,
plotly,
visnetwork,
ggraph,
reshape2,
RSclient,
MSnbase,
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ export(PlotKmeans)
export(PlotLoadingCmpd)
export(PlotMBTimeProfile)
export(PlotMSEA.Overview)
export(PlotMSPeaksCpdEcpdNetwork)
export(PlotMSPeaksPerm)
export(PlotMetaVenn)
export(PlotMetpaPath)
Expand Down Expand Up @@ -292,6 +293,7 @@ export(PlotPLSLoading)
export(PlotPLSPairSummary)
export(PlotPathSummary)
export(PlotPathwayMZHits)
export(PlotPathwayMetaAnalysis)
export(PlotPeaks2Paths)
export(PlotPowerProfile)
export(PlotPowerStat)
Expand Down
2 changes: 1 addition & 1 deletion R/enrich_name_match.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#'@export

CrossReferencing <- function(mSetObj=NA, q.type, hmdb=T, pubchem=T, chebi=F, kegg=T, metlin=F){

mSetObj <- .get.mSet(mSetObj);

# record the filter for 8 major databases
Expand Down
14 changes: 6 additions & 8 deletions R/enrich_path_stats.R
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,12 @@ GetORA.pathNames <- function(mSetObj=NA){

# contains three inner functions to be compatible with microservice
CalculateQeaScore <- function(mSetObj=NA, nodeImp, method){

mSetObj <- .get.mSet(mSetObj);
mSetObj <- .prepare.qea.score(mSetObj, nodeImp, method); # on local, everything is done

if(.on.public.web){
.perform.computing();
mSetObj <- .save.qea.score(mSetObj);
}
mSetObj <- .prepare.qea.score(mSetObj, nodeImp, method); # on local, everything is done
.perform.computing();
mSetObj <- .save.qea.score(mSetObj);

return(.set.mSet(mSetObj));
}
Expand Down Expand Up @@ -233,7 +231,7 @@ CalculateQeaScore <- function(mSetObj=NA, nodeImp, method){

names(univ.p) <- colnames(path.data);

if(!.on.public.web & mSetObj$pathwaylibtype == "KEGG"){
if(!.on.public.web & mSetObj$pathwaylibtype == "KEGG" & !exists("current.kegglib")){
mSetObj$api$nodeImp <- nodeImp;
mSetObj$api$method <- method;
mSetObj$api$pathDataColNms <- colnames(path.data)
Expand Down Expand Up @@ -296,7 +294,7 @@ CalculateQeaScore <- function(mSetObj=NA, nodeImp, method){
mSetObj$analSet$qea.filtered.mset <- current.mset;
uniq.count <- length(unique(unlist(current.mset), use.names=FALSE));
}

hits <- lapply(current.mset, function(x) {x[x %in% colnames(path.data)]});
hit.inx <- unlist(lapply(hits, function(x) {length(x)}), use.names=FALSE) > 0;
hits <- hits[hit.inx]; # remove no hits
Expand Down
4 changes: 2 additions & 2 deletions R/enrich_stats.R
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ CalculateGlobalTestScore <- function(mSetObj=NA){
msea.data <- mSetObj$dataSet$norm[,hit.inx];
colnames(msea.data) <- nm.map$hmdb[hmdb.inx[hit.inx]];

if(!.on.public.web & grepl("kegg", mSetObj$analSet$msetlibname)){
if(!.on.public.web & grepl("kegg", mSetObj$analSet$msetlibname) & !exists("current.msetlib")){

mSetObj$api$mseaDataColNms <- colnames(msea.data)
msea.data <- as.matrix(msea.data)
Expand Down Expand Up @@ -243,7 +243,7 @@ CalculateGlobalTestScore <- function(mSetObj=NA){
}

set.num <- unlist(lapply(current.mset, length), use.names = FALSE);

# first, get the matched entries from current.mset
hits <- lapply(current.mset, function(x){x[x %in% colnames(msea.data)]});
phenotype <- mSetObj$dataSet$cls;
Expand Down
2 changes: 1 addition & 1 deletion R/general_misc_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ UnzipUploadedFile<-function(inPath, outPath, rmFile=T){
#'

CleanData <-function(bdata, removeNA=T, removeNeg=T, removeConst=T){

if(sum(bdata==Inf, na.rm=TRUE)>0){
inx <- bdata == Inf;
bdata[inx] <- NA;
Expand Down
2 changes: 1 addition & 1 deletion R/general_proc_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ FilterVariable <- function(mSetObj=NA, filter, qcFilter, rsd){
msg <- paste(msg, "Further feature filtering based on", nm);

if(mSetObj$analSet$type == "mummichog"){
max.allow <- 10000;
max.allow <- 5000;
}else if(mSetObj$analSet$type == "power"){
max.allow <- 5000;
}else{
Expand Down
Loading

0 comments on commit 57e0abe

Please sign in to comment.