您好,登錄后才能下訂單哦!
這篇文章將為大家詳細(xì)講解有關(guān)R語言中miRNA與靶基因相關(guān)性作圖的示例分析,小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考,希望大家閱讀完這篇文章后可以有所收獲。
miRNA與靶基因相關(guān)性作圖
首先,要生成作圖的輸入文件,有腳本,用法如下:
perl Correlation_analysis.pl -mirna Donkey_E_vs_Donkey_T.DEG.final.xls -DE_tar targets.final.xls -list bta.mir2target.list -out Correlation_analysis_input.txt
其中Donkey_E_vs_Donkey_T.DEG.final.xls是差異miRNA表達(dá)量文件;targets.final.xls是靶基因表達(dá)量文件;bta.mir2target.list 是miRNA與靶基因?qū)?yīng)文件。
Donkey_E_vs_Donkey_T.DEG.final.xls與targets.final.xls格式相同,如下所示:
#ID Donkey2_E_Count Donkey1_T_Count Donkey2_E_TPM Donkey1_T_TPM FDR log2FC regulated bta-miR-106a 26 113 1.164865 54.990056 3.20268371822863e-08 4.02066488557677 up bta-miR-10a 166025 1771 7438.335738 861.835296 0.000238871249442218 -4.55148673628311 down bta-miR-135a 5631 114 252.2829 55.476693 0.00268305048158635 -3.62181067749427 down bta-miR-135b 25 89 1.120063 43.310752 6.41785537824902e-07 3.73045876228641 up bta-miR-141 1201 2 53.807807 0.973275 2.17196461482771e-07 -6.91926313309958 down bta-miR-182 1882 33 84.318313 16.059043 0.00119553585103038 -3.81519649022355 down bta-miR-183 1544 40 69.175066 19.465506 0.00778797871791981 -3.25606929861198 down bta-miR-187 0 18 0 8.759478 6.10013036195234e-07 5.24714335099614 up bta-miR-196a 2871 31 128.627989 15.085767 0.000103494675187443 -4.51281538763237 down
bta.mir2target.list格式如下:
bta-let-7a-3p EAS0021476;EAS0000070;EAS0013638;EAS0001074;EAS0004577;EAS0006787;EAS0008899;EAS0013962;EAS0017655;EAS0005413;EAS0006009 bta-let-7a-5p EAS0008419;EAS0003830;EAS0009803;EAS0011296;EAS0005793;EAS0004645;EAS0014772 bta-let-7b EAS0017817;EAS0013474;EAS0008780;EAS0018405;EAS0017359;EAS0017674;EAS0020797;EAS0015379;EAS0011272;EAS0010435;EAS0013631 bta-let-7c EAS0006104;EAS0004549;EAS0003321;EAS0010481;EAS0021491;EAS0015994;EAS0001788;EAS0002956;EAS0007473;EAS0008880;EAS0007345;EAS0003066 bta-let-7d EAS0005004;EAS0009924;EAS0020635;EAS0002650;EAS0011574
最后生成的文件如下所示:
miRNA Gene log2Ratio_miR log2Ratio_Gene bta-let-7c EAS0003321 -1.43072567351625 1.37874741391777 bta-let-7c EAS0007345 -1.43072567351625 1.11756970634256 bta-let-7c EAS0003066 -1.43072567351625 1.67994238012443 bta-let-7c EAS0017368 -1.43072567351625 3.05079253633835 bta-let-7c EAS0004422 -1.43072567351625 1.50329494091278 bta-let-7c EAS0003988 -1.43072567351625 1.18612566219656 bta-let-7c EAS0005608 -1.43072567351625 1.89027598062113 bta-let-7c EAS0012078 -1.43072567351625 3.50870147552217 bta-let-7c EAS0015105 -1.43072567351625 1.06781330535694 bta-let-7c EAS0020084 -1.43072567351625 1.10413933910007
有了輸入文件,然后就可以作圖了,作圖腳本比較簡單,用法:
Rscript correlation_analysis.R -i Correlation_analysis_input.txt -n Correlation_analysis
腳本代碼:
library(ggplot2) library('getopt'); spec = matrix(c( 'help' , 'h', 0, "logical","for help", 'input' , 'i', 1, "character","input file ,required", 'name' , 'n', 1, "character","photo name" ), byrow=TRUE, ncol=5); opt = getopt(spec); print_usage <- function(spec=NULL){ cat(getopt(spec, usage=TRUE)); q(status=1); } if ( !is.null(opt$help) ) { print_usage(spec) } if ( is.null(opt$input) ){ print_usage(spec) } if ( is.null(opt$name) ){ opt$name = "Correlation analysis" } point <- read.table(opt$input,sep="\t",header = TRUE,comment.char = "") p <- ggplot(point, aes(x=log2Ratio_miR, y=log2Ratio_Gene)) + geom_point(size=0.01,colour="red")+ theme( ######取消默認(rèn)的背景顏色方框等 panel.background = element_rect(fill = "transparent",colour = "black"), panel.grid.minor = element_blank(), panel.grid.major = element_blank(), plot.background = element_rect(fill = "transparent",colour = "black")) #輸出文件名稱 png_name=paste(opt$name, ".png", sep="") pdf_name=paste(opt$name, ".pdf", sep="") #輸出pdf格式圖片 pdf(pdf_name,width =3,height = 3) print(p) dev.off() #輸出png格式圖片 png(png_name,width =2000,height =2000,res = 500,units = "px") print(p) dev.off()
關(guān)于“R語言中miRNA與靶基因相關(guān)性作圖的示例分析”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,使各位可以學(xué)到更多知識(shí),如果覺得文章不錯(cuò),請把它分享出去讓更多的人看到。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。