Entering edit mode
13 months ago
odi
▴
10
Here is a code, I have now:
combined <- rbind(mutant1, mutant2, mutant3)
as.data.frame(combined)
data_genes <- data.frame(gene = rownames(combined), combined, row.names = NULL)
View(data_genes)
data_genes %>%
group_by(mutant) %>%
mutate(abs_lfc = abs(avg_log2FC)) %>%
top_n(n = 50, wt = abs_lfc) -> top50
I would like to perform unbiased clustering of these top 50 genes in seurat and then plot a heatmap grouped by the sample name. How do I do that?
What do you mean by unbiased clustering? Based on what? Sequence similarity, expression profiles, genomic location?
Also, please use markdown to format your questions on forums and provide as lots of background information. Whilst off topic, I'm currently questioning why you've seemingly arbitrarily chosen the top 50. Is there a reason for that number?
easiest is probably just extract the raw fold-change values in a matrix (subset to those top 50 genes) - gene x foldchange and feed directly into pheatmap()
Do not delete posts that have received feedback. Interact with the people that have invested effort into helping you, and work towards providing closure to your post.