annotate SMART/Java/Python/test/Test_F_trimSequences.py @ 25:7809e72960fe

Deleted selected files
author m-zytnicki
date Mon, 29 Apr 2013 03:29:14 -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 unittest, os, os.path
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
2 from SMART.Java.Python.misc import Utils
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
3 SMART_PATH = os.environ["REPET_PATH"] + "/SMART"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
4
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
5 class Test_F_trimSequences(unittest.TestCase):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
6
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
7 def setUp(self):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
8 self._expOutputFileName = "expOutputFile.fasta"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
9 self._obsOutputFileName = "obsOutputFile.mfa"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
10 self._inputFileName = "inputFile.fasta"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
11
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
12 def tearDown(self):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
13 for fileName in (self._expOutputFileName, self._obsOutputFileName, self._inputFileName):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
14 if os.path.exists(fileName):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
15 os.remove(fileName)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
16
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
17 def test_simple(self):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
18 expOutputFile = open(self._expOutputFileName, "w")
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
19 expOutputFile.write(">sequence1\nTTGCATAGCGCTACGTA\n")
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
20 expOutputFile.close()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
21 inputFile = open(self._inputFileName, "w")
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
22 inputFile.write(">sequence1\nAGCTCGGGTATTGCATAGCGCTACGTACCCTTTATATC\n")
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
23 inputFile.close()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
24 os.system("python %s/Java/Python/trimSequences.py -i %s -f fasta -3 CCCTTTATATC -5 AGCTCGGGTA -o %s -v 0" % (SMART_PATH, self._inputFileName, self._obsOutputFileName))
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
25 self.assertTrue(Utils.diff(self._expOutputFileName, self._obsOutputFileName))
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
26
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
27 if __name__ == "__main__":
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
28 unittest.main()