DavisLaboratory / standR

Spatial transcriptomics analyses and decoding in R
https://davislaboratory.github.io/standR/
Other
18 stars 4 forks source link

plotScreePCA and plotPCAbiplot with reducedDim #13

Closed joonlee3 closed 1 year ago

joonlee3 commented 1 year ago

Hi,

When I ran plotScreePCA or plotPCAbiplot with a precomputed dimensional reduction, I've got an error. `

spe <- scater::runPCA(spe) pca.results <- reducedDim(spe, "PCA") plotPCA <- drawPCA(spe, precomputed=pca.results, col=Annotation, shape=SlideName) plotScreePCA(spe, precomputed=pca_results) Error in checkPrecomputedPCA(spe_object, precomputed) : all(rownames(pcdata) == colnames(object)) is not TRUE In addition: Warning message: In rownames(pcdata) == colnames(object) : longer object length is not a multiple of shorter object length ` Any suggestions? Thanks.

Best, Joon

ningbioinfo commented 1 year ago

Hi Joon, I think what you want is plotScreePCA(spe, precomputed=pca.results). Apparently you have an object named pca_results that has different dimension than the spe.