Entering edit mode
12 weeks ago
aackermann287
•
0
Hi all,
I'm driving myself up a wall with this one. I am looking to make a heatmap for a selected group of differential genes. I successfully created a heatmap of top 500 genes using this data with the following code:
topVarGenes <- head(order(rowVars(vst), decreasing = TRUE), 500)
mat <- vst[ topVarGenes, ]
mat <- mat - rowMeans(mat)
anno <- as.data.frame(colData(atacDDS)[c("Group")])
pheatmap(mat, annotation_col = anno, show_rownames=FALSE)
When I try to make a heatmap with selected genes using the following code, I get the below error:
selectGene <- c( "ID_chr2_33134006_33135625" ,"ID_chr9_115087304_115087749", "..")
dataSub <- mat[rownames(mat) %in% selectGene, ]
pheatmap(dataSub, annotation_col = anno, labels_row =c("ID_chr2_33134006_33135625"="LTBP1", "...")
Error in hclust(d, method = method) : must have n >= 2 objects to cluster
If anyone has any suggestions I'd appreciate them!
This is not a direct answer to your question, but it may be helpful if you are truly "driving yourself up a wall." It seems that you are doing something wrong in selecting a subset of genes, but I can't quite see what it is.
Why don't you make a second table manually that contains only genes of interest, and then use the same code that worked above?
I appreciate your answer. I am going to go forward with doing that, I originally wanted to avoid it because of my dislike of organizing gene IDs on csv files, but I think it might be the cleanest way to go about it