forked from juzishengwu/decoder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexport_en.py
More file actions
27 lines (25 loc) · 812 Bytes
/
export_en.py
File metadata and controls
27 lines (25 loc) · 812 Bytes
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
#coding=utf-8
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'manu2.settings'
import django
django.setup()
from snpedia.models import *
n = 0
for snp in Snp.objects.order_by('-magnitude'):
print snp.rsid, snp.magnitude
if snp.summary:
print 'summary:', snp.summary.encode('u8')
n += len(snp.summary)
if snp.description:
print 'description:', snp.description.encode('u8')
n += len(snp.description)
for geno in snp.genotype_set.all():
print geno.allele, geno.magnitude, geno.repute
if geno.summary:
print 'summary:', geno.summary.encode('u8')
n += len(snp.summary)
if geno.description:
print 'description:', geno.description.encode('u8')
n += len(snp.description)
print
print n