Commit 83ef4b25 authored by Vincent Michel's avatar Vincent Michel
Browse files

[importer] Add fake files for GenomicMesure

parent be0da62cb57a
......@@ -23,6 +23,7 @@ from datetime import timedelta, datetime
import numpy.random as nr
from cubicweb.dataimport import SQLGenObjectStore
from cubicweb import Binary
from cubes.medicalexp.importers.import_glossaries import populate_glossaries
......@@ -158,6 +159,12 @@ def create_genomic_region(store):
cytoband_start=u'q+%s' % start,
cytoband_stop=u'q+%s' % stop,
chromosome=chromosome[0][0])
fakefiles = [store.create_entity('File', data_name=u'Fake file %s' % i,
data=Binary('Fake file %s' % i),
data_format=u'text/plain').eid
for i in xrange(nr.randint(3))]
for eid in fakefiles:
store.relate(entity.eid, 'results_files', eid)
for gene in store.rql('Any X ORDERBY RANDOM() LIMIT 100 WHERE X is Gene, '
'X chromosomes Y, Y eid %(e)s', {'e': chromosome[0][0]}):
store.relate(entity.eid, 'genes', gene[0], subjtype='GenomicRegion')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment