18
|
1 # Copyright INRA (Institut National de la Recherche Agronomique)
|
|
2 # http://www.inra.fr
|
|
3 # http://urgi.versailles.inra.fr
|
|
4 #
|
|
5 # This software is governed by the CeCILL license under French law and
|
|
6 # abiding by the rules of distribution of free software. You can use,
|
|
7 # modify and/ or redistribute the software under the terms of the CeCILL
|
|
8 # license as circulated by CEA, CNRS and INRIA at the following URL
|
|
9 # "http://www.cecill.info".
|
|
10 #
|
|
11 # As a counterpart to the access to the source code and rights to copy,
|
|
12 # modify and redistribute granted by the license, users are provided only
|
|
13 # with a limited warranty and the software's author, the holder of the
|
|
14 # economic rights, and the successive licensors have only limited
|
|
15 # liability.
|
|
16 #
|
|
17 # In this respect, the user's attention is drawn to the risks associated
|
|
18 # with loading, using, modifying and/or developing or reproducing the
|
|
19 # software by the user in light of its specific status of free software,
|
|
20 # that may mean that it is complicated to manipulate, and that also
|
|
21 # therefore means that it is reserved for developers and experienced
|
|
22 # professionals having in-depth computer knowledge. Users are therefore
|
|
23 # encouraged to load and test the software's suitability as regards their
|
|
24 # requirements in conditions enabling the security of their systems and/or
|
|
25 # data to be ensured and, more generally, to use and operate it in the
|
|
26 # same conditions as regards security.
|
|
27 #
|
|
28 # The fact that you are presently reading this means that you have had
|
|
29 # knowledge of the CeCILL license and that you accept its terms.
|
|
30
|
|
31
|
|
32 import unittest
|
|
33 import os
|
|
34 import time
|
|
35 from commons.core.utils.FileUtils import FileUtils
|
|
36 from commons.tools.ChangeSequenceHeaders import ChangeSequenceHeaders
|
|
37
|
|
38
|
|
39 class Test_ChangeSequenceHeaders( unittest.TestCase ):
|
|
40
|
|
41 def setUp( self ):
|
|
42 self._i = ChangeSequenceHeaders()
|
|
43 self._uniqId = "%s_%s" % ( time.strftime("%Y%m%d%H%M%S") , os.getpid() )
|
|
44
|
|
45
|
|
46 def tearDown( self ):
|
|
47 self._i = None
|
|
48 self._uniqId = None
|
|
49
|
|
50
|
|
51 def test_script_no_input_file( self ):
|
|
52 cDir = os.getcwd()
|
|
53
|
|
54 inFile = "dummyInFaFile_%s" % ( self._uniqId )
|
|
55
|
|
56 obsFile = "dummyObsFile_%s" % ( self._uniqId )
|
|
57
|
|
58 cmd = "python ../ChangeSequenceHeaders.py"
|
|
59 cmd += " -i %s" % ( inFile )
|
|
60 cmd += " -f fasta"
|
|
61 cmd += " -s 1"
|
|
62 cmd += " -p TE"
|
|
63 cmd += " -o %s" % ( obsFile )
|
|
64 exitStatus = os.system( cmd )
|
|
65
|
|
66 self.assertFalse( exitStatus == 0 )
|
|
67
|
|
68 os.chdir( cDir )
|
|
69
|
|
70
|
|
71 def test_shortenSequenceHeadersForFastaFile_fasta_script( self ):
|
|
72 cDir = os.getcwd()
|
|
73
|
|
74 inFile = "dummyInFaFile_%s" % ( self._uniqId )
|
|
75 inF = open( inFile, "w" )
|
|
76 inF.write( ">DmelChr4-B-G387-MAP16\nATGTACGATGACGATCAG\n" )
|
|
77 inF.write( ">consensus524\nGTGCGGATGGAACAGT\n" )
|
|
78 inF.close()
|
|
79
|
|
80 linkFile = "dummyLinkFile_%s" % ( self._uniqId )
|
|
81
|
|
82 expFile = "dummyExpFile_%s" % ( self._uniqId )
|
|
83 expF = open( expFile, "w" )
|
|
84 expF.write( ">TE1\nATGTACGATGACGATCAG\n" )
|
|
85 expF.write( ">TE2\nGTGCGGATGGAACAGT\n" )
|
|
86 expF.close()
|
|
87
|
|
88 obsFile = "dummyObsFile_%s" % ( self._uniqId )
|
|
89
|
|
90 cmd = "python ../ChangeSequenceHeaders.py"
|
|
91 cmd += " -i %s" % ( inFile )
|
|
92 cmd += " -f fasta"
|
|
93 cmd += " -s 1"
|
|
94 cmd += " -p TE"
|
|
95 cmd += " -l %s" % ( linkFile )
|
|
96 cmd += " -o %s" % ( obsFile )
|
|
97 exitStatus = os.system( cmd )
|
|
98
|
|
99 self.assertTrue( exitStatus == 0 )
|
|
100 self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
|
|
101
|
|
102 for f in [ inFile, linkFile, expFile, obsFile ]:
|
|
103 os.remove( f )
|
|
104 os.chdir( cDir )
|
|
105
|
|
106
|
|
107 def test_retrieveInitialSequenceHeaders_fasta_script( self ):
|
|
108 cDir = os.getcwd()
|
|
109
|
|
110 inFile = "dummyInFaFile_%s" % ( self._uniqId )
|
|
111 inF = open( inFile, "w" )
|
|
112 inF.write( ">seq2\nATGTACGATGACGATCAG\n" )
|
|
113 inF.write( ">seq1\nGTGCGGATGGAACAGT\n" )
|
|
114 inF.close()
|
|
115
|
|
116 linkFile = "dummyLinkFile_%s" % ( self._uniqId )
|
|
117 linkF = open( linkFile, "w" )
|
|
118 linkF.write( "seq1\tconsensus524\t1\t18\n" )
|
|
119 linkF.write( "seq2\tDmelChr4-B-G387-MAP16\t1\t16\n" )
|
|
120 linkF.write( "seq3\treference2\n" )
|
|
121 linkF.close()
|
|
122
|
|
123 expFile = "dummyExpFile_%s" % ( self._uniqId )
|
|
124 expF = open( expFile, "w" )
|
|
125 expF.write( ">DmelChr4-B-G387-MAP16\nATGTACGATGACGATCAG\n" )
|
|
126 expF.write( ">consensus524\nGTGCGGATGGAACAGT\n" )
|
|
127 expF.close()
|
|
128
|
|
129 obsFile = "dummyObsFile_%s" % ( self._uniqId )
|
|
130
|
|
131 cmd = "python ../ChangeSequenceHeaders.py"
|
|
132 cmd += " -i %s" % ( inFile )
|
|
133 cmd += " -f fasta"
|
|
134 cmd += " -s 2"
|
|
135 cmd += " -l %s" % ( linkFile )
|
|
136 cmd += " -o %s" % ( obsFile )
|
|
137 exitStatus = os.system( cmd )
|
|
138
|
|
139 self.assertTrue( exitStatus == 0 )
|
|
140 self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
|
|
141
|
|
142 for f in [ inFile, linkFile, expFile, obsFile ]:
|
|
143 os.remove( f )
|
|
144 os.chdir( cDir )
|
|
145
|
|
146 def test_retrieveInitialSequenceHeaders_fastaFromClustering_afterLTRHarvest_Blastclust( self ):
|
|
147 cDir = os.getcwd()
|
|
148
|
|
149 inFile = "dummyInFaFile_%s" % ( self._uniqId )
|
|
150 inF = open( inFile, "w" )
|
|
151 inF.write( ">BlastclustCluster1Mb3_seq2\nATGTACGATGACGATCAG\n" )
|
|
152 inF.write( ">BlastclustCluster8Mb4_seq1\nGTGCGGATGGAACAGT\n" )
|
|
153 inF.close()
|
|
154
|
|
155 linkFile = "dummyLinkFile_%s" % ( self._uniqId )
|
|
156 linkF = open( linkFile, "w" )
|
|
157 linkF.write( "seq1\tchunk1 (dbseq-nr 1) [41806,41825]\t1\t18\n" )
|
|
158 linkF.write( "seq2\tchunk2 (dbseq-nr 6) [41006,41023]\t1\t16\n" )
|
|
159 linkF.write( "seq3\treference2\n" )
|
|
160 linkF.close()
|
|
161
|
|
162 expFile = "dummyExpFile_%s" % ( self._uniqId )
|
|
163 expF = open( expFile, "w" )
|
|
164 expF.write( ">BlastclustCluster1Mb3_chunk2 (dbseq-nr 6) [41006,41023]\nATGTACGATGACGATCAG\n" )
|
|
165 expF.write( ">BlastclustCluster8Mb4_chunk1 (dbseq-nr 1) [41806,41825]\nGTGCGGATGGAACAGT\n" )
|
|
166 expF.close()
|
|
167
|
|
168 obsFile = "dummyObsFile_%s" % ( self._uniqId )
|
|
169
|
|
170 whichCluster = "A"
|
|
171 cmd = "python ../ChangeSequenceHeaders.py"
|
|
172 cmd += " -i %s" % ( inFile )
|
|
173 cmd += " -f fasta"
|
|
174 cmd += " -s 2"
|
|
175 cmd += " -l %s" % ( linkFile )
|
|
176 cmd += " -w %s" % ( whichCluster )
|
|
177 cmd += " -o %s" % ( obsFile )
|
|
178 exitStatus = os.system( cmd )
|
|
179
|
|
180 self.assertTrue( exitStatus == 0 )
|
|
181 self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
|
|
182
|
|
183 for f in [ inFile, linkFile, expFile, obsFile ]:
|
|
184 os.remove( f )
|
|
185 os.chdir( cDir )
|
|
186
|
|
187 def test_retrieveInitialSequenceHeaders_fastaFromClustering_forClusterConsensus_Blastclust( self ):
|
|
188 cDir = os.getcwd()
|
|
189
|
|
190 inFile = "dummyInFaFile_%s" % ( self._uniqId )
|
|
191 inF = open( inFile, "w" )
|
|
192 inF.write( ">BlastclustCluster8Mb4_seq1\nGTGCGGATGGAACAGT\n" )
|
|
193 inF.write( ">BlastclustCluster1Mb3_seq2\nATGTACGATGACGATCAG\n" )
|
|
194 inF.close()
|
|
195
|
|
196 linkFile = "dummyLinkFile_%s" % ( self._uniqId )
|
|
197 linkF = open( linkFile, "w" )
|
|
198 linkF.write( "seq1\tDHX-incomp_DmelChr4-B-R1-Map4\t1\t18\n" )
|
|
199 linkF.write( "seq2\tRLX-incomp_DmelChr4-B-R12-Map3_reversed\t1\t16\n" )
|
|
200 linkF.write( "seq3\treference2\n" )
|
|
201 linkF.close()
|
|
202
|
|
203 expFile = "dummyExpFile_%s" % ( self._uniqId )
|
|
204 expF = open( expFile, "w" )
|
|
205 expF.write( ">DHX-incomp_Blc8_DmelChr4-B-R1-Map4\nGTGCGGATGGAACAGT\n" )
|
|
206 expF.write( ">RLX-incomp_Blc1_DmelChr4-B-R12-Map3_reversed\nATGTACGATGACGATCAG\n" )
|
|
207 expF.close()
|
|
208
|
|
209 obsFile = "dummyObsFile_%s" % ( self._uniqId )
|
|
210
|
|
211 whichCluster = "B"
|
|
212 cmd = "python ../ChangeSequenceHeaders.py"
|
|
213 cmd += " -i %s" % ( inFile )
|
|
214 cmd += " -f fasta"
|
|
215 cmd += " -s 2"
|
|
216 cmd += " -l %s" % ( linkFile )
|
|
217 cmd += " -w %s" % ( whichCluster )
|
|
218 cmd += " -o %s" % ( obsFile )
|
|
219 exitStatus = os.system( cmd )
|
|
220
|
|
221 self.assertTrue( exitStatus == 0 )
|
|
222 self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
|
|
223
|
|
224 for f in [ inFile, linkFile, expFile, obsFile ]:
|
|
225 os.remove( f )
|
|
226 os.chdir( cDir )
|
|
227
|
|
228 def test_retrieveInitialSequenceHeaders_fastaFromClustering_afterLTRHarvest_MCL( self ):
|
|
229 cDir = os.getcwd()
|
|
230
|
|
231 inFile = "dummyInFaFile_%s" % ( self._uniqId )
|
|
232 inF = open( inFile, "w" )
|
|
233 inF.write( ">MCLCluster1Mb3_seq2\nATGTACGATGACGATCAG\n" )
|
|
234 inF.write( ">MCLCluster8Mb4_seq1\nGTGCGGATGGAACAGT\n" )
|
|
235 inF.close()
|
|
236
|
|
237 linkFile = "dummyLinkFile_%s" % ( self._uniqId )
|
|
238 linkF = open( linkFile, "w" )
|
|
239 linkF.write( "seq1\tchunk1 (dbseq-nr 1) [41806,41825]\t1\t18\n" )
|
|
240 linkF.write( "seq2\tchunk2 (dbseq-nr 6) [41006,41023]\t1\t16\n" )
|
|
241 linkF.write( "seq3\treference2\n" )
|
|
242 linkF.close()
|
|
243
|
|
244 expFile = "dummyExpFile_%s" % ( self._uniqId )
|
|
245 expF = open( expFile, "w" )
|
|
246 expF.write( ">MCLCluster1Mb3_chunk2 (dbseq-nr 6) [41006,41023]\nATGTACGATGACGATCAG\n" )
|
|
247 expF.write( ">MCLCluster8Mb4_chunk1 (dbseq-nr 1) [41806,41825]\nGTGCGGATGGAACAGT\n" )
|
|
248 expF.close()
|
|
249
|
|
250 obsFile = "dummyObsFile_%s" % ( self._uniqId )
|
|
251
|
|
252 whichCluster = "A"
|
|
253 cmd = "python ../ChangeSequenceHeaders.py"
|
|
254 cmd += " -i %s" % ( inFile )
|
|
255 cmd += " -f fasta"
|
|
256 cmd += " -s 2"
|
|
257 cmd += " -l %s" % ( linkFile )
|
|
258 cmd += " -w %s" % ( whichCluster )
|
|
259 cmd += " -o %s" % ( obsFile )
|
|
260 exitStatus = os.system( cmd )
|
|
261
|
|
262 self.assertTrue( exitStatus == 0 )
|
|
263 self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
|
|
264
|
|
265 for f in [ inFile, linkFile, expFile, obsFile ]:
|
|
266 os.remove( f )
|
|
267 os.chdir( cDir )
|
|
268
|
|
269 def test_retrieveInitialSequenceHeaders_fastaFromClustering_forClusterConsensus_MCL( self ):
|
|
270 cDir = os.getcwd()
|
|
271
|
|
272 inFile = "dummyInFaFile_%s" % ( self._uniqId )
|
|
273 inF = open( inFile, "w" )
|
|
274 inF.write( ">MCLCluster8Mb4_seq1\nGTGCGGATGGAACAGT\n" )
|
|
275 inF.write( ">MCLCluster1Mb3_seq2\nATGTACGATGACGATCAG\n" )
|
|
276 inF.close()
|
|
277
|
|
278 linkFile = "dummyLinkFile_%s" % ( self._uniqId )
|
|
279 linkF = open( linkFile, "w" )
|
|
280 linkF.write( "seq1\tDHX-incomp_DmelChr4-B-R1-Map4\t1\t18\n" )
|
|
281 linkF.write( "seq2\tRLX-incomp_DmelChr4-B-R12-Map3_reversed\t1\t16\n" )
|
|
282 linkF.write( "seq3\treference2\n" )
|
|
283 linkF.close()
|
|
284
|
|
285 expFile = "dummyExpFile_%s" % ( self._uniqId )
|
|
286 expF = open( expFile, "w" )
|
|
287 expF.write( ">DHX-incomp_MCL8_DmelChr4-B-R1-Map4\nGTGCGGATGGAACAGT\n" )
|
|
288 expF.write( ">RLX-incomp_MCL1_DmelChr4-B-R12-Map3_reversed\nATGTACGATGACGATCAG\n" )
|
|
289 expF.close()
|
|
290
|
|
291 obsFile = "dummyObsFile_%s" % ( self._uniqId )
|
|
292
|
|
293 whichCluster = "B"
|
|
294 cmd = "python ../ChangeSequenceHeaders.py"
|
|
295 cmd += " -i %s" % ( inFile )
|
|
296 cmd += " -f fasta"
|
|
297 cmd += " -s 2"
|
|
298 cmd += " -l %s" % ( linkFile )
|
|
299 cmd += " -w %s" % ( whichCluster )
|
|
300 cmd += " -o %s" % ( obsFile )
|
|
301 exitStatus = os.system( cmd )
|
|
302
|
|
303 self.assertTrue( exitStatus == 0 )
|
|
304 self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
|
|
305
|
|
306 for f in [ inFile, linkFile, expFile, obsFile ]:
|
|
307 os.remove( f )
|
|
308 os.chdir( cDir )
|
|
309
|
|
310 def test_retrieveInitialSequenceHeaders_newick_script( self ):
|
|
311 cDir = os.getcwd()
|
|
312
|
|
313 inFile = "dummyInFile_%s" % ( self._uniqId )
|
|
314 inF = open( inFile, "w" )
|
|
315 inF.write( "(seq4:0.012511,(seq3:0.005340,seq2:0.002201))" )
|
|
316 inF.close()
|
|
317
|
|
318 linkFile = "dummyLinkFile_%s" % ( self._uniqId )
|
|
319 linkF = open( linkFile, "w" )
|
|
320 linkF.write( "seq1\t1360\n" )
|
|
321 linkF.write( "seq2\tDmelChr4-B-P2.0-MAP3_classII-TIR-comp|1cl-1gr|26copies\n" )
|
|
322 linkF.write( "seq3\tDmelChr4-B-G20-MAP3_classII-TIR-comp|1cl-1gr|53copies\n" )
|
|
323 linkF.write( "seq4\tDmelChr4-B-G14-MAP17_classII-TIR-comp|1cl-1gr|41copies\n" )
|
|
324 linkF.close()
|
|
325
|
|
326 expFile = "dummyExpFile_%s" % ( self._uniqId )
|
|
327 expF = open( expFile, "w" )
|
|
328 expF.write( "(DmelChr4-B-G14-MAP17_classII-TIR-comp|1cl-1gr|41copies:0.012511,(DmelChr4-B-G20-MAP3_classII-TIR-comp|1cl-1gr|53copies:0.005340,DmelChr4-B-P2.0-MAP3_classII-TIR-comp|1cl-1gr|26copies:0.002201))" )
|
|
329 expF.close()
|
|
330
|
|
331 obsFile = "dummyObsFile_%s" % ( self._uniqId )
|
|
332
|
|
333 cmd = "python ../ChangeSequenceHeaders.py"
|
|
334 cmd += " -i %s" % ( inFile )
|
|
335 cmd += " -f newick"
|
|
336 cmd += " -s 2"
|
|
337 cmd += " -l %s" % ( linkFile )
|
|
338 cmd += " -o %s" % ( obsFile )
|
|
339 exitStatus = os.system( cmd )
|
|
340
|
|
341 self.assertTrue( exitStatus == 0 )
|
|
342 self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
|
|
343
|
|
344 for f in [ inFile, linkFile, expFile, obsFile ]:
|
|
345 os.remove( f )
|
|
346 os.chdir( cDir )
|
|
347
|
|
348
|
|
349 def test_retrieveInitialSequenceHeadersForAlignFile( self ):
|
|
350 cDir = os.getcwd()
|
|
351
|
|
352 linkFile = "dummyLinkFile_%s" % ( self._uniqId )
|
|
353 linkF = open( linkFile, "w" )
|
|
354 linkF.write( "seq1\tname=Dm_Blaster_Piler_30.38_Map_8|category=classI|order=LTR|completeness=comp\t1\t1000\n" )
|
|
355 linkF.write( "seq2\tname=Dm_Blaster_Recon_34_Map_20|category=classI|order=LTR|completeness=comp\t1\t800\n" )
|
|
356 linkF.close()
|
|
357
|
|
358 inFile = "dummyAlignFile_%s" % ( self._uniqId )
|
|
359 inFileHandler = open( inFile, "w" )
|
|
360 inFileHandler.write( "seq1\t1\t100\tseq2\t110\t11\t1e-38\t254\t98.5\n" )
|
|
361 inFileHandler.write( "seq2\t11\t110\tseq1\t100\t1\t1e-38\t254\t98.5\n" )
|
|
362 inFileHandler.close()
|
|
363
|
|
364 expFile = "dummyExpAlignFile_%s" % ( self._uniqId )
|
|
365 expFileHandler = open( expFile, "w" )
|
|
366 expFileHandler.write( "name=Dm_Blaster_Piler_30.38_Map_8|category=classI|order=LTR|completeness=comp\t1\t100\tname=Dm_Blaster_Recon_34_Map_20|category=classI|order=LTR|completeness=comp\t110\t11\t1e-38\t254\t98.500000\n" )
|
|
367 expFileHandler.write( "name=Dm_Blaster_Recon_34_Map_20|category=classI|order=LTR|completeness=comp\t11\t110\tname=Dm_Blaster_Piler_30.38_Map_8|category=classI|order=LTR|completeness=comp\t100\t1\t1e-38\t254\t98.500000\n" )
|
|
368 expFileHandler.close()
|
|
369
|
|
370 obsFile = "dummyObsAlignFile_%s" % ( self._uniqId )
|
|
371
|
|
372 cmd = "python ../ChangeSequenceHeaders.py"
|
|
373 cmd += " -i %s" % ( inFile )
|
|
374 cmd += " -f align"
|
|
375 cmd += " -s 2"
|
|
376 cmd += " -l %s" % ( linkFile )
|
|
377 cmd += " -o %s" % ( obsFile )
|
|
378 exitStatus = os.system( cmd )
|
|
379
|
|
380 self.assertTrue( exitStatus == 0 )
|
|
381 self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
|
|
382
|
|
383 for f in [ inFile, linkFile, expFile, obsFile ]:
|
|
384 os.remove( f )
|
|
385 os.chdir( cDir )
|
|
386
|
|
387
|
|
388 def test_retrieveInitialSequenceHeadersForPathFile( self ):
|
|
389 cDir = os.getcwd()
|
|
390
|
|
391 linkFile = "dummyLinkFile_%s" % ( self._uniqId )
|
|
392 linkF = open( linkFile, "w" )
|
|
393 linkF.write( "seq1\tname=Dm_Blaster_Piler_30.38_Map_8|category=classI|order=LTR|completeness=comp\t1\t1000\n" )
|
|
394 linkF.write( "seq2\tname=Dm_Blaster_Recon_34_Map_20|category=classI|order=LTR|completeness=comp\t1\t800\n" )
|
|
395 linkF.close()
|
|
396
|
|
397 inFile = "dummyAlignFile_%s" % ( self._uniqId )
|
|
398 inFileHandler = open( inFile, "w" )
|
|
399 inFileHandler.write( "11\tseq1\t1\t100\tseq2\t110\t11\t1e-38\t254\t98.5\n" )
|
|
400 inFileHandler.write( "2\tseq2\t11\t110\tseq1\t100\t1\t1e-38\t254\t98.5\n" )
|
|
401 inFileHandler.close()
|
|
402
|
|
403 expFile = "dummyExpAlignFile_%s" % ( self._uniqId )
|
|
404 expFileHandler = open( expFile, "w" )
|
|
405 expFileHandler.write( "11\tname=Dm_Blaster_Piler_30.38_Map_8|category=classI|order=LTR|completeness=comp\t1\t100\tname=Dm_Blaster_Recon_34_Map_20|category=classI|order=LTR|completeness=comp\t110\t11\t1e-38\t254\t98.500000\n" )
|
|
406 expFileHandler.write( "2\tname=Dm_Blaster_Recon_34_Map_20|category=classI|order=LTR|completeness=comp\t11\t110\tname=Dm_Blaster_Piler_30.38_Map_8|category=classI|order=LTR|completeness=comp\t100\t1\t1e-38\t254\t98.500000\n" )
|
|
407 expFileHandler.close()
|
|
408
|
|
409 obsFile = "dummyObsAlignFile_%s" % ( self._uniqId )
|
|
410
|
|
411 cmd = "python ../ChangeSequenceHeaders.py"
|
|
412 cmd += " -i %s" % ( inFile )
|
|
413 cmd += " -f path"
|
|
414 cmd += " -s 2"
|
|
415 cmd += " -l %s" % ( linkFile )
|
|
416 cmd += " -o %s" % ( obsFile )
|
|
417 exitStatus = os.system( cmd )
|
|
418
|
|
419 self.assertTrue( exitStatus == 0 )
|
|
420 self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
|
|
421
|
|
422 for f in [ inFile, linkFile, expFile, obsFile ]:
|
|
423 os.remove( f )
|
|
424 os.chdir( cDir )
|
|
425
|
|
426
|
|
427 if __name__ == "__main__":
|
|
428 unittest.main()
|