您好,登錄后才能下訂單哦!
這篇“r語言如何繪制蛋白質(zhì)組和轉(zhuǎn)錄組相關(guān)性圖”文章的知識點大部分人都不太理解,所以小編給大家總結(jié)了以下內(nèi)容,內(nèi)容詳細(xì),步驟清晰,具有一定的借鑒價值,希望大家閱讀完這篇文章能有所收獲,下面我們一起來看看這篇“r語言如何繪制蛋白質(zhì)組和轉(zhuǎn)錄組相關(guān)性圖”文章吧。
目前研究蛋白質(zhì)組的項目越來越多,經(jīng)常有蛋白質(zhì)和轉(zhuǎn)錄組相關(guān)的分析。
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' # 設(shè)置篩選參數(shù) 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轉(zhuǎn)換 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) # 提取數(shù)據(jù)列表 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) # 合并轉(zhuǎn)錄組和蛋白質(zhì)結(jié)果 merge_df <- merge(dep_common, deg_common, by.x='protein_id', by.y='#ID') # 基于調(diào)控關(guān)系進(jìn)行分組 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())
以上就是關(guān)于“r語言如何繪制蛋白質(zhì)組和轉(zhuǎn)錄組相關(guān)性圖”這篇文章的內(nèi)容,相信大家都有了一定的了解,希望小編分享的內(nèi)容對大家有幫助,若想了解更多相關(guān)的知識內(nèi)容,請關(guān)注億速云行業(yè)資訊頻道。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。