蛋白质组和转录组相关性图绘制

蛋白质组合转录组相关性图绘制

目前研究蛋白质组的项目越来越多,经常有蛋白质和转录组相关的分析。


deg_file <- 'S-1_S-2_S-3_vs_R-1_R-2_R-3.all'
dep_file <- 'S-1_S-2_S-3_vs_R-1_R-2_R-3.DEP.all.xls'

# 设置筛选参数
dep_fc <- 1.5
dep_fdr <- 0.05
deg_fc <-1.5
deg_fdr <- 0.05
# 读取文件
deg <- read_delim(deg_file,delim = '\t')
dep <- read_delim(dep_file,delim = '\t')
dim(dep)

# 蛋白ID转换
extr_id <- function(x){
  return(substr(x, start = 0, stop = 16))
}
dep$protein_id <- as.character(llply(dep$protein, extr_id))

gene_ids <- deg$`#ID`
protein_id <- dep$protein_id
# 共有ID
common_id <- intersect(gene_ids,protein_id)

# 提取数据列表
dep_common = dep[dep$protein_id %in% common_id,c('protein_id','logFC','P.Value')]
colnames(dep_common) <- c('protein_id','logFC_p','FDR_p')

dep_common$regulate_p = as.factor(ifelse(dep_common$FDR_p < dep_fdr & abs(dep_common$logFC_p) >=log2(dep_fc), ifelse(dep_common$logFC_p>log2(dep_fc),'Up','Down'),'Normal'))
table(dep_common$regulate_p)

deg_common = deg[deg$`#ID` %in% common_id,c('#ID','FDR','log2FC')]
colnames(deg_common) <- c('#ID','FDR_g','log2FC_g')
deg_common$regulate_g = as.factor(ifelse(deg_common$FDR_g < deg_fdr & abs(deg_common$log2FC_g) >=log2(deg_fc), ifelse(deg_common$log2FC_g>log2(deg_fc),'Up','Down'),'Normal'))
table(deg_common$regulate_g)

# 合并转录组和蛋白质结果
merge_df <- merge(dep_common, deg_common, by.x='protein_id', by.y='#ID')

# 基于调控关系进行分组
merge_df$type  <- paste(merge_df$regulate_p, merge_df$regulate_g,sep = '_')
types <- c('Down_Down','Down_Up','Up_Down','Up_Up')
merge_df[!merge_df$type %in% types,'type'] <- 'Other'

# 绘图
mycol <- c("#e41a1c","#ff7f00","#984ea3","#4daf4a","#80b1d3")
ggplot(data=merge_df, aes(x=logFC_p,y=log2FC_g,colour=type)) + geom_point() + 
  scale_color_manual(values = c("Up_Up"=mycol[1],"Up_Down"=mycol[2],"Down_Up"=mycol[3],"Down_Down"=mycol[4],"Other"=mycol[5]))+
  geom_hline(aes(yintercept=log2(deg_fc)), linetype="dashed",colour="grey11")+ geom_hline(aes(yintercept=-log2(deg_fc)), linetype="dashed",colour="grey11") + 
  geom_vline(aes(xintercept=-log2(dep_fc)),linetype="dashed",colour="grey11") + geom_vline(aes(xintercept=log2(dep_fc)),linetype="dashed",colour="grey11") +
  labs(x = "Protein_logFC", y = "Gene_logFC", title = "Protein_Gene_relation") +
  theme_bw()+ theme(
    panel.grid=element_blank(),
    axis.text.x=element_text(colour="black"),
    axis.text.y=element_text(colour="black"),
    panel.border=element_rect(colour = "black"),
    legend.key = element_blank(),
    legend.title = element_blank())

结果如下图:

attachments-2018-12-USGdTfTI5c13287a77dbf.jpg



0 条评论

请先 登录 后评论
microRNA
microRNA

115 篇文章

作家榜 »

  1. omicsgene 658 文章
  2. 安生水 331 文章
  3. Daitoue 167 文章
  4. 生物女学霸 120 文章
  5. 红橙子 78 文章
  6. CORNERSTONE 72 文章
  7. xun 68 文章
  8. rzx 68 文章