enter image description here
I am trying to plot a pheatmap using the input i get from the correlation. However after getting the correlation matrix i see that my dataset consist of NA’s. I went on to check the count martix and the seurat assay data to see if there were NA’s in them but it showed that there was 0 NA’s.
After this i tried using the function use = “complete.obs” as seen in a previous post to fix the issues of the NA’s but still encountered.
Below is the code i ran
# Get assay data
gene.norm.counts <- GetAssayData(test_seurat, assay = "RNA", slot = "data")
# Transpose the matrix
gene.norm.counts <- t(gene.norm.counts)
# Keep row and column names consistent
colnames(gene.norm.counts) <- rownames(test_seurat)
rownames(gene.norm.counts) <- colnames(test_seurat)
# Get cell_type and pseudotime values
cell_type.pseudotime <- FetchData(test_seurat, vars = c("cell_type","p3.pseudotime"))
# Get the pseudotime ordered cell-barcodes
barcode.order <- rownames(cell_type.pseudotime[order(cell_type.pseudotime$p3.pseudotime), ])
# Re-order our count matrix
gene.norm.counts <- gene.norm.counts[barcode.order, ]
# Convert object to matrix
gene.norm.counts <- as.matrix(gene.norm.counts)
#compute the correlation matrix
gene.pseudotime.correlations <- cor(gene.norm.counts)
Please can anyone help me out to sort out this issue.
I have tried rerunning the code severally but i still encounter same issue.
Happiness Eric is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1