In [1]:
from pytadbit import load_chromosome
We load Chromosome objects, previously saved. These object usualy only contain "metadata", chromosome size, position of TADs for each experiment.
Note: the interaction matrices associated o the experiment can , also be saved, but by default, they are not as they can be loaded afterwards directly from the matrix.
In [2]:
crm = load_chromosome('results/fragment/crm18.tdb')
In [3]:
print crm
In [5]:
ali = crm.align_experiments(['T0', 'T60'])
In [6]:
ali.draw()
In [9]:
ali, stats = crm.align_experiments(['T0', 'T60'], randomize=True)
In [10]:
print ali
In [11]:
stats
Out[11]:
In [13]:
print 'Alignment score: %.3f, p-value: %.4f\n proportion of borders of T0 found in T60: %.3f, of T60 in T0 %.3f' % stats
In [14]:
ali.get_column(3)
Out[14]:
In [23]:
cols = ali.get_column(3)
In [26]:
col = cols[0]
In [27]:
border1, border2 = col[1]
In [30]:
border1['score']
Out[30]:
In [31]:
border2['score']
Out[31]:
In [35]:
ali.draw(focus=(1, 30))
In [36]:
ali.get_column(lambda x: x['score']>5, min_num=2)
Out[36]:
In [47]:
ali.get_column(lambda x: x['score']==0.0, lambda x: x['exp'].name=='T0', min_num=1)
Out[47]: