-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPOMBASE_parseGenes.py
More file actions
40 lines (27 loc) · 1.1 KB
/
POMBASE_parseGenes.py
File metadata and controls
40 lines (27 loc) · 1.1 KB
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
# Parse annotation from POMBASE and use it to
# supplement the data already in place from
# entrez gene.
import Config
import sys, string
import MySQLdb
import Database
import gzip
from classes import ModelOrganisms
with Database.db as cursor :
pombase = ModelOrganisms.ModelOrganisms( Database.db, cursor )
pombaseIDHash = pombase.buildPombaseIDHash( )
with open( Config.POMBASE_FEATURES, 'r' ) as file :
for line in file.readlines( ) :
line = line.strip( )
splitLine = line.split( "\t" )
pombaseID = splitLine[0].strip( )
primaryName = splitLine[1].strip( )
aliases = (splitLine[2].strip( )).split( "," )
definition = splitLine[3].strip( )
if pombaseID in pombaseIDHash :
geneID = pombaseIDHash[pombaseID]
pombase.processName( geneID, pombaseID, primaryName, "pombase-official", aliases )
pombase.processDefinition( geneID, definition, "POMBASE-DESCRIPTION" )
cursor.execute( "INSERT INTO " + Config.DB_STATS + ".update_tracker VALUES ( '0', 'POMBASE_parseGenes', NOW( ) )" )
Database.db.commit( )
sys.exit( )