xia-lab / MetaboAnalystR

R package for MetaboAnalyst
Other
321 stars 158 forks source link

Error in PlotPCA3DScoreImg(mSet, "pca_score3d_0_", "png", 72, width = NA, :) Object 'cols' not found #315

Open EugeneAeolus opened 3 months ago

EugeneAeolus commented 3 months ago

Load MetaboAnalystR

library(MetaboAnalystR)

Clean global environment

rm(list = ls()) setwd("D:/MetaboAnalystR/PJ4")

mSet<-InitDataObjects("conc", "stat", FALSE); mSet<-Read.TextData(mSet, "https://rest.xialab.ca/api/download/metaboanalyst/human_cachexia.csv", "rowu", "disc"); mSet<-SanityCheckData(mSet); mSet<-ReplaceMin(mSet); mSet<-PreparePrenormData(mSet); mSet<-Normalization(mSet, "NULL", "LogNorm", "MeanCenter", "S10T0", ratio=FALSE, ratioNum=20); mSet<-PlotNormSummary(mSet, "norm0", format ="png", dpi=72, width=NA); mSet<-PlotSampleNormSummary(mSet, "snorm0", format = "png", dpi=72, width=NA);

Perform fold-change analysis on uploaded data, unpaired

mSet<-FC.Anal(mSet, 2.0, 0, FALSE) mSet<-PlotFC(mSet, "fc0", "png", 72, width=NA)

Perform T-test (parametric)

mSet<-Ttests.Anal(mSet, nonpar=F, threshp=0.05, paired=FALSE, equal.var=TRUE, "fdr", TRUE)

Plot of the T-test results

mSet<-PlotTT(mSet, imgName = "tt0", format = "png", dpi = 72, width=NA)

Perform the volcano analysis

mSet<-Volcano.Anal(mSet, FALSE, 2.0, 0, F, 0.1, TRUE, "raw")

Create the volcano plot

mSet<-PlotVolcano(mSet, "volcano0", 1, 0, format ="png", dpi=72, width=NA)

OPTION 1 - Heatmap specifying pearson distance and an overview

mSet<-PlotCorrHeatMap(mSet, "corr0", "png", 72, width=NA, "col", "pearson", "bwm", "overview", FALSE, FALSE, 0.0)

OPTION 2 - Heatmap specifying pearson correlation and a detailed view

mSet<-PlotCorrHeatMap(mSet, "corr1", format = "png", dpi=72, width=NA, "col", "spearman", "bwm", "detail", F, F, 999)

Perform correlation analysis on a pattern (a feature of interest in this case)

mSet<-FeatureCorrelation(mSet, "pearson", "1,6-Anhydro-beta-D-glucose")

Plot the correlation analysis on a pattern

mSet<-PlotCorr(mSet, "ptn3", format="png", dpi=72, width=NA)

Perform PCA analysis

mSet<-PCA.Anal(mSet)

Create PCA overview

mSet<-PlotPCAPairSummary(mSet, "pca_pair0", format = "png", dpi = 72, width=NA, 5)

Create PCA scree plot

mSet<-PlotPCAScree(mSet, "pca_scree0", "png", dpi = 72, width=NA, 5)

Create a 2D PCA score plot

mSet<-PlotPCA2DScore(mSet, "pca_score2d0", format = "png", dpi=72, width=NA, 1, 2, 0.95, 1, 0)

Create a PCA loadings Plots

mSet<-PlotPCALoading(mSet, "pca_loading0", "png", 72, width=NA, 1,2);

Create a PCA Biplot

mSet<-PlotPCABiplot(mSet, "pca_biplot0", format = "png", dpi = 72, width=NA, 1, 2)

Create a 3D PCA score plot

mSet<-PlotPCA3DScoreImg(mSet, "pca_score3d0", "png", 72, width=NA, 1,2,3, 40)

View the 3D interactive PLS-DA score plot

mSet$imgSet$pca.3d

code is above, PCA_2d is normal, PCA_3d raised an error as title.

EugeneAeolus commented 3 months ago

Perform hierarchical clustering and plot dendogram

mSet<-PlotHCTree(mSet, "tree0", format = "png", dpi=72, width=NA, "euclidean", "ward.D")

Perform hierarchical clustering and plot heat map

mSet<-PlotHeatMap(mSet, "heatmap0", "png", 72, width=NA, "norm", "row", "euclidean", "ward.D","bwm", 8, "overview", T, T, NULL, T, F, T, T, T)

and in code above, only creat 'tree_0_dpi72.png' and 'heatmap0.json', it seems not creat heatmap.png