annotate commons/launcher/tests/Test_F_LaunchPromer.py @ 18:94ab73e8a190

Uploaded
author m-zytnicki
date Mon, 29 Apr 2013 03:20:15 -0400
parents
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
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
2 import os
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
3 from commons.core.utils.FileUtils import FileUtils
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
4 from commons.launcher.LaunchPromer import LaunchPromer
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
5
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
6
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
7 class Test_F_LaunchPromer(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._queryFastaFileName = "query.fa"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
11 self._refFastaFileName = "ref.fa"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
12 self._writeInputFastaFiles()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
13 self._expDeltaFileName = "expPromer.delta"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
14 self._writeExpDeltaFile()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
15 self._obsDeltaFileName = "obsPromer.delta"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
16 self._obsCoordFileName= "obsPromer.coords"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
17 self._expCoordFileName= "expPromer.coords"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
18
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
19 def tearDown(self):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
20 try:
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
21 os.remove(self._queryFastaFileName)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
22 except:pass
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
23 try:
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
24 os.remove(self._refFastaFileName)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
25 except:pass
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
26 try:
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
27 os.remove(self._expDeltaFileName)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
28 except:pass
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
29 try:
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
30 os.remove(self._obsDeltaFileName)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
31 except:pass
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
32
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
33 def test_run(self):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
34 ilauncher = LaunchPromer(self._refFastaFileName, self._queryFastaFileName,"obsPromer",verbosity=1)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
35 ilauncher.run()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
36 self.assertTrue(FileUtils.are2FilesIdentical(self._expDeltaFileName, self._obsDeltaFileName))
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
37
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
38 def test_run_as_script(self):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
39 cmd = 'LaunchPromer.py --query %s --ref %s --prefix %s' % (self._refFastaFileName, self._queryFastaFileName, "obsPromer")
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
40 os.system(cmd)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
41 self.assertTrue(FileUtils.are2FilesIdentical(self._expDeltaFileName, self._obsDeltaFileName))
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
42
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
43 def test_run_as_script_gencoords_output(self):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
44 self._writeExpGenCoordsFile()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
45 cmd = 'LaunchPromer.py --query %s --ref %s --prefix %s --gencoords' % (self._refFastaFileName, self._queryFastaFileName, "obsPromer")
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
46 os.system(cmd)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
47 self.assertTrue(FileUtils.are2FilesIdentical(self._expCoordFileName, self._obsCoordFileName))
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
48 os.remove(self._obsCoordFileName)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
49 os.remove(self._expCoordFileName)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
50
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
51 def test_run_as_script_with_mincluster(self):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
52 cmd = 'LaunchPromer.py --query %s --ref %s --prefix %s --mincluster 30' % (self._refFastaFileName, self._queryFastaFileName, "obsPromer")
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
53 os.system(cmd)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
54 self.assertTrue(FileUtils.are2FilesIdentical(self._expDeltaFileName, self._obsDeltaFileName))
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
55
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
56 def test_run_as_script_showcoords_output(self):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
57 self._writeExpShowCoordsFile()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
58 cmd = 'LaunchPromer.py --query %s --ref %s --prefix %s --showcoords' % (self._refFastaFileName, self._queryFastaFileName, "obsPromer")
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
59 os.system(cmd)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
60 self.assertTrue(FileUtils.are2FilesIdentical(self._expCoordFileName, self._obsCoordFileName))
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
61 os.remove(self._obsCoordFileName)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
62 os.remove(self._expCoordFileName)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
63
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
64 def _writeInputFastaFiles(self):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
65 InputFile = open(self._queryFastaFileName, 'w')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
66 InputFile.write('>Bovc-tA2:classI:SINE:SINE2/tRNA\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
67 InputFile.write('GGGCTTCCCTGGTAGCTCAGCTGGTAAAGAATCCGCCTGCAATGCAGGAGACCCCGGTTC\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
68 InputFile.write('GATTCCTGGGTCGGGAAGATCCCCTGGAGAAGGGATAGGCTACCCACTCCAGTATTCTTG\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
69 InputFile.write('GGCTTCCCTGGTGGCTCAGACGGTAAAGAATCCGCCTGCAATGCGGGAGACCTGGGTTCG\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
70 InputFile.write('ATCCCTGGGTTGGGAAGATCCCCTGGAGGAGGGCATGGCAACCCACTCCAGTATTCTTGC\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
71 InputFile.write('CTGGAGAATCCCCATGGACAGAGGAGCCTGGCGGGCTACAGTCCATGGGGTCGCAAAGAG\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
72 InputFile.write('TCGGACACGACTGAGCGACTAAGCACAGCACAG\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
73 InputFile.write('>SUSINE2:classI:SINE:SINE2/tRNA\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
74 InputFile.write('GGGAGTTCTCTGATGGCCTAGCGGGTTGAGGCTCCTGCGTTCTCACCGCTGTGGCTCTGG\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
75 InputFile.write('TTGCTGCTGTGCGGCGTAGGTTCAATCCCTGGCCCAGGAATTCCCACATACTGCCTGTGT\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
76 InputFile.write('GGCAAAAAAGAAAAAAAAAAAAAATACAAAAAAAAAAAAAACAAGAGAGAACCTGAAATA\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
77 InputFile.write('AACGTTGCAACTCTCATTNAAAAAAAAAAA\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
78 InputFile.write('>SINE1A_SS:classI:SINE:SINE2/tRNA\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
79 InputFile.write('GGGAGTTCTCTTGTGGCACAGCAGGTTAAGGATCCAGCGTTGTCACTGCAGTGGCTTGGG\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
80 InputFile.write('TCGCTGCTGTGGCACGGGTTCAATCCCTGGCCCAGGAACTTCCACATGCCACGGGCATGG\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
81 InputFile.write('CCAAAAAAAAA\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
82 InputFile.write('>SINE2-1_Pca:classI:SINE:SINE2/tRNA\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
83 InputFile.write('GGGCAGTGGTGGTTCAGTGGTAGAATTCTTGCCTTCCATGCGGGAGACCCGGGTTCGATT\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
84 InputFile.write('CCCGGCCAGTGCACCTCATGCGCAGCCACCACCCGTCTGTCAGTGGAGGCTTGCGTGTTG\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
85 InputFile.write('CTGTGATGCTGAACAGGTTTCAGCGGAGCTTCCAGACTAAGACGGACTAGGAAGAAAGGC\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
86 InputFile.write('CTGGCGATCTACTTCTGAAAATCAGCCAATGAAAACCCTGTGGATCACAGTGGTCTGATC\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
87 InputFile.write('TGCAACTGATCATGGGGATGGCGCAGGACCGGGCAGCGTTTTGTTCTATTGTGCATGGGG\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
88 InputFile.write('TCGCCATGAGTCGGGCCGACTCGATGGCAGCTAACAACAA\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
89 InputFile.write('>SINE_FR2:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
90 InputFile.write('GGGCGGCACGGTGGTGTGGTGGTTAGCACTGTTGCCTCACAGCAAGAAGGCCCCGGGTTC\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
91 InputFile.write('GATCCCCGGTTGGGACTGAGGCTGGGGACTTTCTGTGTGGAGTTTGCATGTTCTCCCTGT\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
92 InputFile.write('GCCTGCGTGGGTTCTCTCCGGGTACTCCGGCTTCCTCCCACAGTCCAAAGACATGCATGA\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
93 InputFile.write('TTGGGGATTAGGCTAATTGGAAACTCTAAAATTGCCCGTAGGTGTGAGTGTGAGAGAGAA\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
94 InputFile.write('TGGTTGTTTGTCTATATGTGTTAGCCCTGCGATTGACTGGCGTCCAGTCCAGGGTGTACC\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
95 InputFile.write('CTGCCTCCGCCCATTGTGCTGGGATAGGCTCCAGTCCCCCCGCGACCCTCAGTGGAGGAA\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
96 InputFile.write('CAAGCGGTAGAAAGTGAGTGAGTGAGTGA\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
97 InputFile.write('>SINEC1B2_CF:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
98 InputFile.write('GGGCAGCCTGGGTGGCTCAGCGGTTTAGCGCCTGCCTTTGGCCCAGGGCGTGATCCTGGA\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
99 InputFile.write('GACCCGGGATCGAGTCCCACATCGGGCTCCCTGCATGGAGCCTGCTTCTCCCTCTGCCTG\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
100 InputFile.write('TGTCTCTGCCTCTCTCTCTCTCTGTGTCTCTCATGAATAAATAA\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
101 InputFile.write('>ALPINE1:classI:SINE:SINE2/tRNA\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
102 InputFile.write('GGGGAGGGTATAGCTCAGTGGTAGAGCGCATGCTTAGCATGCACGAGGTCCTGGGTTCAA\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
103 InputFile.write('TCCCCAGTACCTCCATTAAAAATAAATAAATAAATAAACCTAATTACCTCCCCCACCAAA\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
104 InputFile.write('AAAAAAA\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
105 InputFile.close()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
106
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
107 InputFile = open(self._refFastaFileName, 'w')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
108 InputFile.write('>SINE_FR2:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
109 InputFile.write('GGGCGGCACGGTGGTGTGGTGGTTAGCACTGTTGCCTCACAGCAAGAAGGCCCCGGGTTC\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
110 InputFile.write('GATCCCCGGTTGGGACTGAGGCTGGGGACTTTCTGTGTGGAGTTTGCATGTTCTCCCTGT\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
111 InputFile.write('GCCTGCGTGGGTTCTCTCCGGGTACTCCGGCTTCCTCCCACAGTCCAAAGACATGCATGA\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
112 InputFile.write('TTGGGGATTAGGCTAATTGGAAACTCTAAAATTGCCCGTAGGTGTGAGTGTGAGAGAGAA\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
113 InputFile.write('TGGTTGTTTGTCTATATGTGTTAGCCCTGCGATTGACTGGCGTCCAGTCCAGGGTGTACC\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
114 InputFile.write('CTGCCTCCGCCCATTGTGCTGGGATAGGCTCCAGTCCCCCCG\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
115 InputFile.write('CAAGCGGTAGAAAGTGAGTGAGTGAGTGA\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
116 InputFile.write('>SINEC1B2_CF:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
117 InputFile.write('GGGCAGCCTGGGTGGCTCAGCGGTTTAGCGCCTGCCTTTGGCCCAGGGCGTGATCCTGGA\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
118 InputFile.write('GACCCGGGATCGAGTCCCACATCGGGCTCCCTGCATGGAGCCTGCTTCTCCCTCTGCCTG\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
119 InputFile.write('TGTCTCTGCCTCTCTCTCTCTCTGTGTCTCTCATGAATAAA\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
120 InputFile.close()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
121
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
122 def _writeExpDeltaFile(self):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
123 with open(self._expDeltaFileName, 'w') as f:
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
124 f.write("%s %s\n" %(os.path.abspath(self._queryFastaFileName), os.path.abspath(self._refFastaFileName)))
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
125 f.write('PROMER\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
126 f.write('>SINE_FR2:classI:SINE:? SINE_FR2:classI:SINE:? 389 371\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
127 f.write('1 387 1 369 6 6 10\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
128 f.write('115\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
129 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
130 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
131 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
132 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
133 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
134 f.write('0\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
135 f.write('2 388 2 370 6 6 8\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
136 f.write('115\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
137 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
138 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
139 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
140 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
141 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
142 f.write('0\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
143 f.write('3 389 3 371 6 6 16\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
144 f.write('115\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
145 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
146 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
147 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
148 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
149 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
150 f.write('0\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
151 f.write('388 2 370 2 6 6 6\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
152 f.write('10\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
153 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
154 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
155 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
156 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
157 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
158 f.write('0\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
159 f.write('387 1 369 1 6 6 5\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
160 f.write('10\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
161 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
162 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
163 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
164 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
165 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
166 f.write('0\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
167 f.write('389 3 371 3 6 6 4\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
168 f.write('11\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
169 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
170 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
171 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
172 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
173 f.write('1\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
174 f.write('0\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
175 f.write('>SINEC1B2_CF:classI:SINE:? SINEC1B2_CF:classI:SINE:? 164 161\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
176 f.write('1 159 1 159 0 0 2\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
177 f.write('0\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
178 f.write('3 161 3 161 0 0 2\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
179 f.write('0\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
180 f.write('161 3 161 3 0 0 0\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
181 f.write('0\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
182 f.write('160 2 160 2 0 0 2\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
183 f.write('0\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
184 f.write('159 1 159 1 0 0 4\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
185 f.write('0\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
186 f.write('2 160 2 160 0 0 4\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
187 f.write('0\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
188
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
189
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
190
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
191
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
192 def _writeExpGenCoordsFile(self):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
193 with open(self._expCoordFileName, 'w') as f:
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
194 f.write("%s %s\n" %(os.path.abspath(self._queryFastaFileName), os.path.abspath(self._refFastaFileName)))
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
195 f.write('PROMER\n\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
196 f.write(' [S1] [E1] | [S2] [E2] | [LEN 1] [LEN 2] | [% IDY] [% SIM] [% STP] | [FRM] [TAGS]\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
197 f.write('==============================================================================================================\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
198 f.write(' 1 159 | 1 159 | 159 159 | 100.00 100.00 1.89 | 1 1 SINEC1B2_CF:classI:SINE:?\tSINEC1B2_CF:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
199 f.write(' 2 160 | 2 160 | 159 159 | 100.00 100.00 3.77 | 2 2 SINEC1B2_CF:classI:SINE:?\tSINEC1B2_CF:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
200 f.write(' 3 161 | 3 161 | 159 159 | 100.00 100.00 1.89 | 3 3 SINEC1B2_CF:classI:SINE:?\tSINEC1B2_CF:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
201 f.write(' 159 1 | 159 1 | 159 159 | 100.00 100.00 3.77 | -3 -3 SINEC1B2_CF:classI:SINE:?\tSINEC1B2_CF:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
202 f.write(' 160 2 | 160 2 | 159 159 | 100.00 100.00 1.89 | -2 -2 SINEC1B2_CF:classI:SINE:?\tSINEC1B2_CF:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
203 f.write(' 161 3 | 161 3 | 159 159 | 100.00 100.00 0.00 | -1 -1 SINEC1B2_CF:classI:SINE:?\tSINEC1B2_CF:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
204 f.write(' 1 387 | 1 369 | 387 369 | 95.35 95.35 3.88 | 1 1 SINE_FR2:classI:SINE:?\tSINE_FR2:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
205 f.write(' 2 388 | 2 370 | 387 369 | 95.35 95.35 3.10 | 2 2 SINE_FR2:classI:SINE:?\tSINE_FR2:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
206 f.write(' 3 389 | 3 371 | 387 369 | 95.35 95.35 6.20 | 3 3 SINE_FR2:classI:SINE:?\tSINE_FR2:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
207 f.write(' 387 1 | 369 1 | 387 369 | 95.35 95.35 1.94 | -3 -3 SINE_FR2:classI:SINE:?\tSINE_FR2:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
208 f.write(' 388 2 | 370 2 | 387 369 | 95.35 95.35 2.33 | -2 -2 SINE_FR2:classI:SINE:?\tSINE_FR2:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
209 f.write(' 389 3 | 371 3 | 387 369 | 95.35 95.35 1.55 | -1 -1 SINE_FR2:classI:SINE:?\tSINE_FR2:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
210
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
211
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
212 def _writeExpShowCoordsFile(self):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
213 with open(self._expCoordFileName, 'w') as f:
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
214 f.write("%s %s\n" %(os.path.abspath(self._queryFastaFileName), os.path.abspath(self._refFastaFileName)))
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
215 f.write('PROMER\n\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
216 f.write('[S1]\t[E1]\t[S2]\t[E2]\t[LEN 1]\t[LEN 2]\t[% IDY]\t[% SIM]\t[% STP]\t[LEN R]\t[LEN Q]\t[COV R]\t[COV Q]\t[FRM]\t[TAGS]\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
217 f.write('1\t159\t1\t159\t159\t159\t100.00\t100.00\t1.89\t164\t161\t96.95\t98.76\t1\t1\tSINEC1B2_CF:classI:SINE:?\tSINEC1B2_CF:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
218 f.write('2\t160\t2\t160\t159\t159\t100.00\t100.00\t3.77\t164\t161\t96.95\t98.76\t2\t2\tSINEC1B2_CF:classI:SINE:?\tSINEC1B2_CF:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
219 f.write('3\t161\t3\t161\t159\t159\t100.00\t100.00\t1.89\t164\t161\t96.95\t98.76\t3\t3\tSINEC1B2_CF:classI:SINE:?\tSINEC1B2_CF:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
220 f.write('159\t1\t159\t1\t159\t159\t100.00\t100.00\t3.77\t164\t161\t96.95\t98.76\t-3\t-3\tSINEC1B2_CF:classI:SINE:?\tSINEC1B2_CF:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
221 f.write('160\t2\t160\t2\t159\t159\t100.00\t100.00\t1.89\t164\t161\t96.95\t98.76\t-2\t-2\tSINEC1B2_CF:classI:SINE:?\tSINEC1B2_CF:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
222 f.write('161\t3\t161\t3\t159\t159\t100.00\t100.00\t0.00\t164\t161\t96.95\t98.76\t-1\t-1\tSINEC1B2_CF:classI:SINE:?\tSINEC1B2_CF:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
223 f.write('1\t387\t1\t369\t387\t369\t95.35\t95.35\t3.88\t389\t371\t99.49\t99.46\t1\t1\tSINE_FR2:classI:SINE:?\tSINE_FR2:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
224 f.write('2\t388\t2\t370\t387\t369\t95.35\t95.35\t3.10\t389\t371\t99.49\t99.46\t2\t2\tSINE_FR2:classI:SINE:?\tSINE_FR2:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
225 f.write('3\t389\t3\t371\t387\t369\t95.35\t95.35\t6.20\t389\t371\t99.49\t99.46\t3\t3\tSINE_FR2:classI:SINE:?\tSINE_FR2:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
226 f.write('387\t1\t369\t1\t387\t369\t95.35\t95.35\t1.94\t389\t371\t99.49\t99.46\t-3\t-3\tSINE_FR2:classI:SINE:?\tSINE_FR2:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
227 f.write('388\t2\t370\t2\t387\t369\t95.35\t95.35\t2.33\t389\t371\t99.49\t99.46\t-2\t-2\tSINE_FR2:classI:SINE:?\tSINE_FR2:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
228 f.write('389\t3\t371\t3\t387\t369\t95.35\t95.35\t1.55\t389\t371\t99.49\t99.46\t-1\t-1\tSINE_FR2:classI:SINE:?\tSINE_FR2:classI:SINE:?\n')
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
229
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
230 if __name__ == "__main__":
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
231 unittest.main()