root/galaxy-central/eggs/bx_python-0.5.0_dev_f74aec067563-py2.6-macosx-10.6-universal-ucs2.egg/bx/motif/io/transfac_tests.py @ 3

リビジョン 3, 2.5 KB (コミッタ: kohda, 14 年 前)

Install Unix tools  http://hannonlab.cshl.edu/galaxy_unix_tools/galaxy.html

行番号 
1from StringIO import StringIO
2import transfac
3from numpy import allclose
4
5sample = """
6VV  TRANSFAC MATRIX TABLE, Rel.3.2 26-06-1997
7XX
8//
9AC  a
10XX
11ID  V$MYOD_01
12XX
13DT  19.10.92 (created); ewi.
14DT  16.10.95 (updated); ewi.
15XX
16NA  MyoD
17XX
18DE  myoblast determination gene product
19XX
20BF  T00526; MyoD; Species: mouse, Mus musculus.
21XX
22P0      A      C      G      T
2301     100     200     200     0     S
2402     200     100     200     0     R
2503     300     0     100     100     A
2604     0     500     0     0     C
2705     500     0     0     0     A
2806     0     0     400     100     G
2907     0     100     400     0     G
3008     0     0     0     500     T
3109     0     0     500     0     G
3210     0     100     200     200     K
3311     0     200     0     300     Y
3412     100     0     300     100     G
35XX
36BA  5 functional elements in 3 genes
37XX
38//
39AC  M00002
40XX
41ID  V$E47_01
42XX
43DT  19.10.92 (created); ewi.
44DT  16.10.95 (updated); ewi.
45XX
46NA  E47
47XX
48DE  E47
49XX
50BF  T00207; E47; Species: human, Homo sapiens.
51XX
52P0      A      C      G      T
5300     400     400     300     0     N
5402     200     500     400     0     S
5503     300     200     400     200     N
5604     200     0     900     0     G
5705     0     1100     0     0     C
5806     1100     0     0     0     A
5907     0     0     1100     0     G
6008     100     200     800     0     G
6109     0     0     0     1100     T
6210     0     0     1100     0     G
6311     0     0     400     700     K
6412     100     400     300     300     N
6513     100     600     200     200     C
6614     100     400     400     200     N
6715     100     400     200     300     N
68XX
69BA  11 selected strong binding sites for E47, E47-MyoD, E12+MyoD
70BA  and (weak) for E12
71XX
72CC  Group I in [903]; 5 sites selected in vitro for binding to E12N
73CC  (=N-terminally truncated E12); matrix corrected according to
74CC  the published sequences
75XX
76RN  [1]
77RA  Sun X.-H., Baltimore D.
78RT  An inhibitory domain of E12 transcription factor prevents
79RT  DNA binding in E12 homodimers but not in E12 heterodimers
80RL  Cell 64:459-470 (1991).
81XX
82"""
83
84def test_reader():
85    input = StringIO( sample )
86    motifs = list( transfac.TransfacReader( input ) )
87    assert len( motifs ) == 2
88    # Single value parse
89    assert motifs[1].accession == "M00002"
90    # Value list parse
91    assert motifs[1].dates == [ '19.10.92 (created); ewi.', '16.10.95 (updated); ewi.' ]
92    # Matrix parse
93    assert motifs[1].matrix.sorted_alphabet == ['A','C','G','T']
94    assert allclose( motifs[1].matrix.values[0], [400,400,300,0] )
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。