comparison commons/launcher/tests/Test_launchTEclass.py @ 18:94ab73e8a190

Uploaded
author m-zytnicki
date Mon, 29 Apr 2013 03:20:15 -0400
parents
children
comparison
equal deleted inserted replaced
17:b0e8584489e6 18:94ab73e8a190
1 import unittest
2 import os
3 from commons.core.utils.FileUtils import FileUtils
4 from commons.launcher import launchTEclass
5
6
7 class Test_launchTEclass( unittest.TestCase ):
8
9 def test_parseFastaFileFromTEclass( self ):
10 inFile = "dummyLibFile.fa"
11 inHandler = open( inFile, "w" )
12 inHandler.write( ">1360|TEclass result: DNA|ORFs: 1360..2226:+1\n" )
13 inHandler.write( "AGCATGACGCA\n" )
14 inHandler.write( ">FB|TEclass result: unclear\n" )
15 inHandler.write( "GCATGCAGCGACGCGAC\n" )
16 inHandler.close()
17
18 expFile = "dummyExpFile.map"
19 expHandler = open( expFile, "w" )
20 expHandler.write( "DNA\t1360\t1\t11\n" )
21 expHandler.write( "unclear\tFB\t1\t17\n" )
22 expHandler.close()
23
24 obsFile = "dummyObsFile.map"
25
26 launchTEclass.parseFastaFileFromTEclass( inFile, obsFile )
27
28 self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
29
30 for f in [ inFile, expFile, obsFile ]:
31 os.remove( f )
32
33 if __name__ == "__main__":
34 unittest.main()