Skip to content

Commit ec9973d

Browse files
author
mrbarbitoff
committed
Scripts update
1 parent 0551120 commit ec9973d

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed

analysis_scripts/expression_viz.R

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env python3
2+
3+
import sys
4+
import re
5+
6+
clfile, vcf = sys.argv[1:]
7+
8+
index_list = []
9+
with open(clfile, 'r') as cf:
10+
next(cf)
11+
for line in cf:
12+
try:
13+
index_list.append(line.split()[2])
14+
except:
15+
pass
16+
17+
index_coords = []
18+
with open(vcf, 'r') as vf:
19+
for line in vf:
20+
if line.startswith('#'):
21+
continue
22+
content = line.strip().split('\t')
23+
if content[0] == '6' and int(content[1]) > 25000528 and int(content[1]) < 33775446:
24+
continue
25+
if content[2] in index_list:
26+
print(content[0] + '\t' + str(int(content[1]) - 5000) + '\t' + str(int(content[1]) + 5000))

0 commit comments

Comments
 (0)