erange version 4.0a dev release
[erange.git] / test / testRnaEditing.py
1 '''
2 Created on Aug 23, 2010
3
4 @author: sau
5 '''
6 import unittest
7 from erange import rnaEditing
8
9
10 class TestRnaEditing(unittest.TestCase):
11
12
13     def setUp(self):
14         pass
15
16
17     def tearDown(self):
18         pass
19
20
21     def testGetGenesWithMultipleSNPs(self):
22         snpList = []
23         self.assertEquals([], rnaEditing.getGenesWithMultipleSNPs(snpList))
24
25         snpList = [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, "snp1"],
26                    [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, "snp2"],
27                    [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, "snp3"]
28         ]
29
30         result = ["snp3", "snp2", "snp1"]
31         self.assertEquals(result, rnaEditing.getGenesWithMultipleSNPs(snpList))
32         result = []
33         self.assertEquals(result, rnaEditing.getGenesWithMultipleSNPs(snpList, minCount=2))
34
35         snpList.append([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, "snp3"])
36         result = ["snp3"]
37         self.assertEquals(result, rnaEditing.getGenesWithMultipleSNPs(snpList, minCount=2))
38
39
40 def suite():
41     suite = unittest.TestSuite()
42     suite.addTest(unittest.makeSuite(TestRnaEditing))
43
44     return suite
45
46
47 if __name__ == "__main__":
48     #import sys;sys.argv = ['', 'Test.testName']
49     unittest.main()