Skip to content

Latest commit

 

History

History
66 lines (48 loc) · 2.26 KB

004.Supplementary Figure 1 (RNA_PCA_Venn).md

File metadata and controls

66 lines (48 loc) · 2.26 KB

1. PCA

install.packages("FactoMineR")
install.packages("factoextra")
library(FactoMineR)
library(corrplot)
library(factoextra)
rna_seq <- read.csv("D:/001poppy_atac_new_genome/rnaseq/tpm_rep.csv",stringsAsFactors = F)

row.names(rna_seq) <- rna_seq[,1]
rna_seq <- rna_seq[,-1]

colnames(rna_seq)
colnames(rna_seq) <- c("Capsule_1","Capsule_2","Capsule_3",
                       "Petal_1","Petal_2","Petal_3",
                       "Stem_1","Stem_2","Stem_3",
                       "Fine Root_1","Fine Root_2","Fine Root_3",
                       "Leaf_1","Leaf_2","Leaf_3",
                       "Tap Root_1","Tap Root_2","Tap Root_3")

plot_rna_seq <- as.data.frame(t(rna_seq))
dim(plot_rna_seq)
plot_rna_seq[,51217] <- c("Capsule","Capsule","Capsule",
                          "Petal","Petal","Petal",
                          "Stem","Stem","Stem",
                          "Fine Root","Fine Root","Fine Root",
                          "Leaf","Leaf","Leaf",
                          "Tap Root","Tap Root","Tap Root")


colnames(plot_rna_seq)[51217] <- "Tissue"

rna_seq_pca <- FactoMineR::PCA(t(rna_seq),graph = FALSE)
fviz_eig(rna_seq_pca,addlabels = T)

library(RColorBrewer)
library(ggforce)
brewer.pal(9,"Set1")
fviz_pca_ind(rna_seq_pca,axes = c(1,2),labelsize =6, 
             habillage = factor(plot_rna_seq$Tissue),
             palette = c("#E41A1C", "#377EB8" ,"#4DAF4A" ,"#984EA3" ,"#FF7F00"  ,"#A65628"),
) +
  ggforce::geom_mark_ellipse(aes(fill = Groups,
                                 color = Groups)) +
  theme(legend.position = 'bottom') +
  coord_equal()

2. Venn

rna_seq_tpm_normal <- read.csv("tpm.csv",stringsAsFactors = F,header = T)
colnames(rna_seq_tpm_normal) <- c("gene","capsule","petal","stem","finroot","leaf","taproot")

x <- list(guo = rna_seq_tpm_normal[rna_seq_tpm_normal[,2]>=1,][,1], hua = rna_seq_tpm_normal[rna_seq_tpm_normal[,3]>=1,][,1] , jing = rna_seq_tpm_normal[rna_seq_tpm_normal[,4]>=1,][,1], xugen = rna_seq_tpm_normal[rna_seq_tpm_normal[,5]>=1,][,1], ye = rna_seq_tpm_normal[rna_seq_tpm_normal[,6]>=1,][,1], zhugen = rna_seq_tpm_normal[rna_seq_tpm_normal[,7]>=1,][,1])

library(venn)
venn(x,opacity = 0.4, plotsize = 20, ilcs = 2, sncs = 1.5,zcolor = "style")