Skip to content

Commit

Permalink
e4g-123/Translation of raw Function Class terms to MGI Function Class…
Browse files Browse the repository at this point in the history
… Values
  • Loading branch information
leemdi committed Jan 27, 2025
1 parent 472dc78 commit 7591a7f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion HISTORY
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TAG: mgidbmigration-6-0-25-?
DATE: 01/22/2025
DATE: 01/27/2025
STAFF: lec
CHANGES:
e4g-123/Translation of raw Function Class terms to MGI Function Class Values
Expand Down
2 changes: 2 additions & 0 deletions snpfunctionclass/snpfunc.csh
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,7 @@ and t._term_key = a._object_key
and a._mgitype_key = 13
;
drop index if exists snp.SNP_ConsensusSnp_Marker_idx_consensussnp_key;
EOSQL

22 changes: 21 additions & 1 deletion snpfunctionclass/snpfunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@
import sys
import os
import gzip
import db

fxLookup = {}
results = db.sql('''
select t._term_key, t.term, s.badname, a.accid
from voc_term t, mgi_translation s, acc_accession a
where t._vocab_key = 49
and s._translationtype_key = 1014
and s._object_key = t._term_key
and t._term_key = a._object_key
and a._mgitype_key = 13
''', 'auto')
for r in results:
key = r['badname']
value = r['term']
fxLookup[key] = []
fxLookup[key].append(value)
#print(fxLookup)

inFile = gzip.open('/data/downloads/download.alliancegenome.org/variants/7.4.0/MGI/MGI.vep.vcf.gz', 'rt')
for line in inFile:
Expand Down Expand Up @@ -38,6 +56,8 @@
symbol = fields[3]
mgiid = fields[4]
for term in cterms:
print(symbol + "|" + mgiid + "|" + rsid + "|" + term)
if term in fxLookup:
for t in fxLookup[term]:
print(rsid + "|" + mgiid + "|" + symbol + "|" + term + "|" + t)

inFile.close()

0 comments on commit 7591a7f

Please sign in to comment.