-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck_intersections.seq
51 lines (44 loc) · 1.66 KB
/
check_intersections.seq
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
oncogene_set = set[str]()
with open("data/oncogene_human.txt") as onc_file:
#Ignore first line
next(onc_file)
for line in onc_file:
split_line = line.rstrip().split('\t')
aliases = split_line[2]
for alias in aliases.split('|'):
oncogene_set.add(alias.upper())
all_genes_set = set[str]()
with open("data/trained_all/important_sk_gene_names.txt") as genes_file:
for line in genes_file:
g = line.rstrip()
all_genes_set.add(g.upper())
female_genes_set = set[str]()
with open("data/trained_female/important_sk_gene_names.txt") as genes_file:
for line in genes_file:
g = line.rstrip()
female_genes_set.add(g.upper())
male_genes_set = set[str]()
with open("data/trained_male/important_sk_gene_names.txt") as genes_file:
for line in genes_file:
g = line.rstrip()
male_genes_set.add(g.upper())
cg_all_set = set[str]()
with open("data/trained_all/important_sk_variables.txt") as genes_file:
for line in genes_file:
cg = line.rstrip().split(',')[0]
cg_all_set.add(cg.lower())
cg_horvath_set = set[str]()
with open("data/horvath_cgs.txt") as genes_file:
for line in genes_file:
cg = line.rstrip()
cg_horvath_set.add(cg.lower())
common = cg_all_set.intersection(cg_horvath_set)
with open("data/trained_all/important_sk_genes.bed") as translation_file:
for line in translation_file:
split_line = line.rstrip().split('\t')
cgsite = split_line[3]
gene_nm = split_line[9]
tmp_set = set[str]()
tmp_set.add(cgsite)
if len(tmp_set.intersection(common)) > 0:
print(gene_nm)