songw01 / MEGENA

Multiscale embedded gene co-expression network analysis
GNU General Public License v3.0
48 stars 16 forks source link

calculate.correlation object is empty #3

Closed Gorman222 closed 4 years ago

Gorman222 commented 5 years ago

Hello,

When I enter my RNA expression matrix in the calculate.correlation function, it is returning a data frame of 3 columns (row, col, rho) with "No data available in table". The data is from the @ data portion of a Seurat S4 object and is in a matrix class object. I have checked the formatting and it is the same as the toy data set included in the package except that my data set contains many many more zeroes.

SeuratData <- as.matrix(Seurat@data) ijw <- calculate.correlation(SeuratData , doPerm = 10, doPar = TRUE, num.cores = 4)

I get 12 warnings:

Warning messages: 1: In cor(datExpr, method = estimator) : the standard deviation is zero 2: In cor(datExpr, datExpr[perm.ind[[i]], ], method = estimator) : the standard deviation is zero 3: In cor(datExpr, datExpr[perm.ind[[i]], ], method = estimator) : the standard deviation is zero 4: In cor(datExpr, datExpr[perm.ind[[i]], ], method = estimator) : the standard deviation is zero 5: In cor(datExpr, datExpr[perm.ind[[i]], ], method = estimator) : the standard deviation is zero 6: In cor(datExpr, datExpr[perm.ind[[i]], ], method = estimator) : the standard deviation is zero 7: In cor(datExpr, datExpr[perm.ind[[i]], ], method = estimator) : the standard deviation is zero 8: In cor(datExpr, datExpr[perm.ind[[i]], ], method = estimator) : the standard deviation is zero 9: In cor(datExpr, datExpr[perm.ind[[i]], ], method = estimator) : the standard deviation is zero 10: In cor(datExpr, datExpr[perm.ind[[i]], ], method = estimator) : the standard deviation is zero 11: In cor(datExpr, datExpr[perm.ind[[i]], ], method = estimator) : the standard deviation is zero 12: In min(FDR.table$cut.off[FDR.table$FDR < FDR.cutoff]) : no non-missing arguments to min; returning Inf

Please let me know if I am doing something wrong, thank you.

songw01 commented 5 years ago

Hi Gorman,

Sorry for late response. I am kinda new to Github stuff, and still adjusting. For your stuff, it seems that your matrix has a lot of missing values/identical values. The 'standard deviation is zero' message seems to come from these issues. Since you mentioned 'Suerat', I assume you are doing single cell stuff, and you do need to rule out genes with missing expressions across most of samples. I suggest that you allow upto 20% missing rate across the samples to filter out genes, and run the analysis.

Gorman222 commented 5 years ago

Thank you for the response. Should the filtering be done before implementing MEGENA or is there a function or argument that will allow to me to do it within the package? Thanks

songw01 commented 5 years ago

You should filter, prior to MEGENA.