|
| 1 | +setwd("/mnt/2EA01BDBA01BA7FB/Working issues/BI_Science/Systems Genetics/Pleiotropy/Paper/Revision/Figures/expression") |
| 2 | + |
| 3 | +library(ggplot2) |
| 4 | +library(reshape2) |
| 5 | + |
| 6 | + |
| 7 | +# Incrementing degree |
| 8 | +#############gtex######################################## |
| 9 | +######################################################### |
| 10 | +######################################################### |
| 11 | + |
| 12 | +all_exp = read.table('../../new_eqtl_tpm/gtex.tsv', sep='\t', header = T) |
| 13 | + |
| 14 | +strat1 = read.table('../../final_loci/1_noHLA_index_genes.GTEx.medians.tsv', sep='\t', header=F) |
| 15 | +strat2 = read.table('../../final_loci/2_noHLA_index_genes.GTEx.medians.tsv', sep='\t', header=F) |
| 16 | +strat3 = read.table('../../final_loci/3_noHLA_index_genes.GTEx.medians.tsv', sep='\t', header=F) |
| 17 | +strat4 = read.table('../../final_loci/4_noHLA_index_genes.GTEx.medians.tsv', sep='\t', header=F) |
| 18 | +strat5 = read.table('../../final_loci/5_noHLA_index_genes.GTEx.medians.tsv', sep='\t', header=F) |
| 19 | +strat6 = read.table('../../final_loci/6_noHLA_index_genes.GTEx.medians.tsv', sep='\t', header=F) |
| 20 | +strat7 = read.table('../../final_loci/7_noHLA_index_genes.GTEx.medians.tsv', sep='\t', header=F) |
| 21 | +strat8 = read.table('../../final_loci/8_noHLA_index_genes.GTEx.medians.tsv', sep='\t', header=F) |
| 22 | +strat9 = read.table('../../final_loci/9_noHLA_index_genes.GTEx.medians.tsv', sep='\t', header=F) |
| 23 | +strat10 = read.table('../../final_loci/10_noHLA_index_genes.GTEx.medians.tsv', sep='\t', header=F) |
| 24 | + |
| 25 | + |
| 26 | +summaries_med = data.frame(tpm = c(apply(all_exp[, 3:56], 1, median), |
| 27 | + apply(strat1, 1, median), |
| 28 | + apply(strat2, 1, median), |
| 29 | + apply(strat3, 1, median), |
| 30 | + apply(strat4, 1, median), |
| 31 | + apply(strat5, 1, median), |
| 32 | + apply(strat6, 1, median), |
| 33 | + apply(strat7, 1, median), |
| 34 | + apply(strat8, 1, median), |
| 35 | + apply(strat9, 1, median), |
| 36 | + apply(strat10, 1, median)), |
| 37 | + pleio = c(rep(0, nrow(all_exp)), |
| 38 | + rep(1, nrow(strat1)), |
| 39 | + rep(2, nrow(strat2)), |
| 40 | + rep(3, nrow(strat3)), |
| 41 | + rep(4, nrow(strat4)), |
| 42 | + rep(5, nrow(strat5)), |
| 43 | + rep(6, nrow(strat6)), |
| 44 | + rep(7, nrow(strat7)), |
| 45 | + rep(8, nrow(strat8)), |
| 46 | + rep(9, nrow(strat9)), |
| 47 | + rep(10, nrow(strat10)))) |
| 48 | + |
| 49 | +ggplot(summaries_med, aes(x=as.factor(pleio), y=log2(tpm+1), |
| 50 | + fill=as.factor(pleio))) + |
| 51 | + geom_violin(scale='width') + |
| 52 | + geom_boxplot(width=0.4, fill='white', outlier.shape=NA) + |
| 53 | + scale_y_continuous(limits=c(0, 10)) + theme_bw() + guides(fill=F) |
0 commit comments