annotate commons/pyRepetUnit/fastaTranslation/allFrames/tests/Test_F_TranslateInAllFramesAndReplaceStopByX.py @ 31:0ab839023fe4

Uploaded
author m-zytnicki
date Tue, 30 Apr 2013 14:33:21 -0400
parents 94ab73e8a190
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
1 import os
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
2 import unittest
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
3 from commons.pyRepetUnit.fastaTranslation.allFrames.TranslateInAllFramesAndReplaceStopByX import TranslateInAllFramesAndReplaceStopByX
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
4 from commons.core.seq.Bioseq import Bioseq
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
5 from commons.core.utils.FileUtils import FileUtils
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
6
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
7 class Test_F_TranslateInAllFramesAndReplaceStopByX(unittest.TestCase):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
8
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
9 def setUp(self):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
10 self.bioseq = Bioseq()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
11 self.preProcess = TranslateInAllFramesAndReplaceStopByX()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
12 self._inputFile = "./datas/test_input_nt.fa"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
13 self._outputFile = "./datas/PreProcessResult.fa"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
14
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
15
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
16 def testAcceptanceTranslateAfastaFileInAllFrame(self):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
17 self.preProcess.setInputFile(self._inputFile)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
18 self.preProcess.setOutputFile(self._outputFile)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
19 self.preProcess.run()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
20 self.assertTrue(FileUtils.are2FilesIdentical(self._outputFile, "./datas/test_input_aa.fa"))
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
21 os.system("rm " + self._outputFile)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
22
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
23 if __name__ == "__main__":
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
24 unittest.main()