root/galaxy-central/eggs/bx_python-0.5.0_dev_f74aec067563-py2.6-macosx-10.6-universal-ucs2.egg/bx/seq/qdna_tests.py

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

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

行番号 
1"""
2Tests for `bx.seq.qdna`.
3"""
4
5import unittest
6import sys
7import os.path
8import qdna
9
10test_qdna = "test_data/seq_tests/test.qdna"
11
12# Same sequence data as stored in test.qdna
13
14valid_seq = "C7wMwHQrMKqEtSREuUv5nsLinpTS8l7jXpbI7IipvCbHnhOdgx" \
15          + "5tzRgzYl4j85d:xSlvKPEKEIvZkfiX1YPkBi1Ibhfn9fTZd8gG" \
16          + "Wy284hJnwf93W4eHOjeRk7LuVYmH{UTYkYM:b4J4MruMq1ihhv" \
17          + "1Yl5W[xXEmi8[JuuLRgooBpy23PllMuUiIiKVIK5vzhjPPYp5Y" \
18          + "1eqPxo[e5I24KeCdTV94MZWNybUb:McC:1n4Jczk8JqnR4q1gY" \
19          + "HjLS4Bes3s5YvvWdKzS4VrFZy2erhd7YoWRoS[UK8JtSp1{Z1o" \
20          + "5:TpvN8mrmWrghiNw{S6nT8DSfF{1ff6kNGpI:FsZE2RgipTVO" \
21          + "mJN6vPm8MUgNYd7MDBEu37YOPzPjO1dr"
22
23valid_seq_len = len(valid_seq)
24
25class QDNATestCase(unittest.TestCase):
26
27    def test_get(self):
28        qdnafile = qdna.QdnaFile(file(test_qdna,"rb"))
29        check_get(qdnafile, 0, valid_seq_len)
30        check_get(qdnafile, 0, 40)
31        check_get(qdnafile, valid_seq_len - 40, 40)
32
33def check_get(qdnafile, start, len):
34    assert qdnafile.get(start, len) == valid_seq[start:start+len]
35
36test_classes = [ QDNATestCase ]
37suite = unittest.TestSuite( [ unittest.makeSuite( c ) for c in test_classes ] )
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。