forked from rladdach/JoRo_PRO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDB_INPUT_ZV_protein
44 lines (34 loc) · 1.69 KB
/
DB_INPUT_ZV_protein
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
############################################################################
# Populating database with the content of ZoomVar Protein
# http://fraternalilab.kcl.ac.uk/ZoomVar/static/downloads/proteins.tar.gz
############################################################################
from sqlite3 import connect
DB_name = 'DB_JoRo_PRO'
############################################################################
conn = connect(DB_name)
curs = conn.cursor()
file = open('clinvar_protein.csv')
rows = [[line.rstrip().split(',')[0][1:-1]] + line.rstrip().split(',')[3:] for line in file]
if rows[0][0] == 'protein':
del rows[0]
for rec in rows:
curs.execute('INSERT INTO ZV_protein_clinvar (UniProt, length, snps, cdf, pval, qval) VALUES (?,?,?,?,?,?)', rec)
file = open('cosmic_protein.csv')
rows = [[line.rstrip().split(',')[0][1:-1]] + line.rstrip().split(',')[3:] for line in file]
if rows[0][0] == 'protein':
del rows[0]
for rec in rows:
curs.execute('INSERT INTO ZV_protein_cosmic (UniProt, length, snps, cdf, pval, qval) VALUES (?,?,?,?,?,?)', rec)
file = open('gnomad_common_protein.csv')
rows = [[line.rstrip().split(',')[0][1:-1]] + line.rstrip().split(',')[3:] for line in file]
if rows[0][0] == 'protein':
del rows[0]
for rec in rows:
curs.execute('INSERT INTO ZV_protein_gnomad_common (UniProt, length, snps, cdf, pval, qval) VALUES (?,?,?,?,?,?)', rec)
file = open('gnomad_rare_protein.csv')
rows = [[line.rstrip().split(',')[0][1:-1]] + line.rstrip().split(',')[3:] for line in file]
if rows[0][0] == 'protein':
del rows[0]
for rec in rows:
curs.execute('INSERT INTO ZV_protein_gnomad_rare (UniProt, length, snps, cdf, pval, qval) VALUES (?,?,?,?,?,?)', rec)
conn.commit()