changeset 23:4541611db314

Deleted selected files
author m-zytnicki
date Mon, 29 Apr 2013 03:26:52 -0400
parents 1e3f2c2657a3
children 452e051f6562
files commons/core/coord/test/TestSuite_coord.py commons/core/coord/test/Test_Align.py commons/core/coord/test/Test_AlignUtils.py commons/core/coord/test/Test_ConvCoord.py commons/core/coord/test/Test_F_ConvCoord.py commons/core/coord/test/Test_Map.py commons/core/coord/test/Test_MapUtils.py commons/core/coord/test/Test_Match.py commons/core/coord/test/Test_MatchUtils.py commons/core/coord/test/Test_MergedRange.py commons/core/coord/test/Test_Path.py commons/core/coord/test/Test_PathUtils.py commons/core/coord/test/Test_Range.py commons/core/coord/test/Test_Set.py commons/core/coord/test/Test_SetUtils.py commons/core/coord/test/Test_SlidingWindow.py commons/core/coord/test/__init__.py commons/core/parsing/test/Test_BedParser.py commons/core/parsing/test/Test_BlatFileParser.py commons/core/parsing/test/Test_BlatParser.py commons/core/parsing/test/Test_BlatToGff.py commons/core/parsing/test/Test_BlatToGffForBesPaired.py commons/core/parsing/test/Test_BowtieParser.py commons/core/parsing/test/Test_CoordsParser.py commons/core/parsing/test/Test_CrossSsrAndBesMappedByBlatToGff.py commons/core/parsing/test/Test_F_BlatToGff.py commons/core/parsing/test/Test_F_BlatToGffForBesPaired.py commons/core/parsing/test/Test_F_CrossSsrAndBesMappedByBlatToGff.py commons/core/parsing/test/Test_F_VarscanToVCF.py commons/core/parsing/test/Test_FastaParser.py commons/core/parsing/test/Test_FindRep.py commons/core/parsing/test/Test_GffParser.py commons/core/parsing/test/Test_MapParser.py commons/core/parsing/test/Test_MrepsToSet.py commons/core/parsing/test/Test_Multifasta2SNPFile.py commons/core/parsing/test/Test_Multifasta2SNPFileWriter.py commons/core/parsing/test/Test_PalsToAlign.py commons/core/parsing/test/Test_PathNum2Id.py commons/core/parsing/test/Test_PslParser.py commons/core/parsing/test/Test_SsrParser.py commons/core/parsing/test/Test_VarscanFile.py commons/core/parsing/test/Test_VarscanFileForGnpSNP.py commons/core/parsing/test/Test_VarscanHit.py commons/core/parsing/test/Test_VarscanHitForGnpSNP.py commons/core/parsing/test/Test_VarscanHit_WithTag.py commons/core/parsing/test/Test_VarscanHit_v2_2_8.py commons/core/parsing/test/Test_VarscanHit_v2_2_8_WithTag.py commons/core/parsing/test/Test_VarscanToVCF.py commons/core/parsing/test/Test_WigParser.py commons/core/parsing/test/Test_pilerTAToGrouperMap.py commons/core/parsing/test/__init__.py commons/core/parsing/test/data/ExpPotDooblonsSubSNP.csv commons/core/parsing/test/data/Wig/chr1.wig commons/core/parsing/test/data/realExpBatchLine.csv commons/core/parsing/test/data/realExpIndividual.csv commons/core/parsing/test/data/realExpSequences.fsa commons/core/parsing/test/data/realExpSubSNP.csv commons/core/parsing/test/data/real_multifasta_input.fasta commons/core/parsing/test/data/sampleForTestVarscanToVCF.varscan commons/core/parsing/test/data/test.wig commons/core/parsing/test/data/test1.wig commons/core/parsing/test/data/test2.wig commons/core/parsing/test/data/testBedParser1.bed commons/core/parsing/test/data/testCoordsParser.coords commons/core/parsing/test/data/testCoordsParser_showcoord.coords commons/core/parsing/test/data/testCoordsParser_showcoord_promer.coords commons/core/parsing/test/data/testGffParser1.gff3 commons/core/seq/test/TestClusterConsensusCollection.py commons/core/seq/test/TestSuite_seq.py commons/core/seq/test/Test_AlignedBioseqDB.py commons/core/seq/test/Test_Bioseq.py commons/core/seq/test/Test_BioseqDB.py commons/core/seq/test/Test_BioseqUtils.py commons/core/seq/test/Test_FastaUtils.py commons/core/seq/test/Utils_for_T_FastaUtils.py commons/core/seq/test/__init__.py commons/core/utils/test/TestSuite_utils.py commons/core/utils/test/Test_FileUtils.py commons/core/utils/test/__init__.py commons/core/writer/test/Test_Gff3Writer.py commons/core/writer/test/Test_MapWriter.py commons/core/writer/test/__init__.py
diffstat 77 files changed, 0 insertions(+), 25873 deletions(-) [+]
line wrap: on
line diff
--- a/commons/core/coord/test/TestSuite_coord.py	Mon Apr 29 03:26:07 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright INRA (Institut National de la Recherche Agronomique)
-# http://www.inra.fr
-# http://urgi.versailles.inra.fr
-#
-# This software is governed by the CeCILL license under French law and
-# abiding by the rules of distribution of free software.  You can  use, 
-# modify and/ or redistribute the software under the terms of the CeCILL
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# "http://www.cecill.info". 
-#
-# As a counterpart to the access to the source code and  rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty  and the software's author,  the holder of the
-# economic rights,  and the successive licensors  have only  limited
-# liability. 
-#
-# In this respect, the user's attention is drawn to the risks associated
-# with loading,  using,  modifying and/or developing or reproducing the
-# software by the user in light of its specific status of free software,
-# that may mean  that it is complicated to manipulate,  and  that  also
-# therefore means  that it is reserved for developers  and  experienced
-# professionals having in-depth computer knowledge. Users are therefore
-# encouraged to load and test the software's suitability as regards their
-# requirements in conditions enabling the security of their systems and/or 
-# data to be ensured and,  more generally, to use and operate it in the 
-# same conditions as regards security. 
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL license and that you accept its terms.
-
-
-import unittest
-import sys
-import Test_Align
-import Test_AlignUtils
-import Test_Map
-import Test_MapUtils
-import Test_Match
-import Test_MatchUtils
-import Test_Path
-import Test_PathUtils
-import Test_Range
-import Test_Set
-import Test_SetUtils
-
-
-def main():
-    
-    TestSuite_coord = unittest.TestSuite() 
-    
-    TestSuite_coord.addTest( unittest.makeSuite( Test_Align.Test_Align, "test" ) )
-    TestSuite_coord.addTest( unittest.makeSuite( Test_AlignUtils.Test_AlignUtils, "test" ) )
-    TestSuite_coord.addTest( unittest.makeSuite( Test_Map.Test_Map, "test" ) )
-    TestSuite_coord.addTest( unittest.makeSuite( Test_MapUtils.Test_MapUtils, "test" ) )
-    TestSuite_coord.addTest( unittest.makeSuite( Test_Match.Test_Match, "test" ) )
-    TestSuite_coord.addTest( unittest.makeSuite( Test_MatchUtils.Test_MatchUtils, "test" ) )
-    TestSuite_coord.addTest( unittest.makeSuite( Test_Path.Test_Path, "test" ) )
-    TestSuite_coord.addTest( unittest.makeSuite( Test_PathUtils.Test_PathUtils, "test" ) )
-    TestSuite_coord.addTest( unittest.makeSuite( Test_Range.Test_Range, "test" ) )
-    TestSuite_coord.addTest( unittest.makeSuite( Test_Set.Test_Set, "test" ) )
-    TestSuite_coord.addTest( unittest.makeSuite( Test_SetUtils.Test_SetUtils, "test" ) )
-    
-    runner = unittest.TextTestRunner( sys.stderr, 2, 2 )
-    runner.run( TestSuite_coord )
-    
-    
-if __name__ == "__main__":
-    main()
--- a/commons/core/coord/test/Test_Align.py	Mon Apr 29 03:26:07 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,518 +0,0 @@
-# Copyright INRA (Institut National de la Recherche Agronomique)
-# http://www.inra.fr
-# http://urgi.versailles.inra.fr
-#
-# This software is governed by the CeCILL license under French law and
-# abiding by the rules of distribution of free software.  You can  use, 
-# modify and/ or redistribute the software under the terms of the CeCILL
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# "http://www.cecill.info". 
-#
-# As a counterpart to the access to the source code and  rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty  and the software's author,  the holder of the
-# economic rights,  and the successive licensors  have only  limited
-# liability. 
-#
-# In this respect, the user's attention is drawn to the risks associated
-# with loading,  using,  modifying and/or developing or reproducing the
-# software by the user in light of its specific status of free software,
-# that may mean  that it is complicated to manipulate,  and  that  also
-# therefore means  that it is reserved for developers  and  experienced
-# professionals having in-depth computer knowledge. Users are therefore
-# encouraged to load and test the software's suitability as regards their
-# requirements in conditions enabling the security of their systems and/or 
-# data to be ensured and,  more generally, to use and operate it in the 
-# same conditions as regards security. 
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL license and that you accept its terms.
-
-
-import unittest
-import os
-import time
-from commons.core.coord.Align import Align
-from commons.core.coord.Map import Map
-from commons.core.utils.FileUtils import FileUtils
-from commons.core.coord.Range import Range
-
-
-class Test_Align( unittest.TestCase ):
-    
-    def setUp(self):
-        self._align = Align()
-        self._uniqId = "%s_%s" % ( time.strftime("%Y%m%d%H%M%S"), os.getpid() )
-        
-    def tearDown(self):
-        self._align = None
-        
-    def test_isEmpty_True(self):
-        alignInstance = Align()
-        
-        self.assertTrue(alignInstance.isEmpty())
-        
-    def test_isEmpty_True_query_is_empty(self):
-        alignInstance = Align()
-        line = "\t-1\t-1\tTE2\t3\t10\t1e-20\t30\t90.2\n"
-        alignInstance.setFromString(line)
-        
-        self.assertTrue(alignInstance.isEmpty())
-        
-    def test_isEmpty_True_subject_is_empty(self):
-        alignInstance = Align()
-        line = "chr1\t2\t20\t\t-1\t-1\t1e-20\t30\t90.2\n"
-        alignInstance.setFromString(line)
-        
-        self.assertTrue(alignInstance.isEmpty())
-        
-    def test_isEmpty_False(self):
-        alignInstance = Align()
-        line = "chr1\t2\t20\tTE2\t3\t10\t1e-20\t30\t90.2\n"
-        alignInstance.setFromString(line)
-        
-        self.assertFalse(alignInstance.isEmpty())
-        
-    def test_read(self):
-        line = "chr2\t1\t10\tTE3\t11\t17\t1e-20\t30\t90.2\n"
-        expReturn = 1
-
-        dummyMockAlignFile = "dummyMockAlignFile"
-        mockAlignFileHandle = open(dummyMockAlignFile, "w")
-        mockAlignFileHandle.write(line)
-        mockAlignFileHandle.close()
-        
-        expAlignInstance = Align()
-        expAlignInstance.setFromString(line)
-
-        mockAlignFileHandle = open(dummyMockAlignFile, "r")
-        obsAlignInstance = Align()
-        obsReturn = obsAlignInstance.read(mockAlignFileHandle)
-        
-        mockAlignFileHandle.close()
-        os.remove(dummyMockAlignFile)   
-        
-        self.assertEquals(expAlignInstance, obsAlignInstance)    
-        self.assertEquals(expReturn, obsReturn)    
-        
-    def test_read_empty_file(self):
-        expReturn = 0
-         
-        dummyMockAlignFile = "dummyMockAlignFile"
-        mockAlignFileHandle = open(dummyMockAlignFile, "w")
-        mockAlignFileHandle.close()
-       
-        mockAlignFileHandle = open(dummyMockAlignFile, "r")
-        obsAlignInstance = Align()
-        obsReturn = obsAlignInstance.read(mockAlignFileHandle)
-        os.remove(dummyMockAlignFile)   
-        
-        self.assertEquals(expReturn, obsReturn)
-        
-    def test_write (self):
-        expAlignFile = "expMockAlignFile"
-        expAlignFileHandle = open(expAlignFile, "w")
-        expLine = "chr1\t1\t10\tTE2\t3\t10\t0\t30\t90.200000\n"
-        expAlignFileHandle.write(expLine)
-        expAlignFileHandle.close()
-       
-        obsAlignFile = "obsAlignFile"
-        obsAlignFileHandle = open(obsAlignFile, "w")
-        obsAlignInstance = Align()
-        obsAlignTuple = ("chr1", 1, 10, "TE2", 3, 10, 0.0, 30, 90.2)
-        obsAlignInstance.setFromTuple(obsAlignTuple) 
-        obsAlignInstance.write(obsAlignFileHandle)
-        obsAlignFileHandle.close()   
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expAlignFile, obsAlignFile ) )
-        os.remove(expAlignFile)
-        os.remove(obsAlignFile)
-        
-    def test_merge (self):
-        alignInstanceChr1 = Align()
-        alignInstanceChr2 = Align()
-
-        line1 = "chr1\t1\t10\tTE2\t3\t10\t1e-20\t30\t90.2\n"
-        line2 = "chr2\t1\t10\tTE2\t11\t17\t1e-20\t30\t90.2\n"
-
-        alignInstanceChr1.setFromString(line1)
-        alignInstanceChr2.setFromString(line2)
-        
-        expResult = None
-        obsResult = alignInstanceChr1.merge(alignInstanceChr2)
-        
-        self.assertEquals(expResult, obsResult)
-        
-        line1 = "chr1\t1\t10\tTE2\t3\t10\t1e-20\t30\t90.2\n"
-        line2 = "chr1\t1\t10\tTE3\t11\t17\t1e-20\t30\t90.2\n"
-
-        alignInstanceTE2 = Align()
-        alignInstanceTE3 = Align()
- 
-        alignInstanceTE2.setFromString(line1)
-        alignInstanceTE3.setFromString(line2)
-        
-        expResult = None
-        obsResult = alignInstanceTE2.merge(alignInstanceTE3)
-        
-        self.assertEquals(expResult, obsResult)
-        
-    def test_merge_plus_strand1 (self):
-        alignInstance1 = Align()
-        alignInstance2 = Align()
-
-        line1 = "chr1\t2\t20\tTE2\t3\t10\t1e-20\t30\t90.2\n"
-        line2 = "chr1\t1\t10\tTE2\t1\t9\t1e-20\t30\t90.2\n"
-
-        alignInstance1.setFromString(line1)
-        alignInstance2.setFromString(line2)
-        
-        expLine = "chr1\t1\t20\tTE2\t1\t10\t1e-20\t30\t90.2\n"
-        expAlign = Align()
-        expAlign.setFromString(expLine)
-
-        alignInstance1.merge(alignInstance2)
-        obsAlign = alignInstance1
-
-        self.assertEquals(expAlign, obsAlign)
-        
-    def test_merge_plus_strand2 (self ):
-        alignInstance1 = Align()
-        alignInstance2 = Align()
-
-        line1 = "chr1\t2\t20\tTE2\t3\t10\t1e-20\t30\t90.2\n"
-        line2 = "chr1\t4\t30\tTE2\t4\t12\t1e-20\t30\t90.2\n"
-
-        alignInstance1.setFromString(line1)
-        alignInstance2.setFromString(line2)
-        
-        expLine = "chr1\t2\t30\tTE2\t3\t12\t1e-20\t30\t90.2\n"
-        expAlign = Align()
-        expAlign.setFromString(expLine)
-
-        alignInstance1.merge(alignInstance2)
-        obsAlign = alignInstance1
-
-        self.assertEquals(expAlign, obsAlign)
-        
-    def test_merge_plus_strand3 (self ):
-        alignInstance1 = Align()
-        alignInstance2 = Align()
-
-        line1 = "chr1\t2\t10\tTE2\t3\t10\t1e-20\t30\t90.2\n"
-        line2 = "chr1\t1\t20\tTE2\t1\t12\t1e-20\t30\t90.2\n"
-
-        alignInstance1.setFromString(line1)
-        alignInstance2.setFromString(line2)
-        
-        expLine = "chr1\t1\t20\tTE2\t1\t12\t1e-20\t30\t90.2\n"
-        expAlign = Align()
-        expAlign.setFromString(expLine)
-
-        alignInstance1.merge(alignInstance2)
-        obsAlign = alignInstance1
-
-        self.assertEquals(expAlign, obsAlign)
-        
-    def test_merge_plus_strand4 (self ):
-        alignInstance1 = Align()
-        alignInstance2 = Align()
-
-        line1 = "chr1\t1\t20\tTE2\t1\t12\t1e-20\t30\t90.2\n"
-        line2 = "chr1\t2\t10\tTE2\t2\t10\t1e-20\t30\t90.2\n"
-
-        alignInstance1.setFromString(line1)
-        alignInstance2.setFromString(line2)
-        
-        expLine = "chr1\t1\t20\tTE2\t1\t12\t1e-20\t30\t90.2\n"
-        expAlign = Align()
-        expAlign.setFromString(expLine)
-
-        alignInstance1.merge(alignInstance2)
-        obsAlign = alignInstance1
-
-        self.assertEquals(expAlign, obsAlign)
-        
-    def test_merge__neg_strand1 (self):
-
-        rangeQuery1 = Range("chr1", 20, 2); rangeSubject1 = Range("TE2", 10, 3)
-        rangeQuery2 = Range("chr1", 1, 10); rangeSubject2 = Range("TE2", 1, 9)
-
-        alignInstance1 = Align(rangeQuery1, rangeSubject1, 0, 30, 90.2)
-        alignInstance2 = Align(rangeQuery2, rangeSubject2, 0, 30, 90.2)
-        
-        expRangeQuery = Range("chr1", 20, 1); expRangeSubject = Range("TE2", 10, 1)
-        expAlign = Align(expRangeQuery, expRangeSubject, 0, 30, 90.2)
-
-        alignInstance1.merge(alignInstance2)
-        obsAlign = alignInstance1
-        
-        self.assertEquals(expAlign, obsAlign)
-        
-    def test_merge__neg_strand2 (self):
-        rangeQuery1 = Range("chr1", 20, 2); rangeSubject1 = Range("TE2", 10, 3)
-        rangeQuery2 = Range("chr1", 4, 30); rangeSubject2 = Range("TE2", 4, 12)
-
-        alignInstance1 = Align(rangeQuery1, rangeSubject1, 0, 30, 90.2)
-        alignInstance2 = Align(rangeQuery2, rangeSubject2, 0, 30, 90.2)
-        
-        expRangeQuery = Range("chr1", 30, 2); expRangeSubject = Range("TE2", 12, 3)
-        expAlign = Align(expRangeQuery, expRangeSubject, 0, 30, 90.2)
-
-        alignInstance1.merge(alignInstance2)
-        obsAlign = alignInstance1
-
-        self.assertEquals(expAlign, obsAlign)
-        
-    def test_merge_neg_strand3 (self ):
-        rangeQuery1 = Range("chr1", 10, 2); rangeSubject1 = Range("TE2", 10, 3)
-        rangeQuery2 = Range("chr1", 1, 20); rangeSubject2 = Range("TE2", 1, 12)
-
-        alignInstance1 = Align(rangeQuery1, rangeSubject1, 0, 30, 90.2)
-        alignInstance2 = Align(rangeQuery2, rangeSubject2, 0, 30, 90.2)
-       
-        expRangeQuery = Range("chr1", 20, 1); expRangeSubject = Range("TE2", 12, 1)
-        expAlign = Align(expRangeQuery, expRangeSubject, 0, 30, 90.2)
-
-        alignInstance1.merge(alignInstance2)
-        obsAlign = alignInstance1
-
-        self.assertEquals(expAlign, obsAlign)
-        
-    def test_merge_neg_strand4 (self ):
-        rangeQuery1 = Range("chr1", 20, 1); rangeSubject1 = Range("TE2", 12, 1)
-        rangeQuery2 = Range("chr1", 2, 10); rangeSubject2 = Range("TE2", 2, 10)
-
-        alignInstance1 = Align(rangeQuery1, rangeSubject1, 0, 30, 90.2)
-        alignInstance2 = Align(rangeQuery2, rangeSubject2, 0, 30, 90.2)
-        
-        expRangeQuery = Range("chr1", 20, 1); expRangeSubject = Range("TE2", 12, 1)
-        expAlign = Align(expRangeQuery, expRangeSubject, 0, 30, 90.2)
-
-        alignInstance1.merge(alignInstance2)
-        obsAlign = alignInstance1
-
-        self.assertEquals(expAlign, obsAlign)
-        
-    def test_merge_id_score_identity_eValue (self):
-        rangeQuery1 = Range("chr1", 20, 1); rangeSubject1 = Range("TE2", 12, 1)
-        rangeQuery2 = Range("chr1", 2, 10); rangeSubject2 = Range("TE2", 2, 10)
-
-        alignInstance1 = Align(rangeQuery1, rangeSubject1, 0.05, 20, 90.2)
-        alignInstance1.id = 1
-        alignInstance2 = Align(rangeQuery2, rangeSubject2, 0, 30, 90.3)
-        alignInstance2.id = 2
-
-        expRangeQuery = Range("chr1", 20, 1); expRangeSubject = Range("TE2", 12, 1)
-        expAlign = Align(expRangeQuery, expRangeSubject, 0, 30, 90.3)
-        expAlign.id = 1
-        
-        alignInstance1.merge(alignInstance2)
-        obsAlign = alignInstance1
-
-        self.assertEquals(expAlign, obsAlign)
-        self.assertEquals(expAlign.id, obsAlign.id)
-        
-    def test_setFromTuple_QryRev(self):
-        self._align.setFromTuple( ( "qry1", 100, 1, "sbj1", 201, 300, 0.0, 135, 97.2 ) )
-        self.assertEqual( self._align.range_query.seqname, "qry1" )
-        self.assertEqual( self._align.range_query.start, 1 )
-        self.assertEqual( self._align.range_query.end, 100 )
-        self.assertEqual( self._align.range_subject.seqname, "sbj1" )
-        self.assertEqual( self._align.range_subject.start, 300 )
-        self.assertEqual( self._align.range_subject.end, 201 )
-        self.assertEqual( self._align.e_value, 0.0 )
-        self.assertEqual( self._align.score, 135 )
-        self.assertEquals( self._align.identity, 97.2 )
-        
-    def test_setFromTuple_identityAsFloat(self):
-        self._align.setFromTuple( ( "qry1", "301", "600", "sbj1", "1", "300", "0.0", "135", 0.0) )
-        self.assertEqual( self._align.range_query.seqname, "qry1" )
-        self.assertEqual( self._align.range_query.start, 301 )
-        self.assertEqual( self._align.range_query.end, 600 )
-        self.assertEqual( self._align.range_subject.seqname, "sbj1" )
-        self.assertEqual( self._align.range_subject.start, 1 )
-        self.assertEqual( self._align.range_subject.end, 300 )
-        self.assertEqual( self._align.e_value, float("0.0") )
-        self.assertEqual( self._align.score, float("135") )
-        self.assertEquals( self._align.identity, 0.0 )
-        
-    def test_setFromString(self):
-        line = "chr1\t1\t10\tTE2\t11\t17\t1e-20\t30\t90.2\n"
-        self._align.setFromString( line )
-        self.assertEqual( self._align.range_query.seqname, "chr1" )
-        self.assertEqual( self._align.range_query.start, 1 )
-        self.assertEqual( self._align.range_query.end, 10 )
-        self.assertEqual( self._align.range_subject.seqname, "TE2" )
-        self.assertEqual( self._align.range_subject.start, 11 )
-        self.assertEqual( self._align.range_subject.end, 17 )
-        self.assertEqual( self._align.e_value, float("1e-20") )
-        self.assertEqual( self._align.score, float("30") )
-        self.assertEquals( float(self._align.identity), float("90.2") )
-        
-    def test__eq__(self):
-        self._align.setFromString( "chr1\t1\t6\tTE2\t11\t16\t1e-20\t30\t90.2\n" )
-        o = Align()
-        o.setFromString( "chr1\t1\t6\tTE2\t11\t16\t1e-20\t30\t90.2\n" )
-        self.assertEqual( self._align,  o )
-        o.setFromString( "chromosome1\t1\t6\tTE2\t11\t16\t1e-20\t30\t90.2\n" )
-        self.assertNotEqual( self._align, o )
-        o.setFromString( "chr1\t1\t6\ttranspElem2\t11\t16\t1e-20\t30\t90.2\n" )
-        self.assertNotEqual( self._align, o )
-        o.setFromString( "chr1\t100\t600\tTE2\t11\t16\t1e-20\t30\t90.2\n" )
-        self.assertNotEqual( self._align, o )
-        o.setFromString( "chr1\t1\t6\tTE2\t1100\t1600\t1e-20\t30\t90.2\n" )
-        self.assertNotEqual( self._align, o )
-        o.setFromString( "chr1\t1\t6\tTE2\t11\t16\t1e-20\t30000\t90.2\n" )
-        self.assertNotEqual( self._align, o )
-        
-    def test_getSubjectAsMapOfQuery_direct(self):
-        exp = Map( name="TE2", seqname="chr1", start=1, end=6 )
-        self._align.setFromString( "chr1\t1\t6\tTE2\t11\t16\t1e-20\t30\t90.2\n" )
-        obs = self._align.getSubjectAsMapOfQuery()
-        self.assertEqual( obs, exp )
-        
-    def test_getSubjectAsMapOfQuery_reverse(self):
-        exp = Map( name="TE2", seqname="chr1", start=6, end=1 )
-        self._align.setFromString( "chr1\t1\t6\tTE2\t16\t11\t1e-20\t30\t90.2\n" )
-        obs = self._align.getSubjectAsMapOfQuery()
-        self.assertEqual( obs, exp )
-        
-    def test_writeSubjectAsMapOfQuery( self ):
-        self._align.setFromTuple( ( "chr3", "250", "151", "seq5", "1", "100", "1e-32", "147", "87.9" ) )
-        expFile = "dummyExpFile_%s" % ( self._uniqId )
-        expFileHandler = open( expFile, "w" )
-        expFileHandler.write( "seq5\tchr3\t250\t151\n" )
-        expFileHandler.close()
-        obsFile = "dummyObsFile_%s" % ( self._uniqId )
-        obsFileHandler = open( obsFile, "w" )
-        self._align.writeSubjectAsMapOfQuery( obsFileHandler )
-        obsFileHandler.close()
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
-        for f in [ expFile, obsFile ]:
-            if os.path.exists( f ):
-                os.remove( f )
-                
-    def test_areQrySbjOnOppositeStrands(self):
-        self._align.setFromTuple( ( "qry1", "1", "100", "sbj1", "1", "100", "0.0", "135", "95.7" ) )
-        obs = self._align.areQrySbjOnOppositeStrands()
-        self.assertFalse( obs )
-        self._align.setFromTuple( ( "qry1", "600", "301", "sbj1", "1", "300", "0.0", "135", "95.7" ) )
-        obs = self._align.areQrySbjOnOppositeStrands()
-        self.assertTrue( obs )
-        
-    def test_reverse(self):
-        line = "chr1\t1\t10\tTE2\t11\t17\t1e-20\t30\t90.2"
-        expLine = "chr1\t10\t1\tTE2\t17\t11\t1e-20\t30\t90.200000"
-        
-        obsAlignInstance = Align()
-        obsAlignInstance.setFromString(line)
-        obsAlignInstance.reverse()
-        obsLine = obsAlignInstance.toString()
-
-        self.assertEquals(expLine, obsLine)
-        
-    def test_getMapsOfQueryAndSubject(self):
-        self._align.setFromTuple( ( "qry1", "1", "100", "sbj1", "1", "100", "0.0", "135", "95.7" ) )
-        
-        expMapQuery = Map()
-        expMapQuery.setFromTuple( ( "repet", "qry1", "1", "100" ) )
-        expMapSubject = Map()
-        expMapSubject.setFromTuple( ( "repet", "sbj1", "1", "100" ) )
-        
-        obsMapQuery, obsMapSubject = self._align.getMapsOfQueryAndSubject()
-        
-        self.assertEqual( expMapQuery, obsMapQuery )
-        self.assertEqual( expMapSubject, obsMapSubject )
-        
-    def test_getBin_bin_level_9(self):
-        tuple = ("chr1","190000000","390000000","TE2","11","17","1e-20","30","90.2")
-        self._align.setFromTuple(tuple)
-        expRes = 100000000.0
-        obsRes = self._align.getBin()
-        self.assertEquals(expRes, obsRes)
-
-    def test_getBin_bin_level_8(self):
-        tuple = ("chr1","19000000","39000000","TE2","11","17","1e-20","30","90.2")
-        self._align.setFromTuple(tuple)
-        expRes = 100000000.0
-        obsRes = self._align.getBin()
-        self.assertEquals(expRes, obsRes)
-        
-    def test_getBin_bin_level_7(self):
-        tuple = ("chr1","1900000","3900000","TE2","11","17","1e-20","30","90.2")
-        self._align.setFromTuple(tuple)
-        expRes = 10000000.0
-        obsRes = self._align.getBin()
-        self.assertEquals(expRes, obsRes)
-        
-    def test_getBin_bin_level_6(self):
-        tuple = ("chr1","190000","390000","TE2","11","17","1e-20","30","90.2")
-        self._align.setFromTuple(tuple)
-        obsRes = self._align.getBin()
-        expRes = 1000000.0
-        self.assertEquals(expRes, obsRes)
-        
-    def test_getBin_bin_level_5(self):
-        tuple = ("chr1","19000","39000","TE2","11","17","1e-20","30","90.2")
-        self._align.setFromTuple(tuple)
-        obsRes = self._align.getBin()
-        expRes = 100000.0
-        self.assertEquals(expRes, obsRes)
-        
-    def test_getBin_bin_level_4(self):
-        tuple = ("chr1","1900","3900","TE2","11","17","1e-20","30","90.2")
-        self._align.setFromTuple(tuple)
-        obsRes = self._align.getBin()
-        expRes = 10000.0
-        self.assertEquals(expRes, obsRes)
-        
-    def test_getBin_bin_level_3(self):
-        tuple = ("chr1","190","390","TE2","11","17","1e-20","30","90.2")
-        self._align.setFromTuple(tuple)
-        obsRes = self._align.getBin()
-        expRes = 1000.0
-        self.assertEquals(expRes, obsRes)
-        
-    def test_getBin_bin_level_2(self):
-        tuple = ("chr1","19","39","TE2","11","17","1e-20","30","90.2")
-        self._align.setFromTuple(tuple)
-        obsRes = self._align.getBin()
-        expRes = 1000.0
-        self.assertEquals(expRes, obsRes)
-        
-    def test_getBin_bin_level_1(self):
-        tuple = ("chr1","1","3","TE2","11","17","1e-20","30","90.2")
-        self._align.setFromTuple(tuple)
-        obsRes = self._align.getBin()
-        expRes = 1000.0
-        self.assertEquals(expRes, obsRes)
-        
-        
-    def test_switchQuerySubject_directS( self ):
-        tuple = ("chr1","1","3","TE2","11","17","1e-20","30","90.2")
-        self._align.setFromTuple( tuple )
-        exp = Align( Range("TE2","11","17"), Range("chr1","1","3"), "1e-20", "30", "90.2" )
-        self._align.switchQuerySubject()
-        self.assertEquals( exp, self._align )
-        
-        
-    def test_switchQuerySubject_reverseS( self ):
-        tuple = ("chr1","1","3","TE2","17","11","1e-20","30","90.2")
-        self._align.setFromTuple( tuple )
-        exp = Align( Range("TE2","11","17"), Range("chr1","3","1"), "1e-20", "30", "90.2" )
-        self._align.switchQuerySubject()
-        self.assertEquals( exp, self._align )
-        
-        
-    def test_toStringAsGff( self ):
-        self._align.setFromString( "chr1\t1\t10\tTE3\t11\t17\t1e-20\t30\t85.2\n" )
-        exp = "chr1\tREPET\tmatch\t1\t10\t1e-20\t+\t.\tID=23;Target=TE3 11 17"
-        obs = self._align.toStringAsGff( ID="23" )
-        self.assertEqual( obs, exp )
-        
-        
-test_suite = unittest.TestSuite()
-test_suite.addTest( unittest.makeSuite( Test_Align ) )
-if __name__ == "__main__":
-    unittest.TextTestRunner(verbosity=2).run( test_suite )
--- a/commons/core/coord/test/Test_AlignUtils.py	Mon Apr 29 03:26:07 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,777 +0,0 @@
-# Copyright INRA (Institut National de la Recherche Agronomique)
-# http://www.inra.fr
-# http://urgi.versailles.inra.fr
-#
-# This software is governed by the CeCILL license under French law and
-# abiding by the rules of distribution of free software.  You can  use, 
-# modify and/ or redistribute the software under the terms of the CeCILL
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# "http://www.cecill.info". 
-#
-# As a counterpart to the access to the source code and  rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty  and the software's author,  the holder of the
-# economic rights,  and the successive licensors  have only  limited
-# liability. 
-#
-# In this respect, the user's attention is drawn to the risks associated
-# with loading,  using,  modifying and/or developing or reproducing the
-# software by the user in light of its specific status of free software,
-# that may mean  that it is complicated to manipulate,  and  that  also
-# therefore means  that it is reserved for developers  and  experienced
-# professionals having in-depth computer knowledge. Users are therefore
-# encouraged to load and test the software's suitability as regards their
-# requirements in conditions enabling the security of their systems and/or 
-# data to be ensured and,  more generally, to use and operate it in the 
-# same conditions as regards security. 
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL license and that you accept its terms.
-
-
-import unittest
-import os
-import time
-import shutil
-from commons.core.coord.AlignUtils import AlignUtils
-from commons.core.coord.Align import Align
-from commons.core.utils.FileUtils import FileUtils
-from commons.core.coord.Range import Range
-
-
-class Test_AlignUtils( unittest.TestCase ):
-    
-    def setUp( self ):
-        self._uniqId = "%s_%s" % ( time.strftime("%Y%m%d%H%M%S"), os.getpid() )
-        
-        
-    def tearDown( self ):
-        self._uniqId = ""
-        
-        
-    def test_getAlignListFromFile( self ):
-        a1 = Align()
-        a1.setFromTuple( ( "chr1", "1", "100", "seq3", "1", "100", "1e-23", "89", "97.26" ) )
-        a2 = Align()
-        a2.setFromTuple( ( "chr2", "121", "210", "seq5", "21", "110", "1e-32", "95", "98.13" ) )
-        
-        inFileName = "dummyFile_%s" % ( self._uniqId )
-        inFileHandler = open( inFileName, "w" )
-        a1.write( inFileHandler )
-        a2.write( inFileHandler )
-        inFileHandler.close()
-        
-        lExp = [ a1, a2 ]
-        lObs = AlignUtils.getAlignListFromFile( inFileName )
-        
-        self.assertEqual( lExp, lObs )
-        
-        if os.path.exists( inFileName ):
-            os.remove( inFileName )
-            
-            
-    def test_getListOfScores( self ):
-        a1 = Align()
-        a1.setFromTuple( ( "chr1", "1", "100", "seq3", "1", "100", "1e-23", "89", "97.26" ) )
-        a2 = Align()
-        a2.setFromTuple( ( "chr2", "121", "210", "seq5", "21", "110", "1e-32", "95", "98.13" ) )
-        lAligns = [ a1, a2 ]
-        
-        lExp = [ 89, 95 ]
-        lObs = AlignUtils.getListOfScores( lAligns )
-        
-        self.assertEqual( lExp, lObs )
-        
-        
-    def test_getScoreListFromFile( self ):
-        alignFile = "dummyAlignFile"
-        alignFileHandler = open( alignFile, "w" )
-        alignFileHandler.write( "chr3\t1\t100\tchr5\t11\t110\t1e-52\t133\t87.2\n" )
-        alignFileHandler.write( "chr7\t1\t200\tchr2\t11\t210\t1e-78\t235\t98.9\n" )
-        alignFileHandler.close()
-        
-        lExp = [ 133, 235 ]
-        lObs = AlignUtils.getScoreListFromFile( alignFile )
-        self.assertEqual( lExp, lObs )
-        
-        os.remove( alignFile )
-        
-        
-    def test_getScoreListFromFile_empty_file( self ):
-        alignFile = "dummyAlignFile"
-        alignFileHandler = open( alignFile, "w" )
-        alignFileHandler.close()
-        
-        lExp = []
-        lObs = AlignUtils.getScoreListFromFile( alignFile )
-        
-        self.assertEqual( lExp, lObs )
-        
-        os.remove( alignFile )
-        
-        
-    def test_getScoreListFromFile_with_endline_char( self ):
-        alignFile = "dummyAlignFile"
-        alignFileHandler = open( alignFile, "w" )
-        alignFileHandler.write( "chr3\t1\t100\tchr5\t11\t110\t1e-52\t133\t87.2\n" )
-        alignFileHandler.write( "\n" )
-        alignFileHandler.write( "chr7\t1\t200\tchr2\t11\t210\t1e-78\t235\t98.9\n" )
-        alignFileHandler.write( "\n" )
-        alignFileHandler.close()
-        
-        lExp = [133, 235]
-        lObs = AlignUtils.getScoreListFromFile( alignFile )
-        
-        self.assertEqual( lExp, lObs )
-        
-        os.remove( alignFile )
-        
-        
-    def test_convertAlignFileIntoMapFileWithQueriesAndSubjects( self ):
-        alignFile = "dummyAlignFile_%s" % ( self._uniqId )
-        alignFileHandler = open( alignFile, "w" )
-        alignFileHandler.write( "chr3\t1\t100\tchr5\t11\t110\t1e-52\t133\t87.2\n" )
-        alignFileHandler.write( "chr7\t1\t200\tchr2\t11\t210\t1e-78\t235\t98.9\n" )
-        alignFileHandler.close()
-        
-        expFile = "dummyExpFile_%s" % ( self._uniqId )
-        expFileHandler = open( expFile, "w" )
-        expFileHandler.write( "repet\tchr3\t1\t100\n" )
-        expFileHandler.write( "repet\tchr5\t11\t110\n" )
-        expFileHandler.write( "repet\tchr7\t1\t200\n" )
-        expFileHandler.write( "repet\tchr2\t11\t210\n" )
-        expFileHandler.close()
-        
-        obsFile = "dummyObsFile_%s" % ( self._uniqId )
-        
-        AlignUtils.convertAlignFileIntoMapFileWithQueriesAndSubjects( alignFile, obsFile )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
-        
-        for f in [ alignFile, expFile, obsFile ]:
-            if os.path.exists( f ):
-                os.remove( f )
-                
-                
-    def test_convertAlignFileIntoMapFileWithSubjectsOnQueries( self ):
-        alignFile = "dummyAlignFile_%s" % ( self._uniqId )
-        alignFileHandler = open( alignFile, "w" )
-        alignFileHandler.write( "chr3\t1\t100\tTE1\t11\t110\t1e-52\t133\t87.2\n" )
-        alignFileHandler.write( "chr7\t1\t200\tTE1\t11\t210\t1e-78\t235\t98.9\n" )
-        alignFileHandler.close()
-        
-        expFile = "dummyExpFile_%s" % ( self._uniqId )
-        expFileHandler = open( expFile, "w" )
-        expFileHandler.write( "TE1\tchr3\t1\t100\n" )
-        expFileHandler.write( "TE1\tchr7\t1\t200\n" )
-        expFileHandler.close()
-        
-        obsFile = "dummyObsFile_%s" % ( self._uniqId )
-        
-        AlignUtils.convertAlignFileIntoMapFileWithSubjectsOnQueries( alignFile, obsFile )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
-        
-        for f in [ alignFile, expFile, obsFile ]:
-            if os.path.exists( f ):
-                os.remove( f )
-                
-                
-    def test_getAlignListSortedByDecreasingScoreThenLength( self ):
-        a1 = Align()
-        a1.setFromTuple( ( "chr1", "1", "100", "seq3", "1", "100", "1e-23", "89", "97.26" ) )
-        a2 = Align()
-        a2.setFromTuple( ( "chr7", "121", "200", "seq9", "21", "110", "1e-32", "95", "98.13" ) )
-        a3 = Align()
-        a3.setFromTuple( ( "chr2", "121", "210", "seq5", "21", "110", "1e-32", "95", "98.13" ) )
-        lAligns = [ a1, a2, a3 ]
-        
-        lExp = [ a3, a2, a1 ]
-        
-        lObs = AlignUtils.getAlignListSortedByDecreasingScoreThenLength( lAligns )
-        
-        self.assertEqual( lExp, lObs )
-        
-        
-    def test_convertAlignFileIntoPathFile( self ):
-        alignFile = "dummyAlignFile_%s" % ( self._uniqId )
-        alignFileHandler = open( alignFile, "w" )
-        alignFileHandler.write( "chr3\t1\t100\tchr5\t11\t110\t1e-52\t133\t87.200000\n" )
-        alignFileHandler.write( "chr7\t1\t200\tchr2\t11\t210\t1e-78\t235\t98.900000\n" )
-        alignFileHandler.close()
-        
-        expFile = "dummyExpFile_%s" % ( self._uniqId )
-        expFileHandler = open( expFile, "w" )
-        expFileHandler.write( "1\tchr3\t1\t100\tchr5\t11\t110\t1e-52\t133\t87.200000\n" )
-        expFileHandler.write( "2\tchr7\t1\t200\tchr2\t11\t210\t1e-78\t235\t98.900000\n" )
-        expFileHandler.close()
-        
-        obsFile = "dummyObsFile_%s" % ( self._uniqId )
-        
-        AlignUtils.convertAlignFileIntoPathFile( alignFile, obsFile )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
-        
-        for f in [ alignFile, expFile, obsFile ]:
-            if os.path.exists( f ):
-                os.remove( f )
-                
-                
-    def test_sortAlignFile( self ):
-        alignFile = "dummyAlignFile_%s" % ( self._uniqId )
-        alignFileHandler = open( alignFile, "w" )
-        alignFileHandler.write( "chr7\t1\t200\tchr2\t11\t210\t1e-78\t235\t98.900000\n" )
-        alignFileHandler.write( "chr3\t1\t100\tchr5\t11\t110\t1e-52\t133\t87.200000\n" )
-        alignFileHandler.write( "chr8\t1\t100\tchr5\t11\t110\t1e-52\t133\t87.200000\n" )
-        alignFileHandler.write( "chr8\t1\t100\tchr5\t15\t90\t1e-52\t133\t87.200000\n" )
-        alignFileHandler.write( "chr8\t1\t100\tchr5\t11\t100\t1e-52\t133\t87.200000\n" )
-        alignFileHandler.close()
-        
-        expFile = "dummyExpFile_%s" % ( self._uniqId )
-        expFileHandler = open( expFile, "w" )
-        expFileHandler.write( "chr3\t1\t100\tchr5\t11\t110\t1e-52\t133\t87.200000\n" )
-        expFileHandler.write( "chr7\t1\t200\tchr2\t11\t210\t1e-78\t235\t98.900000\n" )
-        expFileHandler.write( "chr8\t1\t100\tchr5\t11\t100\t1e-52\t133\t87.200000\n" )
-        expFileHandler.write( "chr8\t1\t100\tchr5\t11\t110\t1e-52\t133\t87.200000\n" )
-        expFileHandler.write( "chr8\t1\t100\tchr5\t15\t90\t1e-52\t133\t87.200000\n" )
-        expFileHandler.close()
-        
-        obsFile = "dummyObsFile_%s" % ( self._uniqId )
-        
-        AlignUtils.sortAlignFile( alignFile, obsFile )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
-        
-        for f in [ alignFile, expFile, obsFile ]:
-            if os.path.exists( f ):
-                os.remove( f )
-    
-    def test_writeListInFile( self ):
-        line1 = ("chr1\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.200000\n")
-        line2 = ("chr1\t200\t220\tTE2\t150\t200\t1e-20\t30\t90.200000\n")
-        line3 = ("chr1\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.200000\n")
-        
-        expFileName = "expFileName.align"
-        expFileHandle = open ( expFileName, 'w' )
-        expFileHandle.write(line1)
-        expFileHandle.write(line2)
-        expFileHandle.write(line3)
-        expFileHandle.close()
-        
-        iAlign1 = Align()
-        iAlign1.setFromString("chr1\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign2 = Align()
-        iAlign2.setFromString("chr1\t200\t220\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign3 = Align()
-        iAlign3.setFromString("chr1\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        
-        obsFileName = "obsFileName.align"
-        obsPathList =[iAlign1, iAlign2, iAlign3] 
-        
-        AlignUtils.writeListInFile( obsPathList, obsFileName )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFileName, obsFileName ) )
-        
-        os.remove( obsFileName )
-        os.remove( expFileName )
-        
-        
-    def test_splitAlignListByQueryName_empty_list( self ):
-        lAlign = []
-        
-        obsLAlign = AlignUtils.splitAlignListByQueryName( lAlign )
-        
-        expLAlign = []
-        
-        self.assertEquals( expLAlign, obsLAlign )
-        
-        
-    def test_splitAlignListByQueryName( self ):
-        iAlign1 = Align()
-        iAlign1.setFromString("chr1\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign2 = Align()
-        iAlign2.setFromString("chr2\t200\t220\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign3 = Align()
-        iAlign3.setFromString("chr1\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        lAlign = [ iAlign1, iAlign2, iAlign3 ]
-        
-        obsLAlign = AlignUtils.splitAlignListByQueryName( lAlign )
-        
-        expLAlign = [ [ iAlign1, iAlign3 ],
-                     [ iAlign2 ] ]
-        
-        self.assertEquals( expLAlign, obsLAlign )
-        
-        
-    def test_splitAlignListByQueryName_last_align_alone( self ):
-        iAlign1 = Align()
-        iAlign1.setFromString("chr1\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign2 = Align()
-        iAlign2.setFromString("chr2\t200\t220\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign3 = Align()
-        iAlign3.setFromString("chr1\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign4 = Align()
-        iAlign4.setFromString("chr3\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign5 = Align()
-        iAlign5.setFromString("chr2\t200\t220\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign6 = Align()
-        iAlign6.setFromString("chr1\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign7 = Align()
-        iAlign7.setFromString("chr1\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign8 = Align()
-        iAlign8.setFromString("chr2\t200\t220\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign9 = Align()
-        iAlign9.setFromString("chr4\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        lAlign = [ iAlign1, iAlign2, iAlign3, iAlign4, iAlign5, iAlign6, iAlign7, iAlign8, iAlign9 ]
-
-        obsLAlign = AlignUtils.splitAlignListByQueryName( lAlign )
-        
-        expLAlign = [ [ iAlign1, iAlign3, iAlign6, iAlign7 ],
-                     [ iAlign2, iAlign5, iAlign8 ],
-                     [ iAlign4 ],
-                     [ iAlign9 ] ]
-        
-        self.assertEquals( expLAlign, obsLAlign )
-        
-        
-    def test_createAlignFiles( self ):
-        expFile1 = "dummyExpAlignFile.align_1"
-        expFile2 = "dummyExpAlignFile.align_2"
-        expFile3 = "dummyExpAlignFile.align_3"
-        expFile4 = "dummyExpAlignFile.align_4"
-        
-        f1 = open(expFile1, "w")
-        iAlign1 = Align()
-        iAlign1.setFromString("chr1\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign1.write(f1)
-        iAlign3 = Align()
-        iAlign3.setFromString("chr1\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign3.write(f1)
-        iAlign6 = Align()
-        iAlign6.setFromString("chr1\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign6.write(f1)
-        iAlign7 = Align()
-        iAlign7.setFromString("chr1\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign7.write(f1)
-        f1.close()
-        
-        f2 = open(expFile2, "w")
-        iAlign2 = Align()
-        iAlign2.setFromString("chr2\t200\t220\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign2.write(f2)
-        iAlign5 = Align()
-        iAlign5.setFromString("chr2\t200\t220\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign5.write(f2)
-        iAlign8 = Align()
-        iAlign8.setFromString("chr2\t200\t220\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign8.write(f2)
-        f2.close()
-        
-        f3 = open(expFile3, "w")
-        iAlign4 = Align()
-        iAlign4.setFromString("chr3\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign4.write(f3)
-        f3.close()
-        
-        f4 = open(expFile4, "w")
-        iAlign9 = Align()
-        iAlign9.setFromString("chr4\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign9.write(f4)
-        f4.close()
-        
-        lAlignList = [ [ iAlign1, iAlign3, iAlign6, iAlign7 ],
-                      [ iAlign2, iAlign5, iAlign8 ],
-                      [ iAlign4 ],
-                      [ iAlign9 ] ]
-        
-        AlignUtils.createAlignFiles( lAlignList, "dummyAlignFile" )
-        
-        obsFile1 = "dummyAlignFile_1.align"
-        obsFile2 = "dummyAlignFile_2.align"
-        obsFile3 = "dummyAlignFile_3.align"
-        obsFile4 = "dummyAlignFile_4.align"
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile1, obsFile1 ) )
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile2, obsFile2 ) )
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile3, obsFile3 ) )
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile4, obsFile4 ) )
-        
-        os.remove(expFile1)
-        os.remove(expFile2)
-        os.remove(expFile3)
-        os.remove(expFile4)
-        os.remove(obsFile1)
-        os.remove(obsFile2)
-        os.remove(obsFile3)
-        os.remove(obsFile4)
-        
-
-    def test_createAlignFiles_eleven_output_files( self ):
-        expFile1 = "dummyExpAlignFile.align_01"
-        expFile2 = "dummyExpAlignFile.align_02"
-        expFile3 = "dummyExpAlignFile.align_03"
-        expFile4 = "dummyExpAlignFile.align_04"
-        expFile5 = "dummyExpAlignFile.align_05"
-        expFile6 = "dummyExpAlignFile.align_06"
-        expFile7 = "dummyExpAlignFile.align_07"
-        expFile8 = "dummyExpAlignFile.align_08"
-        expFile9 = "dummyExpAlignFile.align_09"
-        expFile10 = "dummyExpAlignFile.align_10"
-        expFile11 = "dummyExpAlignFile.align_11"
-        lExpFiles = [expFile1, expFile2, expFile3, expFile4, expFile5, expFile6, expFile7, expFile8, expFile9, expFile10, expFile11]
-        
-        f1 = open(expFile1, "w")
-        iAlign1 = Align()
-        iAlign1.setFromString("chr1\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign1.write(f1)
-        f1.close()
-        
-        f2 = open(expFile2, "w")
-        iAlign2 = Align()
-        iAlign2.setFromString("chr2\t200\t220\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign2.write(f2)
-        f2.close()
-        
-        f3 = open(expFile3, "w")
-        iAlign3 = Align()
-        iAlign3.setFromString("chr3\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign3.write(f3)
-        f3.close()
-        
-        f4 = open(expFile4, "w")
-        iAlign4 = Align()
-        iAlign4.setFromString("chr4\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign4.write(f4)
-        f4.close()
-        
-        f = open(expFile5, "w")
-        iAlign5 = Align()
-        iAlign5.setFromString("chr5\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign5.write(f)
-        f.close()
-        
-        f = open(expFile6, "w")
-        iAlign6 = Align()
-        iAlign6.setFromString("chr6\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign6.write(f)
-        f.close()
-        
-        f = open(expFile7, "w")
-        iAlign7 = Align()
-        iAlign7.setFromString("chr7\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign7.write(f)
-        f.close()
-        
-        f = open(expFile8, "w")
-        iAlign8 = Align()
-        iAlign8.setFromString("chr8\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign8.write(f)
-        f.close()
-        
-        f = open(expFile9, "w")
-        iAlign9 = Align()
-        iAlign9.setFromString("chr9\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign9.write(f)
-        f.close()
-        
-        f = open(expFile10, "w")
-        iAlign10 = Align()
-        iAlign10.setFromString("chr10\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign10.write(f)
-        f.close()
-        
-        f = open(expFile11, "w")
-        iAlign11 = Align()
-        iAlign11.setFromString("chr11\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign11.write(f)
-        f.close()
-        
-        lAlignList = [[iAlign1], [iAlign2], [iAlign3], [iAlign4], [iAlign5], [iAlign6], [iAlign7], [iAlign8], [iAlign9], [iAlign10], [iAlign11]]
-        
-        AlignUtils.createAlignFiles(lAlignList, "dummyAlignFile")
-
-        obsFile1 = "dummyAlignFile_01.align"
-        obsFile2 = "dummyAlignFile_02.align"
-        obsFile3 = "dummyAlignFile_03.align"
-        obsFile4 = "dummyAlignFile_04.align"
-        obsFile5 = "dummyAlignFile_05.align"
-        obsFile6 = "dummyAlignFile_06.align"
-        obsFile7 = "dummyAlignFile_07.align"
-        obsFile8 = "dummyAlignFile_08.align"
-        obsFile9 = "dummyAlignFile_09.align"
-        obsFile10 = "dummyAlignFile_10.align"
-        obsFile11 = "dummyAlignFile_11.align"
-        lObsFiles = [obsFile1, obsFile2, obsFile3, obsFile4, obsFile5, obsFile6, obsFile7, obsFile8, obsFile9, obsFile10, obsFile11]
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile1, obsFile1 ) )
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile2, obsFile2 ) )
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile3, obsFile3 ) )
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile4, obsFile4 ) )
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile5, obsFile5 ) )
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile6, obsFile6 ) )
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile7, obsFile7 ) )
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile8, obsFile8 ) )
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile9, obsFile9 ) )
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile10, obsFile10 ) )
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile11, obsFile11 ) )
-        
-        for file in lExpFiles:
-            os.remove(file)
-        for file in lObsFiles:
-            os.remove(file)
-            
-            
-    def test_createAlignFiles_dirName_specified( self ):
-        expFile1 = "dummyExpAlignFile.align_1"
-        expFile2 = "dummyExpAlignFile.align_2"
-        expFile3 = "dummyExpAlignFile.align_3"
-        expFile4 = "dummyExpAlignFile.align_4"
-        
-        f1 = open(expFile1, "w")
-        iAlign1 = Align()
-        iAlign1.setFromString("chr1\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign1.write(f1)
-        iAlign3 = Align()
-        iAlign3.setFromString("chr1\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign3.write(f1)
-        iAlign6 = Align()
-        iAlign6.setFromString("chr1\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign6.write(f1)
-        iAlign7 = Align()
-        iAlign7.setFromString("chr1\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign7.write(f1)
-        f1.close()
-        
-        f2 = open(expFile2, "w")
-        iAlign2 = Align()
-        iAlign2.setFromString("chr2\t200\t220\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign2.write(f2)
-        iAlign5 = Align()
-        iAlign5.setFromString("chr2\t200\t220\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign5.write(f2)
-        iAlign8 = Align()
-        iAlign8.setFromString("chr2\t200\t220\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign8.write(f2)
-        f2.close()
-        
-        f3 = open(expFile3, "w")
-        iAlign4 = Align()
-        iAlign4.setFromString("chr3\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign4.write(f3)
-        f3.close()
-        
-        f4 = open(expFile4, "w")
-        iAlign9 = Align()
-        iAlign9.setFromString("chr4\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign9.write(f4)
-        f4.close()
-        
-        lAlignList = [[iAlign1, iAlign3, iAlign6, iAlign7], [iAlign2, iAlign5, iAlign8], [iAlign4], [iAlign9]]
- 
-        dirName = "dummyAlignDir"    
-            
-        AlignUtils.createAlignFiles(lAlignList, "dummyAlignFile", dirName)
-
-        obsFile1 = dirName + "/dummyAlignFile_1.align"
-        obsFile2 = dirName + "/dummyAlignFile_2.align"
-        obsFile3 = dirName + "/dummyAlignFile_3.align"
-        obsFile4 = dirName + "/dummyAlignFile_4.align"
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile1, obsFile1 ) )
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile2, obsFile2 ) )
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile3, obsFile3 ) )
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile4, obsFile4 ) )
-        
-        os.remove(expFile1)
-        os.remove(expFile2)
-        os.remove(expFile3)
-        os.remove(expFile4)
-        shutil.rmtree (dirName)
-        
-        
-    def test_createAlignFiles_dirName_specified_with_ended_slash( self ):
-        expFile1 = "dummyExpAlignFile.align_1"
-        expFile2 = "dummyExpAlignFile.align_2"
-        expFile3 = "dummyExpAlignFile.align_3"
-        expFile4 = "dummyExpAlignFile.align_4"
-        
-        f1 = open(expFile1, "w")
-        iAlign1 = Align()
-        iAlign1.setFromString("chr1\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign1.write(f1)
-        iAlign3 = Align()
-        iAlign3.setFromString("chr1\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign3.write(f1)
-        iAlign6 = Align()
-        iAlign6.setFromString("chr1\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign6.write(f1)
-        iAlign7 = Align()
-        iAlign7.setFromString("chr1\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign7.write(f1)
-        f1.close()
-        
-        f2 = open(expFile2, "w")
-        iAlign2 = Align()
-        iAlign2.setFromString("chr2\t200\t220\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign2.write(f2)
-        iAlign5 = Align()
-        iAlign5.setFromString("chr2\t200\t220\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign5.write(f2)
-        iAlign8 = Align()
-        iAlign8.setFromString("chr2\t200\t220\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign8.write(f2)
-        f2.close()
-        
-        f3 = open(expFile3, "w")
-        iAlign4 = Align()
-        iAlign4.setFromString("chr3\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign4.write(f3)
-        f3.close()
-        
-        f4 = open(expFile4, "w")
-        iAlign9 = Align()
-        iAlign9.setFromString("chr4\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iAlign9.write(f4)
-        f4.close()
-        
-        lAlignList = [[iAlign1, iAlign3, iAlign6, iAlign7], [iAlign2, iAlign5, iAlign8], [iAlign4], [iAlign9]]
- 
-        dirName = "dummyAlignDir/"    
-            
-        AlignUtils.createAlignFiles(lAlignList, "dummyAlignFile", dirName)
-
-        obsFile1 = dirName + "dummyAlignFile_1.align"
-        obsFile2 = dirName + "dummyAlignFile_2.align"
-        obsFile3 = dirName + "dummyAlignFile_3.align"
-        obsFile4 = dirName + "dummyAlignFile_4.align"
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile1, obsFile1 ) )
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile2, obsFile2 ) )
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile3, obsFile3 ) )
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile4, obsFile4 ) )
-        
-        os.remove(expFile1)
-        os.remove(expFile2)
-        os.remove(expFile3)
-        os.remove(expFile4)
-        shutil.rmtree (dirName)
-        
-        
-    def test_sortList( self ):
-        iAlign1 = Align( Range("qry1",3,80), Range("sbj1",3,80), 1e-20, 103, 97.3 )  # higher query start
-        iAlign2 = Align( Range("qry1",1,100), Range("sbj1",1,100), 1e-20, 113, 97.3 )  # higher score
-        iAlign3 = Align( Range("qry2",1,100), Range("sbj1",1,100), 1e-20, 103, 97.3 )  # different query
-        iAlign4 = Align( Range("qry1",1,100), Range("sbj1",1,100), 1e-20, 103, 97.3 )  # canonical
-        iAlign5 = Align( Range("qry1",1,100), Range("sbj2",1,100), 1e-20, 103, 97.3 )  # different subject
-        iAlign6 = Align( Range("qry1",201,300), Range("sbj1",100,1), 1e-20, 103, 97.3 )  # subject on reverse strand
-        iAlign7 = Align( Range("qry1",401,500), Range("sbj1",1,100), 1e-20, 103, 97.3 )  # higher query start
-        lAligns = [ iAlign1, iAlign2, iAlign3, iAlign4, iAlign5, iAlign6, iAlign7 ]
-        lExp = [iAlign4, iAlign2, iAlign1, iAlign6, iAlign7, iAlign5, iAlign3]
-        lObs = AlignUtils.sortList( lAligns )
-        self.assertEquals( lExp, lObs )
-        
-        
-    def test_isOverlapping( self ):
-        iAlign1 = Align( Range("chr1",1,100), Range("TE1",11,110), 1e-20, 90.2, 30 )
-        iAlign2 = Align( Range("chr1",51,80), Range("TE1",61,90), 1e-20, 90.2, 30 )
-        self.assertTrue( iAlign1.isOverlapping( iAlign2 ) )
-        
-        iAlign1 = Align( Range("chr1",1,100), Range("TE1",11,110), 1e-20, 90.2, 30 )
-        iAlign2 = Align( Range("chr1",51,80), Range("TE1",161,190), 1e-20, 90.2, 30 )
-        self.assertFalse( iAlign1.isOverlapping( iAlign2 ) )
-        
-        
-    def test_mergeList( self ):
-        iAlign1 = Align( Range("chr1",81,120), Range("TE1",91,130), 1e-20, 90.2, 30 )
-        iAlign2 = Align( Range("chr2",51,80), Range("TE1",61,90), 1e-20, 90.2, 30 )  # different query
-        iAlign3 = Align( Range("chr1",1,100), Range("TE1",11,110), 1e-20, 90.2, 30 )  # to be merged with 1st line
-        iAlign4 = Align( Range("chr1",1,200), Range("TE2",11,210), 1e-20, 90.2, 30 )  # different subject
-        iAlign5 = Align( Range("chr1",1,100), Range("TE1",501,600), 1e-20, 90.2, 30 )  # non-overlapping subject
-        lAligns = [ iAlign1, iAlign2, iAlign3, iAlign4, iAlign5 ]
-        
-        iAlign6 = Align( Range("chr1",1,120), Range("TE1",11,130), 1e-20, 90.2, 30 )
-        lExp = [ iAlign6, iAlign5, iAlign4, iAlign2 ]
-        
-        lObs = AlignUtils.mergeList( lAligns )
-        
-        self.assertEquals( lExp, lObs )
-        
-        
-    def test_mergeFile_empty( self ):
-        inFile = "dummyInFile.align"
-        inF = open( inFile, "w" )
-        inF.close()
-        
-        expFile = "dummyExpFile.align"
-        expF = open( expFile, "w" )
-        expF.close()
-        
-        obsFile = "dummyObsFile.align"
-        AlignUtils.mergeFile( inFile, obsFile )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
-        
-        for f in [ inFile, expFile, obsFile ]:
-            os.remove( f )
-            
-            
-    def test_mergeFile( self ):
-        iAlign = Align()
-        
-        inFile = "dummyInFile.align"
-        inF = open( inFile, "w" )
-        iAlign.setFromString( "chr1\t81\t120\tTE1\t91\t130\t1e-20\t30\t90.2\n" )
-        iAlign.write( inF )
-        iAlign.setFromString( "chr2\t51\t80\tTE1\t61\t90\t1e-20\t30\t90.2\n" )  # different query
-        iAlign.write( inF )
-        iAlign.setFromString( "chr1\t1\t100\tTE1\t11\t110\t1e-20\t30\t90.2\n" )  # to be merged with 1st line
-        iAlign.write( inF )
-        iAlign.setFromString( "chr1\t1\t200\tTE2\t11\t210\t1e-20\t30\t90.2\n" )  # different subject
-        iAlign.write( inF )
-        inF.close()
-        
-        expFile = "dummyExpFile.align"
-        expF = open( expFile, "w" )
-        iAlign.setFromString( "chr1\t1\t120\tTE1\t11\t130\t1e-20\t30\t90.2\n" )
-        iAlign.write( expF )
-        iAlign.setFromString( "chr1\t1\t200\tTE2\t11\t210\t1e-20\t30\t90.2\n" )
-        iAlign.write( expF )
-        iAlign.setFromString( "chr2\t51\t80\tTE1\t61\t90\t1e-20\t30\t90.2\n" )
-        iAlign.write( expF )
-        expF.close()
-        
-        obsFile = "dummyObsFile.align"
-        AlignUtils.mergeFile( inFile, obsFile )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
-        
-        for f in [ inFile, expFile, obsFile ]:
-            os.remove( f )
-            
-            
-    def test_updateScoresInFile( self ):
-        iAlign = Align()
-        
-        inFile = "dummyInFile.align"
-        inHandler = open( inFile, "w" )
-        iAlign.setFromString( "query1\t1\t100\tsubject1\t1\t95\t1e-180\t230\t90.2\n" )
-        iAlign.write( inHandler )
-        inHandler.close()
-        
-        expFile = "dummyExpFile.align"
-        expHandler = open( expFile, "w" )
-        iAlign.setFromString( "query1\t1\t100\tsubject1\t1\t95\t1e-180\t%i\t90.2\n" % ( ( 100 - 1 + 1 ) * 90.2 / 100.0 ) )
-        iAlign.write( expHandler )
-        expHandler.close()
-        
-        obsFile = "dummyObsFile.align"
-        AlignUtils.updateScoresInFile( inFile, obsFile )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
-        
-        for f in [ inFile, expFile, obsFile ]:
-            os.remove( f )
-            
-            
-if __name__ == "__main__":
-    unittest.main()
\ No newline at end of file
--- a/commons/core/coord/test/Test_ConvCoord.py	Mon Apr 29 03:26:07 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,205 +0,0 @@
-import unittest
-import os
-import time
-from commons.core.coord.ConvCoord import ConvCoord
-from commons.core.utils.FileUtils import FileUtils
-from commons.core.sql.DbFactory import DbFactory
-from commons.core.coord.Map import Map
-
-class Test_ConvCoord( unittest.TestCase ):
-    
-    def setUp( self ):
-        self._i = ConvCoord()
-        self._uniqId = "%s_%s" % ( time.strftime("%Y%m%d%H%M%S") , os.getpid() )
-        self._inData = "dummyInData_%s" % ( self._uniqId )
-        self._mapData = "dummyMapData_%s" % ( self._uniqId )
-        self._expData = "dummyExpData_%s" % ( self._uniqId )
-        self._obsData = "dummyObsData_%s" % ( self._uniqId )
-        self._iDb = DbFactory.createInstance()
-        self._i._iDb = self._iDb
-        
-    def tearDown( self ):
-        self._iDb.close()
-
-#TODO: handle duplicated matchs for path
-#    def test_convCoordsChkToChrFromFile_duplicated_matchs( self ):
-#        dChunks2CoordMaps = {"chunk1": Map( "chunk1", "dmel_chr4", 760001, 960000 ),
-#                             "chunk2": Map( "chunk2", "dmel_chr4", 950001, 1150000 ) }
-#        tmpPathFileName = "dummyPathCoordOnChr_%s" % self._uniqId 
-#        self._writePathFileCoordOnChunk(tmpPathFileName)
-#        
-#        expPathFile = "dummyExpPathFile_%s" % self._uniqId
-#        self._writePathFileCoordOnChrWithOutDoublons(expPathFile)
-#        
-#        outTableName = self._i.convCoordsChkToChrFromFile(tmpPathFileName, "path", dChunks2CoordMaps)
-#        
-#        obsPathFile = "dummyObsPathFile_%s" % self._uniqId
-#        self._iDb.exportDataToFile(outTableName, obsPathFile)
-#        
-#        self.assertTrue(FileUtils.are2FilesIdentical(expPathFile, obsPathFile))
-#        
-#        for f in [ expPathFile, obsPathFile, tmpPathFileName ]:
-#            os.remove( f )
-#        self._iDb.dropTable(outTableName)
- 
-#TODO: handle matchs out of chunk overlap ? For one side (=> path 128, remove path 152) ? For two sides (path 129, fusion with path 154) ?
-#    def test_convCoordsChkToChrFromFile_matchs_out_of_overlap( self ):
-#        dChunks2CoordMaps = {"chunk1": Map( "chunk1", "dmel_chr4", 760001, 960000 ),
-#                             "chunk2": Map( "chunk2", "dmel_chr4", 950001, 1150000 ) }
-#        tmpPathFileName = "dummyPathCoordOnChr_%s" % self._uniqId 
-#        self._writePathFileCoordOnChunk_outOfOverlap(tmpPathFileName)
-#        
-#        expPathFile = "dummyExpPathFile_%s" % self._uniqId
-#        self._writePathFileCoordOnChrWithOutDoublons_outOfOverlap(expPathFile)
-#        
-#        outTableName = self._i.convCoordsChkToChrFromFile(tmpPathFileName, "path", dChunks2CoordMaps)
-#        
-#        obsPathFile = "dummyObsPathFile_%s" % self._uniqId
-#        self._iDb.exportDataToFile(outTableName, obsPathFile)
-#        
-#        self.assertTrue(FileUtils.are2FilesIdentical(expPathFile, obsPathFile))
-#        
-#        for f in [ expPathFile, obsPathFile, tmpPathFileName ]:
-#            os.remove( f )
-#        self._iDb.dropTable(outTableName)
-        
-    def test_mergeCoordsOnChunkOverlaps( self ):
-        dChunks2CoordMaps = { "chunk1": Map( "chunk1", "chromosome1", 1, 100 ),
-                             "chunk2": Map( "chunk2", "chromosome1", 91, 190 ),
-                             "chunk3": Map( "chunk3", "chromosome2", 1, 100 ) }
-        tmpPathTable = "dummyTmpPathTable"
-        linesToProcess = [
-                          "1" + "\t" + "chromosome1" + "\t" + "21" + "\t" + "37" + "\t" + "TE1" + "\t" + "1" + "\t" + "27" + "\t" + "8e-58" + "\t" + "30" + "\t" + "97.8" + "\n",  # hit within the 1st chunk
-                          "3" + "\t" + "chromosome1" + "\t" + "92" + "\t" + "99" + "\t" + "TE1" + "\t" + "1" + "\t" + "8" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.8" + "\n",       # hit included within the chunk overlap, on the 2nd chunk
-                          "2" + "\t" + "chromosome1" + "\t" + "92" + "\t" + "99" + "\t" + "TE1" + "\t" + "1" + "\t" + "8" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.8" + "\n",   # hit included within the chunk overlap, on the 1st chunk
-                          ]
-        FileUtils.writeLineListInFile( tmpPathTable, linesToProcess )
-        self._iDb.createTable( tmpPathTable, "path", tmpPathTable, True)
-        os.remove( tmpPathTable )
-        
-        expPathFile = "dummyExpPathFile"
-        linesToProcess = [ "1" + "\t" + "chromosome1" + "\t" + "21" + "\t" + "37" + "\t" + "TE1" + "\t" + "1" + "\t" + "27" + "\t" + "8e-58" + "\t" + "30" + "\t" + "97.8" + "\n",  # hit within the 1st chunk
-                           "2" + "\t" + "chromosome1" + "\t" + "92" + "\t" + "99" + "\t" + "TE1" + "\t" + "1" + "\t" + "8" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.8" + "\n",   # hit included within the chunk overlap, on the 1st chunk
-                           ]
-        FileUtils.writeLineListInFile( expPathFile, linesToProcess )
-        
-        self._i.mergeCoordsOnChunkOverlaps( dChunks2CoordMaps, tmpPathTable)
-        
-        obsPathFile = "dummyObsPathFile"
-        self._iDb.exportDataToFile( tmpPathTable, obsPathFile )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expPathFile, obsPathFile ) )
-        
-        for f in [ expPathFile, obsPathFile ]:
-            os.remove( f )
-        self._iDb.dropTable( tmpPathTable )
-        
-    def test_mergeCoordsOnChunkOverlaps_withConnectedMatches( self ):
-        dChunks2CoordMaps = { "chunk1": Map( "chunk1", "chromosome1", 1, 100 ),
-                             "chunk2": Map( "chunk2", "chromosome1", 91, 190 ),
-                             "chunk3": Map( "chunk3", "chromosome2", 1, 100 ) }
-        tmpPathTable = "dummyTmpPathTable"
-        linesToProcess = [
-                          "1" + "\t" + "chromosome1" + "\t" + "21" + "\t" + "37" + "\t" + "TE1" + "\t" + "1" + "\t" + "27" + "\t" + "8e-58" + "\t" + "30" + "\t" + "97.8" + "\n",  # hit on the 1st chunk
-                          "1" + "\t" + "chromosome1" + "\t" + "92" + "\t" + "99" + "\t" + "TE1" + "\t" + "28" + "\t" + "36" + "\t" + "8e-58" + "\t" + "10" + "\t" + "97.8" + "\n",  # hit included within the chunk overlap, on the 1st chunk, connected to the previous                          
-                          "2" + "\t" + "chromosome1" + "\t" + "92" + "\t" + "99" + "\t" + "TE1" + "\t" + "28" + "\t" + "36" + "\t" + "8e-58" + "\t" + "10" + "\t" + "97.8" + "\n",  # hit included within the chunk overlap, on the 2nd chunk
-                          "2" + "\t" + "chromosome1" + "\t" + "111" + "\t" + "120" + "\t" + "TE1" + "\t" + "37" + "\t" + "46" + "\t" + "8e-58" + "\t" + "15" + "\t" + "97.8" + "\n",  # hit on the 2nd chunk, connected to the previous
-                          ]
-        FileUtils.writeLineListInFile( tmpPathTable, linesToProcess )
-        self._iDb.createTable( tmpPathTable, "path", tmpPathTable, True)
-        os.remove( tmpPathTable )
-        
-        expPathFile = "dummyExpPathFile"
-        linesToProcess = [ "1" + "\t" + "chromosome1" + "\t" + "21" + "\t" + "37" + "\t" + "TE1" + "\t" + "1" + "\t" + "27" + "\t" + "8e-58" + "\t" + "30" + "\t" + "97.8" + "\n",  # hit within the 1st chunk
-                           "1" + "\t" + "chromosome1" + "\t" + "92" + "\t" + "99" + "\t" + "TE1" + "\t" + "28" + "\t" + "36" + "\t" + "8e-58" + "\t" + "10" + "\t" + "97.8" + "\n",   # hit included within the chunk overlap, on the 1st chunk
-                           "1" + "\t" + "chromosome1" + "\t" + "111" + "\t" + "120" + "\t" + "TE1" + "\t" + "37" + "\t" + "46" + "\t" + "8e-58" + "\t" + "15" + "\t" + "97.8" + "\n",  # hit on the 2nd chunk, connected to the previous
-                           ]
-        FileUtils.writeLineListInFile( expPathFile, linesToProcess )
-        
-        self._i.mergeCoordsOnChunkOverlaps( dChunks2CoordMaps, tmpPathTable )
-        
-        obsPathFile = "dummyObsPathFile"
-        self._iDb.exportDataToFile( tmpPathTable, obsPathFile )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expPathFile, obsPathFile ) )
-        
-        for f in [ expPathFile, obsPathFile ]:
-            os.remove( f )
-        self._iDb.dropTable( tmpPathTable )
-        
-    def _writePathFileCoordOnChrWithOutDoublons(self, pathFileName):
-        file = open( pathFileName, "w" )
-        file.write("123\tdmel_chr4\t868397\t868531\tMariner2_AG_1p:classII:TIR\t53\t97\t8e-19\t28\t35.56\n")
-        file.write("123\tdmel_chr4\t868545\t869120\tMariner2_AG_1p:classII:TIR\t102\t333\t8e-19\t87\t27.97\n")
-        file.write("124\tdmel_chr4\t819607\t819714\tLINER1-2_NVi_2p:classI:?\t502\t537\t3e-20\t30\t36.11\n")
-        file.write("124\tdmel_chr4\t819695\t820156\tLINER1-2_NVi_2p:classI:?\t533\t725\t3e-20\t90\t36.79\n")
-        file.write("125\tdmel_chr4\t953027\t953101\tCR1-8_AG_1p:classI:LINE\t470\t448\t1e-27\t11\t28.57\n")
-        file.write("126\tdmel_chr4\t862131\t862178\tTc1-1_TCa_1p:classII:TIR\t288\t274\t5e-29\t18\t52.5\n")
-        file.write("127\tdmel_chr4\t819520\t819606\tNotoAg1_2p:classI:?\t482\t508\t1e-13\t14\t30.61\n")
-#        file.write("128\tdmel_chr4\t953866\t953889\tCR1-19_HM_1p:classI:LINE\t898\t891\t5e-21\t4\t34.98\n")
-#        file.write("129\tdmel_chr4\t953866\t953889\tCR1-83_HM_1p:classI:LINE\t912\t905\t3e-21\t4\t34.62\n")
-        file.write("150\tdmel_chr4\t971176\t971250\tTc1-1_TCa_1p:classII:TIR\t135\t109\t8e-32\t21\t41.57\n")
-        file.write("151\tdmel_chr4\t1066603\t1066698\tMARWOLEN1_1p:classII:TIR\t285\t320\t7e-25\t28\t41.67\n")
-        file.write("152\tdmel_chr4\t953866\t953889\tCR1-19_HM_1p:classI:LINE\t898\t891\t5e-21\t4\t34.98\n")
-        file.write("153\tdmel_chr4\t953951\t954343\tCR1-1_DWil_1p:classI:LINE\t127\t2\t4e-18\t92\t37.59\n")
-        file.write("154\tdmel_chr4\t953866\t953889\tCR1-83_HM_1p:classI:LINE\t912\t905\t3e-21\t4\t34.62\n")
-        file.write("155\tdmel_chr4\t953102\t953199\tCR1-1_DWil_2p:classI:LINE\t869\t837\t2e-26\t38\t57.89\n")
-        file.close()
-        
-    def _writePathFileCoordOnChunk(self, pathFileName):
-        pathFile = open( pathFileName, "w" )
-        pathFile.write("123\tchunk1\t108397\t108531\tMariner2_AG_1p:classII:TIR\t53\t97\t8e-19\t28\t35.56\n")
-        pathFile.write("123\tchunk1\t108545\t109120\tMariner2_AG_1p:classII:TIR\t102\t333\t8e-19\t87\t27.97\n")
-        pathFile.write("124\tchunk1\t59607\t59714\tLINER1-2_NVi_2p:classI:?\t502\t537\t3e-20\t30\t36.11\n")
-        pathFile.write("124\tchunk1\t59695\t60156\tLINER1-2_NVi_2p:classI:?\t533\t725\t3e-20\t90\t36.79\n")
-        pathFile.write("125\tchunk1\t193027\t193101\tCR1-8_AG_1p:classI:LINE\t470\t448\t1e-27\t11\t28.57\n")
-        pathFile.write("126\tchunk1\t102131\t102178\tTc1-1_TCa_1p:classII:TIR\t288\t274\t5e-29\t18\t52.5\n")
-        pathFile.write("127\tchunk1\t59520\t59606\tNotoAg1_2p:classI:?\t482\t508\t1e-13\t14\t30.61\n")
-        pathFile.write("128\tchunk1\t193866\t193889\tCR1-19_HM_1p:classI:LINE\t898\t891\t5e-21\t4\t34.98\n")
-        pathFile.write("129\tchunk1\t193866\t193889\tCR1-83_HM_1p:classI:LINE\t912\t905\t3e-21\t4\t34.62\n")
-        pathFile.write("150\tchunk2\t21176\t21250\tTc1-1_TCa_1p:classII:TIR\t135\t109\t8e-32\t21\t41.57\n")
-        pathFile.write("151\tchunk2\t116603\t116698\tMARWOLEN1_1p:classII:TIR\t285\t320\t7e-25\t28\t41.67\n")
-        pathFile.write("152\tchunk2\t3866\t3889\tCR1-19_HM_1p:classI:LINE\t898\t891\t5e-21\t4\t34.98\n")
-        pathFile.write("153\tchunk2\t3951\t4343\tCR1-1_DWil_1p:classI:LINE\t127\t2\t4e-18\t92\t37.59\n")
-        pathFile.write("154\tchunk2\t3866\t3889\tCR1-83_HM_1p:classI:LINE\t912\t905\t3e-21\t4\t34.62\n")
-        pathFile.write("155\tchunk2\t3102\t3199\tCR1-1_DWil_2p:classI:LINE\t869\t837\t2e-26\t38\t57.89\n")
-        pathFile.close()
-        
-#    def _writePathFileCoordOnChunk_outOfOverlap(self, pathFileName):
-#        pathFile = open( pathFileName, "w" )
-#        pathFile.write("123\tchunk1\t108397\t108531\tMariner2_AG_1p:classII:TIR\t53\t97\t8e-19\t28\t35.56\n")
-#        pathFile.write("123\tchunk1\t108545\t109120\tMariner2_AG_1p:classII:TIR\t102\t333\t8e-19\t87\t27.97\n")
-#        pathFile.write("124\tchunk1\t59607\t59714\tLINER1-2_NVi_2p:classI:?\t502\t537\t3e-20\t30\t36.11\n")
-#        pathFile.write("124\tchunk1\t59695\t60156\tLINER1-2_NVi_2p:classI:?\t533\t725\t3e-20\t90\t36.79\n")
-#        pathFile.write("125\tchunk1\t193027\t193101\tCR1-8_AG_1p:classI:LINE\t470\t448\t1e-27\t11\t28.57\n")
-#        pathFile.write("126\tchunk1\t102131\t102178\tTc1-1_TCa_1p:classII:TIR\t288\t274\t5e-29\t18\t52.5\n")
-#        pathFile.write("127\tchunk1\t59520\t59606\tNotoAg1_2p:classI:?\t482\t508\t1e-13\t14\t30.61\n")
-#        pathFile.write("128\tchunk1\t183866\t193889\tCR1-19_HM_1p:classI:LINE\t898\t1891\t5e-21\t4\t34.98\n")
-#        pathFile.write("129\tchunk1\t183866\t200000\tCR1-83_HM_1p:classI:LINE\t912\t905\t3e-21\t4\t34.62\n")
-#        pathFile.write("150\tchunk2\t21176\t21250\tTc1-1_TCa_1p:classII:TIR\t135\t109\t8e-32\t21\t41.57\n")
-#        pathFile.write("151\tchunk2\t116603\t116698\tMARWOLEN1_1p:classII:TIR\t285\t320\t7e-25\t28\t41.67\n")
-#        pathFile.write("152\tchunk2\t1\t3889\tCR1-19_HM_1p:classI:LINE\t898\t1891\t5e-21\t4\t34.98\n")
-#        pathFile.write("153\tchunk2\t3951\t4343\tCR1-1_DWil_1p:classI:LINE\t127\t2\t4e-18\t92\t37.59\n")
-#        pathFile.write("154\tchunk2\t1\t13889\tCR1-83_HM_1p:classI:LINE\t912\t905\t3e-21\t4\t34.62\n")
-#        pathFile.write("155\tchunk2\t3102\t3199\tCR1-1_DWil_2p:classI:LINE\t869\t837\t2e-26\t38\t57.89\n")
-#        pathFile.close()
-#        
-#    def _writePathFileCoordOnChrWithOutDoublons_outOfOverlap(self, pathFileName):
-#        file = open( pathFileName, "w" )
-#        file.write("123\tdmel_chr4\t868397\t868531\tMariner2_AG_1p:classII:TIR\t53\t97\t8e-19\t28\t35.56\n")
-#        file.write("123\tdmel_chr4\t868545\t869120\tMariner2_AG_1p:classII:TIR\t102\t333\t8e-19\t87\t27.97\n")
-#        file.write("124\tdmel_chr4\t819607\t819714\tLINER1-2_NVi_2p:classI:?\t502\t537\t3e-20\t30\t36.11\n")
-#        file.write("124\tdmel_chr4\t819695\t820156\tLINER1-2_NVi_2p:classI:?\t533\t725\t3e-20\t90\t36.79\n")
-#        file.write("125\tdmel_chr4\t953027\t953101\tCR1-8_AG_1p:classI:LINE\t470\t448\t1e-27\t11\t28.57\n")
-#        file.write("126\tdmel_chr4\t862131\t862178\tTc1-1_TCa_1p:classII:TIR\t288\t274\t5e-29\t18\t52.5\n")
-#        file.write("127\tdmel_chr4\t819520\t819606\tNotoAg1_2p:classI:?\t482\t508\t1e-13\t14\t30.61\n")
-#        file.write("128\tdmel_chr4\t943866\t953889\tCR1-19_HM_1p:classI:LINE\t898\t1891\t5e-21\t4\t34.98\n")
-#        file.write("129\tdmel_chr4\t943866\t963889\tCR1-83_HM_1p:classI:LINE\t912\t905\t3e-21\t4\t34.62\n")
-#        file.write("150\tdmel_chr4\t971176\t971250\tTc1-1_TCa_1p:classII:TIR\t135\t109\t8e-32\t21\t41.57\n")
-#        file.write("151\tdmel_chr4\t1066603\t1066698\tMARWOLEN1_1p:classII:TIR\t285\t320\t7e-25\t28\t41.67\n")
-#        file.write("153\tdmel_chr4\t953951\t954343\tCR1-1_DWil_1p:classI:LINE\t127\t2\t4e-18\t92\t37.59\n")
-#        file.write("155\tdmel_chr4\t953102\t953199\tCR1-1_DWil_2p:classI:LINE\t869\t837\t2e-26\t38\t57.89\n")
-#        file.close()
-       
-if __name__ == "__main__":
-        unittest.main()
\ No newline at end of file
--- a/commons/core/coord/test/Test_F_ConvCoord.py	Mon Apr 29 03:26:07 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,213 +0,0 @@
-from commons.core.utils.FileUtils import FileUtils
-from commons.core.sql.DbFactory import DbFactory
-from commons.core.coord.ConvCoord import ConvCoord
-import time
-import subprocess
-import os
-import unittest
-
-class Test_F_ConvCoord(unittest.TestCase):
-    
-    def setUp( self ):
-        self._i = ConvCoord()
-        self._uniqId = "%s_%s" % ( time.strftime("%Y%m%d%H%M%S") , os.getpid() )
-        self._inData = "dummyInData_%s" % ( self._uniqId )
-        self._mapData = "dummyMapData_%s" % ( self._uniqId )
-        self._expData = "dummyExpData_%s" % ( self._uniqId )
-        self._obsData = "dummyObsData_%s" % ( self._uniqId )
-        self._iDb = DbFactory.createInstance()
-        self._i._iDb = self._iDb
-        
-    def tearDown( self ):
-        self._iDb.close()
-        
-    def test_run_as_script_alignFile_query( self ):
-        configFile = "%s/dummyConfigFile_%s" % ( os.getcwd(), self._uniqId )
-        configF = open( configFile, "w" )
-        configF.write( "[repet_env]\n" )
-        configF.write( "repet_host: %s\n" % ( os.environ["REPET_HOST"] ) )
-        configF.write( "repet_user: %s\n" % ( os.environ["REPET_USER"] ) )
-        configF.write( "repet_pw: %s\n" % ( os.environ["REPET_PW"] ) )
-        configF.write( "repet_db: %s\n" % ( os.environ["REPET_DB"] ) )
-        configF.write( "repet_port: %s\n" % ( os.environ["REPET_PORT"] ) )
-        configF.close()
-        self._writeMapFile( self._mapData )
-        
-        linesToProcess = [ "chunk1" + "\t" + "21" + "\t" + "37" + "\t" + "TE1" + "\t" + "1" + "\t" + "27" + "\t" + "8e-58" + "\t" + "30" + "\t" + "97.800000" + "\n",  # hit within the 1st chunk
-                           "chunk1" + "\t" + "92" + "\t" + "99" + "\t" + "TE1" + "\t" + "1" + "\t" + "8" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.800000" + "\n",   # hit included within the chunk overlap, on the 1st chunk
-                           "chunk2" + "\t" + "2" + "\t" + "9" + "\t" + "TE1" + "\t" + "1" + "\t" + "8" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.800000" + "\n",       # hit included within the chunk overlap, on the 2nd chunk
-                           "chunk2" + "\t" + "51" + "\t" + "58" + "\t" + "TE1" + "\t" + "1" + "\t" + "8" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.800000" + "\n",     # hit inside the 2nd chunk
-                           "chunk2" + "\t" + "51" + "\t" + "70" + "\t" + "TE1" + "\t" + "8" + "\t" + "1" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.800000" + "\n"     # subject on reverse strand
-                           ]
-        FileUtils.writeLineListInFile( self._inData, linesToProcess )
-        
-        refLines = [ "chromosome1" + "\t" + "21" + "\t" + "37" + "\t" + "TE1" + "\t" + "1" + "\t" + "27" + "\t" + "8e-58" + "\t" + "30" + "\t" + "97.800000" + "\n",
-                     "chromosome1" + "\t" + "92" + "\t" + "99" + "\t" + "TE1" + "\t" + "1" + "\t" + "8" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.800000" + "\n",
-                     "chromosome1" + "\t" + "141" + "\t" + "148" + "\t" + "TE1" + "\t" + "1" + "\t" + "8" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.800000" + "\n",
-                     "chromosome1" + "\t" + "141" + "\t" + "160" + "\t" + "TE1" + "\t" + "8" + "\t" + "1" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.800000" + "\n"
-                     ]
-        FileUtils.writeLineListInFile( self._expData, refLines )
-        
-        cmd = "ConvCoord.py"
-        cmd += " -i %s" % ( self._inData )
-        cmd += " -f %s" % ( "align" )
-        cmd += " -c %s" % ( "q" )
-        cmd += " -m %s" % ( self._mapData )
-        cmd += " -o %s" % ( self._obsData )
-        cmd += " -C %s" % ( configFile )
-        process = subprocess.Popen(cmd, shell = True)
-        process.communicate()
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( self._expData, self._obsData ) )
-        
-        os.remove( self._inData )
-        os.remove(configFile)
-        os.remove( self._mapData )
-        os.remove( self._expData )
-        os.remove( self._obsData )
-        
-    def test_run_as_script_alignFile_queryAndSubject( self ):
-        self._writeMapFile( self._mapData )
-        linesToProcess = [ "chunk1" + "\t" + "21" + "\t" + "37" + "\t" + "chunk3" + "\t" + "1" + "\t" + "27" + "\t" + "8e-58" + "\t" + "30" + "\t" + "97.800000" + "\n",  # hit within the 1st chunk
-                           "chunk1" + "\t" + "92" + "\t" + "99" + "\t" + "chunk2" + "\t" + "2" + "\t" + "9" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.800000" + "\n",   # hit included within the chunk overlap, on the 1st chunk
-                           "chunk2" + "\t" + "51" + "\t" + "58" + "\t" + "chunk1" + "\t" + "1" + "\t" + "8" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.800000" + "\n",     # hit inside the 2nd chunk
-                           "chunk2" + "\t" + "51" + "\t" + "70" + "\t" + "chunk1" + "\t" + "8" + "\t" + "1" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.800000" + "\n"     # subject on reverse strand
-                           "chunk2" + "\t" + "51" + "\t" + "70" + "\t" + "chunk1" + "\t" + "8" + "\t" + "1" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.800000" + "\n"     # doublon of previous line
-                           ]
-        FileUtils.writeLineListInFile( self._inData, linesToProcess )
-        
-        refLines = [ "chromosome1" + "\t" + "21" + "\t" + "37" + "\t" + "chromosome2" + "\t" + "1" + "\t" + "27" + "\t" + "8e-58" + "\t" + "30" + "\t" + "97.800000" + "\n",
-                     "chromosome1" + "\t" + "92" + "\t" + "99" + "\t" + "chromosome1" + "\t" + "92" + "\t" + "99" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.800000" + "\n",
-                     "chromosome1" + "\t" + "141" + "\t" + "148" + "\t" + "chromosome1" + "\t" + "1" + "\t" + "8" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.800000" + "\n",
-                     "chromosome1" + "\t" + "141" + "\t" + "160" + "\t" + "chromosome1" + "\t" + "8" + "\t" + "1" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.800000" + "\n"
-                     ]
-        FileUtils.writeLineListInFile( self._expData, refLines )
-        
-        cmd = "ConvCoord.py"
-        cmd += " -i %s" % ( self._inData )
-        cmd += " -f %s" % ( "align" )
-        cmd += " -c %s" % ( "qs" )
-        cmd += " -m %s" % ( self._mapData )
-        cmd += " -o %s" % ( self._obsData )
-        process = subprocess.Popen(cmd, shell = True)
-        process.communicate()
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( self._expData, self._obsData ) )
-        
-        os.remove( self._inData )
-        self._iDb.dropTable( self._mapData )
-        os.remove( self._expData )
-        os.remove( self._obsData )
-        os.remove( self._mapData )
-        
-    def test_run_as_script_pathTable_query( self ):
-        self._writeMapFile( self._mapData )
-        self._iDb.createTable( self._mapData, "map", self._mapData, True )
-        os.remove( self._mapData )
-        
-        linesToProcess = [ "1" + "\t" + "chunk1" + "\t" + "21" + "\t" + "37" + "\t" + "TE1" + "\t" + "1" + "\t" + "27" + "\t" + "8e-58" + "\t" + "30" + "\t" + "97.800000" + "\n",  # hit within the 1st chunk
-                           "2" + "\t" + "chunk1" + "\t" + "92" + "\t" + "99" + "\t" + "TE1" + "\t" + "1" + "\t" + "8" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.800000" + "\n",   # hit included within the chunk overlap, on the 1st chunk
-                           "3" + "\t" + "chunk2" + "\t" + "2" + "\t" + "9" + "\t" + "TE1" + "\t" + "1" + "\t" + "8" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.800000" + "\n",       # hit included within the chunk overlap, on the 2nd chunk
-                           "4" + "\t" + "chunk2" + "\t" + "51" + "\t" + "58" + "\t" + "TE1" + "\t" + "1" + "\t" + "8" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.800000" + "\n",     # hit inside the 2nd chunk
-                           "5" + "\t" + "chunk2" + "\t" + "51" + "\t" + "70" + "\t" + "TE1" + "\t" + "8" + "\t" + "1" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.800000" + "\n"     # subject on reverse strand
-                           ]
-        FileUtils.writeLineListInFile( self._inData, linesToProcess )
-        self._iDb.createTable( self._inData, "path", self._inData, True )
-        os.remove( self._inData )
-        
-        refLines = [ "1" + "\t" + "chromosome1" + "\t" + "21" + "\t" + "37" + "\t" + "TE1" + "\t" + "1" + "\t" + "27" + "\t" + "8e-58" + "\t" + "30" + "\t" + "97.8" + "\n",
-                     "2" + "\t" + "chromosome1" + "\t" + "92" + "\t" + "99" + "\t" + "TE1" + "\t" + "1" + "\t" + "8" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.8" + "\n",
-                     "4" + "\t" + "chromosome1" + "\t" + "141" + "\t" + "148" + "\t" + "TE1" + "\t" + "1" + "\t" + "8" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.8" + "\n",
-                     "5" + "\t" + "chromosome1" + "\t" + "141" + "\t" + "160" + "\t" + "TE1" + "\t" + "8" + "\t" + "1" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.8" + "\n"
-                     ]
-        FileUtils.writeLineListInFile( self._expData, refLines )
-        
-        cmd = "ConvCoord.py"
-        cmd += " -i %s" % ( self._inData )
-        cmd += " -f %s" % ( "path" )
-        cmd += " -c %s" % ( "q" )
-        cmd += " -m %s" % ( self._mapData )
-        cmd += " -o %s" % ( self._obsData )
-        process = subprocess.Popen(cmd, shell = True)
-        process.communicate()
-        
-        self._iDb.exportDataToFile( self._obsData, self._obsData )
-        self.assertTrue( FileUtils.are2FilesIdentical( self._expData, self._obsData ) )
-        
-        os.remove( self._obsData )
-        os.remove( self._expData )
-        self._iDb.dropTable( self._mapData )
-        self._iDb.dropTable( self._inData )
-        self._iDb.dropTable( self._expData )
-        self._iDb.dropTable( self._obsData )
-        
-    def test_run_as_script_pathTable_query_noMergeChunkOverlaps( self ):
-        self._writeMapFile( self._mapData )
-        self._iDb.createTable( self._mapData, "map", self._mapData, True )
-        os.remove( self._mapData )
-        
-        linesToProcess = [ "1" + "\t" + "chunk1" + "\t" + "21" + "\t" + "37" + "\t" + "TE1" + "\t" + "1" + "\t" + "27" + "\t" + "8e-58" + "\t" + "30" + "\t" + "97.800000" + "\n",  # hit within the 1st chunk
-                           "2" + "\t" + "chunk1" + "\t" + "92" + "\t" + "99" + "\t" + "TE1" + "\t" + "1" + "\t" + "8" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.800000" + "\n",   # hit included within the chunk overlap, on the 1st chunk
-                           "3" + "\t" + "chunk2" + "\t" + "2" + "\t" + "9" + "\t" + "TE1" + "\t" + "1" + "\t" + "8" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.800000" + "\n",       # hit included within the chunk overlap, on the 2nd chunk
-                           "4" + "\t" + "chunk2" + "\t" + "51" + "\t" + "58" + "\t" + "TE1" + "\t" + "1" + "\t" + "8" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.800000" + "\n",     # hit inside the 2nd chunk
-                           "5" + "\t" + "chunk2" + "\t" + "51" + "\t" + "70" + "\t" + "TE1" + "\t" + "8" + "\t" + "1" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.800000" + "\n"     # subject on reverse strand
-                           ]
-        FileUtils.writeLineListInFile( self._inData, linesToProcess )
-        self._iDb.createTable( self._inData, "path", self._inData, True )
-        os.remove( self._inData )
-        
-        refLines = [ "1" + "\t" + "chromosome1" + "\t" + "21" + "\t" + "37" + "\t" + "TE1" + "\t" + "1" + "\t" + "27" + "\t" + "8e-58" + "\t" + "30" + "\t" + "97.8" + "\n",
-                     "2" + "\t" + "chromosome1" + "\t" + "92" + "\t" + "99" + "\t" + "TE1" + "\t" + "1" + "\t" + "8" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.8" + "\n",
-                     "3" + "\t" + "chromosome1" + "\t" + "92" + "\t" + "99" + "\t" + "TE1" + "\t" + "1" + "\t" + "8" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.8" + "\n",       # hit included within the chunk overlap, on the 2nd chunk
-                     "4" + "\t" + "chromosome1" + "\t" + "141" + "\t" + "148" + "\t" + "TE1" + "\t" + "1" + "\t" + "8" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.8" + "\n",
-                     "5" + "\t" + "chromosome1" + "\t" + "141" + "\t" + "160" + "\t" + "TE1" + "\t" + "8" + "\t" + "1" + "\t" + "8e-58" + "\t" + "11" + "\t" + "97.8" + "\n"
-                     ]
-        FileUtils.writeLineListInFile( self._expData, refLines )
-        
-        cmd = "ConvCoord.py"
-        cmd += " -i %s" % ( self._inData )
-        cmd += " -f %s" % ( "path" )
-        cmd += " -c %s" % ( "q" )
-        cmd += " -m %s" % ( self._mapData )
-        cmd += " -M %s" % ( "no" )
-        cmd += " -o %s" % ( self._obsData )
-        process = subprocess.Popen(cmd, shell = True)
-        process.communicate()
-        
-        self._iDb.exportDataToFile( self._obsData, self._obsData )
-        self.assertTrue( FileUtils.are2FilesIdentical( self._expData, self._obsData ) )
-        
-        os.remove( self._obsData )
-        os.remove( self._expData )
-        self._iDb.dropTable( self._mapData )
-        self._iDb.dropTable( self._inData )
-        self._iDb.dropTable( self._expData )
-        self._iDb.dropTable( self._obsData )
-
-    def test_run(self):
-        inFileName = "DmelChr4_chk.align.not_over.filtered"
-        expFileName = "%s/Tools/DmelChr4_chr.align.not_over.filtered" % os.environ["REPET_DATA"]
-        obsFileName = "obs.align"
-        os.symlink("%s/Tools/%s" % (os.environ["REPET_DATA"], inFileName), inFileName)
-        iConvCoord = ConvCoord()
-        iConvCoord.setInputData(inFileName)
-        iConvCoord.setMapData("%s/Tools/DmelChr4_chunks.map" % os.environ["REPET_DATA"])
-        iConvCoord.setCoordinatesToConvert("qs")
-        iConvCoord.setMergeChunkOverlaps(False)
-        iConvCoord.setOutputData(obsFileName)
-        iConvCoord.run()
-        
-        self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName))
-        
-        os.remove(inFileName)
-        os.remove(obsFileName)
-        
-    def _writeMapFile( self, mapFile ):
-        mapF = open( mapFile, "w" )
-        mapF.write( "chunk1\tchromosome1\t1\t100\n" )
-        mapF.write( "chunk2\tchromosome1\t91\t190\n" )
-        mapF.write( "chunk3\tchromosome2\t1\t100\n" )
-        mapF.close()
-
-if __name__ == "__main__":
-    unittest.main()
\ No newline at end of file
--- a/commons/core/coord/test/Test_Map.py	Mon Apr 29 03:26:07 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,183 +0,0 @@
-# Copyright INRA (Institut National de la Recherche Agronomique)
-# http://www.inra.fr
-# http://urgi.versailles.inra.fr
-#
-# This software is governed by the CeCILL license under French law and
-# abiding by the rules of distribution of free software.  You can  use, 
-# modify and/ or redistribute the software under the terms of the CeCILL
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# "http://www.cecill.info". 
-#
-# As a counterpart to the access to the source code and  rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty  and the software's author,  the holder of the
-# economic rights,  and the successive licensors  have only  limited
-# liability. 
-#
-# In this respect, the user's attention is drawn to the risks associated
-# with loading,  using,  modifying and/or developing or reproducing the
-# software by the user in light of its specific status of free software,
-# that may mean  that it is complicated to manipulate,  and  that  also
-# therefore means  that it is reserved for developers  and  experienced
-# professionals having in-depth computer knowledge. Users are therefore
-# encouraged to load and test the software's suitability as regards their
-# requirements in conditions enabling the security of their systems and/or 
-# data to be ensured and,  more generally, to use and operate it in the 
-# same conditions as regards security. 
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL license and that you accept its terms.
-
-
-import unittest
-import os
-from commons.core.coord.Map import Map
-from commons.core.utils.FileUtils import FileUtils
-
-
-class Test_Map( unittest.TestCase ):
-    
-    def setUp(self):
-        self._map = Map()
-        
-    def test_setFromString(self):
-        line = "MbQ12Gr2Cl2\tconsensus1\t51\t1230\n"   # test with '\t' separator
-        self._map.setFromString(line)
-        self.assertEqual( self._map.name, "MbQ12Gr2Cl2" )
-        self.assertEqual( self._map.seqname, "consensus1" )
-        self.assertEqual( self._map.start, 51 )
-        self.assertEqual( self._map.end, 1230 )
-        line = "MbQ12Gr2Cl2;consensus1;51;1230"   # test with ';' separator
-        self._map.setFromString(line,";")
-        self.assertEqual( self._map.name, "MbQ12Gr2Cl2" )
-        self.assertEqual( self._map.seqname, "consensus1" )
-        self.assertEqual( self._map.start, 51 )
-        self.assertEqual( self._map.end, 1230 )
-    
-    def test___eq__(self):
-        self._map.setFromString( "MbQ12Gr2Cl2\tconsensus1\t51\t1230\n" )
-        o = Map()
-        o.setFromString( "MbQ12Gr2Cl2\tconsensus1\t51\t1230\n" )
-        self.assertEqual( self._map, o )   # same data
-        o.setFromString( "MbQ12Gr2Cl1\tconsensus1\t51\t1230\n" )
-        self.assertNotEqual( self._map, o )   # different name
-        o.setFromString( "MbQ12Gr2Cl2\tconsensus2\t51\t1230\n" )
-        self.assertNotEqual( self._map, o )   # different seqname
-        o.setFromString( "MbQ12Gr2Cl2\tconsensus1\t15\t1230\n" )
-        self.assertNotEqual( self._map, o )   # different start
-        o.setFromString( "MbQ12Gr2Cl2\tconsensus1\t51\t123000\n" )
-        self.assertNotEqual( self._map, o )   # different end
-        o.setFromString( "MbQ12Gr2Cl2\tconsensus1\t1230\t51\n" )
-        self.assertNotEqual( self._map, o )   # same start/end but in different order
-        
-    def test_setFromTuple(self):
-        tuple = ("MbQ12Gr2Cl2", "consensus1","51","1230")
-        self._map.setFromTuple(tuple)
-
-        expMap = Map("MbQ12Gr2Cl2", "consensus1",51,1230)
-        obsMap = self._map
-        
-        self.assertEquals(expMap, obsMap)
-    
-    def test_read_empty_file(self):
-        
-        fileName = "dummyFile"
-        os.system("touch " + fileName) 
-        fileHandle = open(fileName, "r")
-        
-        obsResult = self._map.read(fileHandle)
-        expResult = 0
-         
-        fileHandle.close()
-        os.remove(fileName) 
-        
-        self.assertEquals(expResult, obsResult)
-    
-    def test_read_uncompleted_line( self):
-        uncompletedLine = "MbQ12Gr2Cl2\tconsensus1\t51"
-        fileName = "dummyFile"
-
-        fileHandle = open(fileName, "w")
-        fileHandle.write(uncompletedLine)
-        fileHandle.close()
-
-        fileHandle = open(fileName, "r")
-       
-        obsResult = self._map.read(fileHandle)
-        expResult = 0
-
-        fileHandle.close()
-        os.remove(fileName)
-
-        self.assertEquals(obsResult, expResult)
-
-    def test_read(self):
-        line =  "MbQ12Gr2Cl2\tconsensus1\t51\t1230\n"
-        fileName = "dummyFile"
-
-        fileHandle = open(fileName, "w")
-        fileHandle.write(line)
-        fileHandle.close()
-
-        fileHandle = open(fileName, "r")
-        self._map.read(fileHandle)
-        obsResult = self._map
-        
-        expResult = Map()
-        expResult.setFromString(line) 
-
-        fileHandle.close()
-        os.remove(fileName)
-
-        self.assertEquals(obsResult, expResult) 
-     
-    def test_write(self):
-        line =  "MbQ12Gr2Cl2\tconsensus1\t51\t1230\n"
-        expFileName = "expFileName"
-
-        fileHandle = open(expFileName, "w")
-        fileHandle.write(line)
-        fileHandle.close()
-        
-        obsFileName = "obsFileName"
-        fileHandle = open(obsFileName, "w")
-        self._map.setFromString(line)
-        self._map.write(fileHandle)
-        fileHandle.close()
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFileName, obsFileName ) )
-        
-        os.remove(obsFileName)
-        os.remove(expFileName)
-        
-    def test_diff1(self):
-        map1 = Map("seq1","DmelChr4", 190000, 390000)
-        map2 = Map("seq2","DmelChr4", 290000, 590000)
-        
-        expMap1 = Map("seq1", "DmelChr4", 190000, 289999)
-        expReturnedMap = Map()
-        
-        obsReturnedMap = map1.diff(map2)
-        obsMap1 = map1
-        
-        self.assertEquals(expMap1, obsMap1)
-        self.assertEquals(expReturnedMap, obsReturnedMap)
-        
-    def test_diff2(self):
-        map1 = Map("seq1","DmelChr4", 190000, 590000)
-        map2 = Map("seq2","DmelChr4", 290000, 390000)
-
-        expMap1 = Map("seq1", "DmelChr4", 190000, 289999)
-        expReturnedMap = Map("seq1", "DmelChr4", 390001, 590000)
-        
-        obsReturnedMap = map1.diff(map2)
-        obsMap1 = map1
-        
-        self.assertEquals(expMap1, obsMap1)
-        self.assertEquals(expReturnedMap, obsReturnedMap)
-        
-        
-test_suite = unittest.TestSuite()
-test_suite.addTest( unittest.makeSuite( Test_Map ) )
-if __name__ == "__main__":
-    unittest.TextTestRunner(verbosity=2).run( test_suite )
--- a/commons/core/coord/test/Test_MapUtils.py	Mon Apr 29 03:26:07 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,384 +0,0 @@
-# Copyright INRA (Institut National de la Recherche Agronomique)
-# http://www.inra.fr
-# http://urgi.versailles.inra.fr
-#
-# This software is governed by the CeCILL license under French law and
-# abiding by the rules of distribution of free software.  You can  use, 
-# modify and/ or redistribute the software under the terms of the CeCILL
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# "http://www.cecill.info". 
-#
-# As a counterpart to the access to the source code and  rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty  and the software's author,  the holder of the
-# economic rights,  and the successive licensors  have only  limited
-# liability. 
-#
-# In this respect, the user's attention is drawn to the risks associated
-# with loading,  using,  modifying and/or developing or reproducing the
-# software by the user in light of its specific status of free software,
-# that may mean  that it is complicated to manipulate,  and  that  also
-# therefore means  that it is reserved for developers  and  experienced
-# professionals having in-depth computer knowledge. Users are therefore
-# encouraged to load and test the software's suitability as regards their
-# requirements in conditions enabling the security of their systems and/or 
-# data to be ensured and,  more generally, to use and operate it in the 
-# same conditions as regards security. 
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL license and that you accept its terms.
-
-
-import unittest
-import os
-import sys
-from commons.core.coord.MapUtils import MapUtils
-from commons.core.coord.Map import Map
-from commons.core.coord.Set import Set
-from commons.core.utils.FileUtils import FileUtils
-
-
-class Test_MapUtils( unittest.TestCase ):
-    
-    def test_getMapListSortedByIncreasingMinThenMax( self ):
-        iMap1 = Map("name1", "chr1", 1, 350)
-        iMap2 = Map("name2", "chr1", 1, 100)
-        iMap3 = Map("name3", "chr1", 50, 350)
-        iMap4 = Map("name4", "chr1", 5, 450)
-        lMaps = [ iMap1, iMap2, iMap3, iMap4 ]
-        
-        expLMaps = [ iMap2, iMap1, iMap4, iMap3 ]
-        
-        obsLMaps = MapUtils.getMapListSortedByIncreasingMinThenMax( lMaps )
-        
-        self.assertEquals( expLMaps, obsLMaps )
-        
-        
-    def test_getMapListSortedByIncreasingMinThenMax_ordered( self ):
-        iMap1 = Map("name1", "chr1", 1, 100)
-        iMap2 = Map("name2", "chr1", 1, 350)
-        
-        lMaps = [ iMap1, iMap2 ]
-        expLMaps = [ iMap1, iMap2 ]
-        
-        obsLMaps = MapUtils.getMapListSortedByIncreasingMinThenMax( lMaps )
-        
-        self.assertEquals( expLMaps, obsLMaps )
-        
-        
-    def test_getMapListSortedByIncreasingMinThenMax_unordered( self ):
-        iMap1 = Map("name1", "chr1", 1, 350)
-        iMap2 = Map("name2", "chr1", 1, 100)
-        
-        lMaps = [ iMap1, iMap2 ]
-        expLMaps = [ iMap2, iMap1 ]
-        
-        obsLMaps = MapUtils.getMapListSortedByIncreasingMinThenMax( lMaps )
-        
-        self.assertEquals( expLMaps, obsLMaps )
-        
-        
-    def test_getMapListSortedByIncreasingMinThenMax_nonOverlapping( self ):
-        iMap1 = Map("name1", "chr1", 1, 350)
-        iMap2 = Map("name2", "chr1", 400, 600)
-        
-        lMaps = [ iMap2, iMap1 ]
-        expLMaps = [ iMap1, iMap2 ]
-        
-        obsLMaps = MapUtils.getMapListSortedByIncreasingMinThenMax( lMaps )
-        
-        self.assertEquals( expLMaps, obsLMaps )
-        
-        
-    def test_getMapListSortedByIncreasingMinThenMax_sameMinThreeMaps( self ):
-        iMap1 = Map("name1", "chr1", 350, 1)
-        iMap2 = Map("name2", "chr1", 400, 1)
-        iMap3 = Map("name3", "chr1", 500, 1)
-        
-        lMaps = [ iMap2, iMap1, iMap3 ]
-        expLMaps = [ iMap1, iMap2, iMap3 ]
-        
-        obsLMaps = MapUtils.getMapListSortedByIncreasingMinThenMax( lMaps )
-        
-        self.assertEquals( expLMaps, obsLMaps )
-        
-        
-    def test_getMapListSortedByIncreasingMinThenMax_included( self ):
-        iMap1 = Map("name1", "chr1", 350, 1)
-        iMap2 = Map("name2", "chr1", 300, 10)
-        
-        lMaps = [ iMap2, iMap1 ]
-        expLMaps = [ iMap1, iMap2]
-        
-        obsLMaps = MapUtils.getMapListSortedByIncreasingMinThenMax( lMaps )
-        
-        self.assertEquals( expLMaps, obsLMaps )
-        
-        
-    def test_getMapListSortedByIncreasingMinThenMax_equal( self ):
-        iMap1 = Map("name1", "chr1", 350, 1)
-        iMap2 = Map("name2", "chr1", 350, 1)
-        
-        lMaps = [ iMap2, iMap1 ]
-        expLMaps = [ iMap2, iMap1 ]
-        notExpLMaps = [ iMap1, iMap2 ]
-        
-        obsLMaps = MapUtils.getMapListSortedByIncreasingMinThenMax( lMaps )
-        
-        self.assertEquals( expLMaps, obsLMaps )
-        self.assertNotEquals( notExpLMaps, obsLMaps )
-        
-        
-    def test_getMapListSortedByIncreasingNameThenSeqnameThenMinThenMax( self ):
-        iMap1 = Map("name1", "chr1", 1, 350)
-        iMap2 = Map("name4", "chr2", 5, 450)
-        iMap3 = Map("name4", "chr1", 10, 450)
-        iMap4 = Map("name4", "chr1", 10, 500)
-        iMap5 = Map("name4", "chr1", 5, 450)
-        iMap6 = Map("name3", "chr1", 50, 350)
-        iMap7 = Map("name2", "chr1", 1, 100)
-
-        lMaps = [ iMap1, iMap2, iMap3, iMap4, iMap5, iMap6, iMap7 ]
-        
-        expLMaps = [ iMap1, iMap7, iMap6, iMap5, iMap3, iMap4, iMap2 ]
-        
-        obsLMaps = MapUtils.getMapListSortedByIncreasingNameThenSeqnameThenMinThenMax( lMaps )
-        
-        self.assertEquals( expLMaps, obsLMaps )
-        
-        
-    def test_getMapListSortedByIncreasingNameThenSeqnameThenMinThenMax_ordered( self ):
-        iMap1 = Map("name1", "chr1", 1, 100)
-        iMap2 = Map("name1", "chr2", 1, 350)
-        
-        lMaps = [ iMap1, iMap2 ]
-        expLMaps = [ iMap1, iMap2 ]
-        
-        obsLMaps = MapUtils.getMapListSortedByIncreasingNameThenSeqnameThenMinThenMax( lMaps )
-        
-        self.assertEquals( expLMaps, obsLMaps )
-        
-        
-    def test_getMapListSortedByIncreasingNameThenSeqnameThenMinThenMax_unordered( self ):
-        iMap1 = Map("name1", "chr2", 1, 350)
-        iMap2 = Map("name1", "chr1", 1, 100)
-        
-        lMaps = [ iMap1, iMap2 ]
-        expLMaps = [ iMap2, iMap1 ]
-        
-        obsLMaps = MapUtils.getMapListSortedByIncreasingNameThenSeqnameThenMinThenMax( lMaps )
-        
-        self.assertEquals( expLMaps, obsLMaps )
-        
-        
-    def test_getMapListSortedByIncreasingNameThenSeqnameThenMinThenMax_nonOverlapping( self ):
-        iMap1 = Map("name1", "chr1", 1, 350)
-        iMap2 = Map("name2", "chr1", 400, 600)
-        
-        lMaps = [ iMap2, iMap1 ]
-        expLMaps = [ iMap1, iMap2 ]
-        
-        obsLMaps = MapUtils.getMapListSortedByIncreasingNameThenSeqnameThenMinThenMax( lMaps )
-        
-        self.assertEquals( expLMaps, obsLMaps )
-        
-        
-    def test_getMapListSortedByIncreasingNameThenSeqnameThenMinThenMax_sameMinThreeMaps( self ):
-        iMap1 = Map("name2", "chr1", 150, 10)
-        iMap2 = Map("name2", "chr1", 1, 100)
-        iMap3 = Map("name2", "chr1", 100, 1)
-        
-        lMaps = [ iMap1, iMap2, iMap3 ]
-        expLMaps = [ iMap2, iMap3, iMap1 ]
-        
-        obsLMaps = MapUtils.getMapListSortedByIncreasingNameThenSeqnameThenMinThenMax( lMaps )
-        
-        self.assertEquals( expLMaps, obsLMaps )
-        
-
-    def test_getDictPerNameFromMapFile( self ):
-        iMap1 = Map( "chunk1", "chromosome1", 1, 100 )
-        iMap2 = Map( "chunk2", "chromosome1", 91, 190 )
-        iMap3 = Map( "chunk3", "chromosome2", 1, 100 )
-        iMap4 = Map( "chunk1", "chromosome1", 1, 100 )  # redundant with iMap1
-        
-        mapFile = "dummyFile.map"
-        mapFileHandler = open( mapFile, "w" )
-        for iMap in [ iMap1, iMap2, iMap3, iMap4 ]:
-            iMap.write( mapFileHandler )
-        mapFileHandler.close()
-        
-        dExp = { "chunk1": iMap1, "chunk2": iMap2, "chunk3": iMap3 }
-        
-        dObs = MapUtils.getDictPerNameFromMapFile( mapFile )
-        
-        self.assertEquals( dExp, dObs )
-        
-        os.remove( mapFile )
-        
-        
-    def test_mapList2SetList(self):
-        map1 = Map( "name1", "desc1", 1, 120 )
-        map2 = Map( "name2", "desc2", 1, 20 )
-        lMap = [ map1, map2 ]
-        set1 = Set( 1, "name1", "desc1", 1, 120 )
-        set2 = Set( 2, "name2", "desc2", 1, 20 )
-        explMapSet = [ set1, set2 ]
-        obslMapSet = MapUtils.mapList2SetList( lMap )
-        
-        self.assertEquals( explMapSet, obslMapSet )
-        
-        
-    def test_mergeCoordsInFile( self ):
-        if sys.modules.has_key( "commons.core.checker.CheckerUtils" ):
-            inFile = "dummyInFile"
-            inFileHandler = open( inFile, "w" )
-            inFileHandler.write( "TE1\tchr1\t1501\t2500\n" )
-            inFileHandler.write( "TE3\tchr1\t4000\t3401\n" )
-            inFileHandler.write( "TE3\tchr1\t3800\t3601\n" )
-            inFileHandler.close()
-            expFile = "dummyExpFile"
-            expFileHandler = open( expFile, "w" )
-            expFileHandler.write( "TE1\tchr1\t1501\t2500\n" )
-            expFileHandler.write( "TE3\tchr1\t4000\t3401\n" )
-            expFileHandler.close()
-            obsFile = "dummyObsFile"
-            MapUtils.mergeCoordsInFile( inFile, obsFile )
-            self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
-            for f in [ inFile, expFile, obsFile ]:
-                os.remove( f )
-                
-                
-    def test_getDictPerSeqNameFromMapFile( self ):
-        inFile = "dummyInFile"
-        inFileHandler = open( inFile, "w" )
-        inFileHandler.write( "TE1\tchr1\t1\t10\n" )
-        inFileHandler.write( "TE2\tchr1\t60\t41\n" )
-        inFileHandler.write( "TE3\tchr2\t5\t36\n" )
-        inFileHandler.close()
-        dExp = { "chr1": [ Map( "TE1", "chr1", 1, 10 ), Map( "TE2", "chr1", 60, 41 ) ],
-                "chr2": [ Map( "TE3", "chr2", 5, 36 ) ] }
-        dObs = MapUtils.getDictPerSeqNameFromMapFile( inFile )
-        self.assertEqual( dExp, dObs )
-        os.remove( inFile )
-
-    def test_convertMapFileIntoSetFile(self):
-        mapInputFile = "dummyExpFile"
-        mapFileHandler = open( mapInputFile, "w" )
-        mapFileHandler.write( "seq31\tchr1\t151\t250\n" )
-        mapFileHandler.write( "seq27\tchr2\t301\t500\n" )
-        mapFileHandler.write( "seq40\tchr2\t600\t700\n" )
-        mapFileHandler.write( "seq2\tchr3\t301\t500\n" )
-        mapFileHandler.close()
-
-        expSetFile = "dummyexpSetFile"
-        expSetFileHandler = open( expSetFile, "w" )
-        expSetFileHandler.write( "1\tseq31\tchr1\t151\t250\n" )
-        expSetFileHandler.write( "2\tseq27\tchr2\t301\t500\n" )
-        expSetFileHandler.write( "3\tseq40\tchr2\t600\t700\n" )
-        expSetFileHandler.write( "4\tseq2\tchr3\t301\t500\n" )
-        expSetFileHandler.close()
-        
-        obsFile = "dummyObsFile"
-        
-        MapUtils.convertMapFileIntoSetFile( mapInputFile, obsFile )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expSetFile, obsFile ) )
-        
-        for f in [ expSetFile, mapInputFile, obsFile ]:
-            os.remove( f )
-
-    def test_convertMapFileIntoSetFile_one_line(self):
-        mapInputFile = "dummyExpFile"
-        mapFileHandler = open( mapInputFile, "w" )
-        mapFileHandler.write( "seq31\tchr1\t151\t250\n" )
-        mapFileHandler.close()
-
-        expSetFile = "dummyexpSetFile"
-        expSetFileHandler = open( expSetFile, "w" )
-        expSetFileHandler.write( "1\tseq31\tchr1\t151\t250\n" )
-        expSetFileHandler.close()
-        
-        obsFile = "dummyObsFile"
-        
-        MapUtils.convertMapFileIntoSetFile( mapInputFile, obsFile )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expSetFile, obsFile ) )
-        
-        for f in [ expSetFile, mapInputFile, obsFile ]:
-            os.remove( f )
-
-    def test_convertMapFileIntoSetFile_empty_file(self):
-        mapInputFile = "dummyFile.map"
-        mapFileHandler = open( mapInputFile, "w" )
-        mapFileHandler.close()
-        
-        expFile = "dummyExpFile.map.set"
-        expFileHandler = open( expFile, "w" )
-        expFileHandler.close()
-        
-        obsFile = "dummyFile.map.set"
-        
-        MapUtils.convertMapFileIntoSetFile( mapInputFile )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
-        
-        for f in [ expFile, mapInputFile, obsFile ]:
-            os.remove( f )
-            
-    def test_writeListInFile_empty_list(self):
-        lMaps = [ ]
-        expFileName = "expFileName"
-        fileHandle = open(expFileName, "w")
-        fileHandle.close()
- 
-        obsFileName = "obsFileName"
-        fileHandle = open(obsFileName, "w")
-        MapUtils.writeListInFile(lMaps, obsFileName, "w")
-        fileHandle.close()
-         
-        self.assertTrue( FileUtils.are2FilesIdentical( expFileName, obsFileName ) )
-        
-        os.remove(obsFileName)
-        os.remove(expFileName)
-        
-    def test_writeListInFile_list_one_set(self):
-        lMaps = [ Map( "map1", "map1seq", 1, 10 ) ]
-        line =  "map1\tmap1seq\t1\t10\n"
-       
-        expFileName = "expFileName"
- 
-        fileHandle = open(expFileName, "w")
-        fileHandle.write(line)
-        fileHandle.close()
- 
-        obsFileName = "obsFileName"
-        fileHandle = open(obsFileName, "w")
-        MapUtils.writeListInFile(lMaps, obsFileName, "w")
-        fileHandle.close()
-         
-        self.assertTrue( FileUtils.are2FilesIdentical( expFileName, obsFileName ) )
-        
-        os.remove(obsFileName)
-        os.remove(expFileName)
-
-    def test_getMinLengthOfMapFile(self):
-        mapFileName = "%s/Gnome_tools/Vein_v4_scaffold_00001.fa.Nstretch.map" % os.environ["REPET_DATA"]
-        expMinLengthofMapFile = 20
-        iMap = MapUtils()
-        obsMinLengthofMapFile = iMap.getMinLengthOfMapFile(mapFileName)
-        self.assertEquals(expMinLengthofMapFile, obsMinLengthofMapFile)
-       
-    def test_getMaxLengthOfMapFile(self):
-        mapFileName = "%s/Gnome_tools/Vein_v4_scaffold_00001.fa.Nstretch.map" % os.environ["REPET_DATA"]
-        expMinLengthofMapFile = 6344
-        iMap = MapUtils()
-        obsMinLengthofMapFile = iMap.getMaxLengthOfMapFile(mapFileName)
-        self.assertEquals(expMinLengthofMapFile, obsMinLengthofMapFile)
-       
-
-        
-test_suite = unittest.TestSuite()
-test_suite.addTest( unittest.makeSuite( Test_MapUtils ) )
-if __name__ == "__main__":
-    unittest.TextTestRunner(verbosity=2).run( test_suite )
--- a/commons/core/coord/test/Test_Match.py	Mon Apr 29 03:26:07 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,363 +0,0 @@
-# Copyright INRA (Institut National de la Recherche Agronomique)
-# http://www.inra.fr
-# http://urgi.versailles.inra.fr
-#
-# This software is governed by the CeCILL license under French law and
-# abiding by the rules of distribution of free software.  You can  use, 
-# modify and/ or redistribute the software under the terms of the CeCILL
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# "http://www.cecill.info". 
-#
-# As a counterpart to the access to the source code and  rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty  and the software's author,  the holder of the
-# economic rights,  and the successive licensors  have only  limited
-# liability. 
-#
-# In this respect, the user's attention is drawn to the risks associated
-# with loading,  using,  modifying and/or developing or reproducing the
-# software by the user in light of its specific status of free software,
-# that may mean  that it is complicated to manipulate,  and  that  also
-# therefore means  that it is reserved for developers  and  experienced
-# professionals having in-depth computer knowledge. Users are therefore
-# encouraged to load and test the software's suitability as regards their
-# requirements in conditions enabling the security of their systems and/or 
-# data to be ensured and,  more generally, to use and operate it in the 
-# same conditions as regards security. 
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL license and that you accept its terms.
-
-
-import unittest
-from commons.core.coord.Match import Match
-from commons.core.coord.Path import Path
-
-
-class Test_Match( unittest.TestCase ):
-    
-    def test_eq_match_equals( self ):
-        tuple1 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match1 = Match()
-        match1.setFromTuple(tuple1)
-        tuple2 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match2 = Match()
-        match2.setFromTuple(tuple2)
-        self.assertEquals( match1, match2 )
-        
-    def test_eq_match_not_equals_query_name( self ):
-        tuple1 = ("Name", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match1 = Match()
-        match1.setFromTuple(tuple1)
-        tuple2 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match2 = Match()
-        match2.setFromTuple(tuple2)
-        self.assertNotEquals( match1, match2 )
-        
-    def test_eq_match_not_equals_query_start( self ):
-        tuple1 = ("QName", 2, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match1 = Match()
-        match1.setFromTuple(tuple1)
-        tuple2 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match2 = Match()
-        match2.setFromTuple(tuple2)
-        self.assertNotEquals( match1, match2 )
-        
-    def test_eq_match_not_equals_query_end( self ):
-        tuple1 = ("QName", 1, 6, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match1 = Match()
-        match1.setFromTuple(tuple1)
-        tuple2 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match2 = Match()
-        match2.setFromTuple(tuple2)
-        self.assertNotEquals( match1, match2 )
-        
-    def test_eq_match_not_equals_query_length( self ):
-        tuple1 = ("QName", 1, 5, 6, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match1 = Match()
-        match1.setFromTuple(tuple1)
-        tuple2 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match2 = Match()
-        match2.setFromTuple(tuple2)
-        self.assertNotEquals( match1, match2 )
-        
-    def test_eq_match_not_equals_query_length_perc( self ):
-        tuple1 = ("QName", 1, 5, 5, 0.15, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match1 = Match()
-        match1.setFromTuple(tuple1)
-        tuple2 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match2 = Match()
-        match2.setFromTuple(tuple2)
-        self.assertNotEquals( match1, match2 )
-        
-    def test_eq_match_not_equals_match_length_perc( self ):
-        tuple1 = ("QName", 1, 5, 5, 0.1, 0.25, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match1 = Match()
-        match1.setFromTuple(tuple1)
-        tuple2 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match2 = Match()
-        match2.setFromTuple(tuple2)
-        self.assertNotEquals( match1, match2 )
-        
-    def test_eq_match_not_equals_subject_name( self ):
-        tuple1 = ("QName", 1, 5, 5, 0.1, 0.2, "Name", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match1 = Match()
-        match1.setFromTuple(tuple1)
-        tuple2 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match2 = Match()
-        match2.setFromTuple(tuple2)
-        self.assertNotEquals( match1, match2 )
-        
-    def test_eq_match_not_equals_subject_start( self ):
-        tuple1 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 6, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match1 = Match()
-        match1.setFromTuple(tuple1)
-        tuple2 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match2 = Match()
-        match2.setFromTuple(tuple2)
-        self.assertNotEquals( match1, match2 )
-        
-    def test_eq_match_not_equals_subject_end( self ):
-        tuple1 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 26, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match1 = Match()
-        match1.setFromTuple(tuple1)
-        tuple2 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match2 = Match()
-        match2.setFromTuple(tuple2)
-        self.assertNotEquals( match1, match2 )
-        
-    def test_eq_match_not_equals_subject_length( self ):
-        tuple1 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 21, 0.15, 1e-20, 15, 87.2, 1)
-        match1 = Match()
-        match1.setFromTuple(tuple1)
-        tuple2 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match2 = Match()
-        match2.setFromTuple(tuple2)
-        self.assertNotEquals( match1, match2 )
-        
-    def test_eq_match_not_equals_subject_length_perc( self ):
-        tuple1 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.16, 1e-20, 15, 87.2, 1)
-        match1 = Match()
-        match1.setFromTuple(tuple1)
-        tuple2 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match2 = Match()
-        match2.setFromTuple(tuple2)
-        self.assertNotEquals( match1, match2 )
-        
-    def test_eq_match_not_equals_subject_e_value( self ):
-        tuple1 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-21, 15, 87.2, 1)
-        match1 = Match()
-        match1.setFromTuple(tuple1)
-        tuple2 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match2 = Match()
-        match2.setFromTuple(tuple2)
-        self.assertNotEquals( match1, match2 )
-        
-    def test_eq_match_not_equals_subject_score( self ):
-        tuple1 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 16, 87.2, 1)
-        match1 = Match()
-        match1.setFromTuple(tuple1)
-        tuple2 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match2 = Match()
-        match2.setFromTuple(tuple2)
-        self.assertNotEquals( match1, match2 )
-        
-    def test_eq_match_not_equals_subject_identity( self ):
-        tuple1 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 85.2, 1)
-        match1 = Match()
-        match1.setFromTuple(tuple1)
-        tuple2 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match2 = Match()
-        match2.setFromTuple(tuple2)
-        self.assertNotEquals( match1, match2 )
-        
-    def test_eq_match_not_equals_subject_id( self ):
-        tuple1 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 2)
-        match1 = Match()
-        match1.setFromTuple(tuple1)
-        tuple2 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match2 = Match()
-        match2.setFromTuple(tuple2)
-        self.assertNotEquals( match1, match2 )
-        
-    def test_setFromTuple_direct_strand( self ):
-        tuple = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        obsMatch = Match()
-        obsMatch.setFromTuple(tuple)
-        expMatch = Match()
-        expMatch.range_query.seqname = "QName"
-        expMatch.range_query.start = 1
-        expMatch.range_query.end = 5
-        expMatch.query_length = 5
-        expMatch.query_length_perc = 0.1
-        expMatch.match_length_perc = 0.2
-        expMatch.range_subject.seqname = "SName"
-        expMatch.range_subject.start = 5
-        expMatch.range_subject.end = 25
-        expMatch.subject_length = 20
-        expMatch.subject_length_perc = 0.15
-        expMatch.e_value = 1e-20
-        expMatch.score = 15
-        expMatch.identity = 87.2
-        expMatch.id = 1
-        expMatch.subject_seqlength = int( expMatch.subject_length / expMatch.subject_length_perc )
-        expMatch.query_seqlength = int( expMatch.query_length / expMatch.query_length_perc )
-        self.assertEquals( expMatch, obsMatch )
-   
-    def test_setFromTuple_reverse_strand_on_subject( self ):
-        tuple = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 25, 5, 20, 0.15, 1e-20, 15, 87.2, 1)
-        obsMatch = Match()
-        obsMatch.setFromTuple(tuple)
-        expMatch = Match()
-        expMatch.range_query.seqname = "QName"
-        expMatch.range_query.start = 1
-        expMatch.range_query.end = 5
-        expMatch.query_length = 5
-        expMatch.query_length_perc = 0.1
-        expMatch.match_length_perc = 0.2
-        expMatch.range_subject.seqname = "SName"
-        expMatch.range_subject.start = 25
-        expMatch.range_subject.end = 5
-        expMatch.subject_length = 20
-        expMatch.subject_length_perc = 0.15
-        expMatch.e_value = 1e-20
-        expMatch.score = 15
-        expMatch.identity = 87.2
-        expMatch.id = 1
-        expMatch.subject_seqlength = int( expMatch.subject_length / expMatch.subject_length_perc )
-        expMatch.query_seqlength = int( expMatch.query_length / expMatch.query_length_perc )
-        self.assertEquals( expMatch, obsMatch )
-        
-    def test_setFromTuple_reverse_strand_on_query( self ):
-        tuple = ("QName", 5, 1, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        obsMatch = Match()
-        obsMatch.setFromTuple(tuple)
-        expMatch = Match()
-        expMatch.range_query.seqname = "QName"
-        expMatch.range_query.start = 1
-        expMatch.range_query.end = 5
-        expMatch.query_length = 5
-        expMatch.query_length_perc = 0.1
-        expMatch.match_length_perc = 0.2
-        expMatch.range_subject.seqname = "SName"
-        expMatch.range_subject.start = 25
-        expMatch.range_subject.end = 5
-        expMatch.subject_length = 20
-        expMatch.subject_length_perc = 0.15
-        expMatch.e_value = 1e-20
-        expMatch.score = 15
-        expMatch.identity = 87.2
-        expMatch.id = 1
-        expMatch.subject_seqlength = int( expMatch.subject_length / expMatch.subject_length_perc )
-        expMatch.query_seqlength = int( expMatch.query_length / expMatch.query_length_perc )
-        self.assertEquals( expMatch, obsMatch )
-        
-    def test_setFromTuple_reverse_strand_on_query_and_subject( self ):
-        tuple = ("QName", 5, 1, 5, 0.1, 0.2, "SName", 25, 5, 20, 0.15, 1e-20, 15, 87.2, 1)
-        obsMatch = Match()
-        obsMatch.setFromTuple(tuple)
-        expMatch = Match()
-        expMatch.range_query.seqname = "QName"
-        expMatch.range_query.start = 1
-        expMatch.range_query.end = 5
-        expMatch.query_length = 5
-        expMatch.query_length_perc = 0.1
-        expMatch.match_length_perc = 0.2
-        expMatch.range_subject.seqname = "SName"
-        expMatch.range_subject.start = 5
-        expMatch.range_subject.end = 25
-        expMatch.subject_length = 20
-        expMatch.subject_length_perc = 0.15
-        expMatch.e_value = 1e-20
-        expMatch.score = 15
-        expMatch.identity = 87.2
-        expMatch.id = 1
-        expMatch.subject_seqlength = int( expMatch.subject_length / expMatch.subject_length_perc )
-        expMatch.query_seqlength = int( expMatch.query_length / expMatch.query_length_perc )
-        self.assertEquals( expMatch, obsMatch )
-        
-    def test_toString( self ):        
-        tuple = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match = Match()
-        match.setFromTuple(tuple)
-        expString = "QName\t1\t5\t5\t%f\t%f\tSName\t5\t25\t20\t%f\t%g\t15\t%f\t1" % (0.1,0.2,0.15,1e-20, 87.2)
-        obsString = match.toString()
-        self.assertEquals(expString, obsString)
-        
-    def test_getPathInstance( self ):
-        tuple = ( "QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1 )
-        match = Match()
-        match.setFromTuple( tuple )
-        tuple = ( 1, "QName", 1, 5, "SName", 5, 25, 1e-20, 15, 87.2 )
-        exp = Path()
-        exp.setFromTuple( tuple )
-        obs = match.getPathInstance()
-        self.assertEqual( exp, obs )
-        
-    def test_getQryIsIncluded(self):
-        tuple = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match = Match()
-        match.setFromTuple(tuple)
-        expString = "query QName (50 bp: 1-5) is contained in subject SName (133 bp: 5-25): id=87.20 - 0.100 - 0.200 - 0.150"
-        obsString = match.getQryIsIncluded()
-        self.assertEquals(expString, obsString)
-        
-    def test_isDoublonWith_Matchs_equals(self):
-        tuple1 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match1 = Match()
-        match1.setFromTuple(tuple1)
-        tuple2 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match2 = Match()
-        match2.setFromTuple(tuple2)
-        self.assertTrue(match1.isDoublonWith(match2))
-        
-    def test_isDoublonWith_Matchs_unequals_on_MatchNumbers(self):
-        tuple1 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match1 = Match()
-        match1.setFromTuple(tuple1)
-        tuple2 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 86.2, 1)
-        match2 = Match()
-        match2.setFromTuple(tuple2)
-        self.assertFalse(match1.isDoublonWith(match2))
-        
-    def test_isDoublonWith_Matchs_unequals_on_SeqNames(self):
-        tuple1 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match1 = Match()
-        match1.setFromTuple(tuple1)
-        tuple2 = ("QName", 1, 5, 5, 0.1, 0.2, "Name", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match2 = Match()
-        match2.setFromTuple(tuple2)
-        self.assertFalse(match1.isDoublonWith(match2))
-        
-    def test_isDoublonWith_Matchs_unequals_on_Coordinates(self):
-        tuple1 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match1 = Match()
-        match1.setFromTuple(tuple1)
-        tuple2 = ("QName", 1, 6, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match2 = Match()
-        match2.setFromTuple(tuple2)
-        self.assertFalse(match1.isDoublonWith(match2))
-        
-    def test_isDoublonWith_Reversed_Matchs_equals(self):
-        tuple1 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match1 = Match()
-        match1.setFromTuple(tuple1)
-        tuple2 = ("SName", 5, 25, 20, 0.15, 0.2, "QName", 1, 5, 5, 0.1, 1e-20, 15, 87.2, 1)
-        match2 = Match()
-        match2.setFromTuple(tuple2)
-        self.assertTrue(match1.isDoublonWith(match2))
-        
-    def test_isDoublonWith_Reversed_Matchs_unequals(self):
-        tuple1 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        match1 = Match()
-        match1.setFromTuple(tuple1)
-        tuple2 = ("SName", 5, 25, 20, 0.15, 0.2, "QName", 1, 6, 5, 0.1, 1e-20, 15, 87.2, 1)
-        match2 = Match()
-        match2.setFromTuple(tuple2)
-        self.assertFalse(match1.isDoublonWith(match2))
-        
-        
-test_suite = unittest.TestSuite()
-test_suite.addTest( unittest.makeSuite( Test_Match ) )
-if __name__ == "__main__":
-    unittest.TextTestRunner(verbosity=2).run( test_suite )
--- a/commons/core/coord/test/Test_MatchUtils.py	Mon Apr 29 03:26:07 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,439 +0,0 @@
-# Copyright INRA (Institut National de la Recherche Agronomique)
-# http://www.inra.fr
-# http://urgi.versailles.inra.fr
-#
-# This software is governed by the CeCILL license under French law and
-# abiding by the rules of distribution of free software.  You can  use, 
-# modify and/ or redistribute the software under the terms of the CeCILL
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# "http://www.cecill.info". 
-#
-# As a counterpart to the access to the source code and  rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty  and the software's author,  the holder of the
-# economic rights,  and the successive licensors  have only  limited
-# liability. 
-#
-# In this respect, the user's attention is drawn to the risks associated
-# with loading,  using,  modifying and/or developing or reproducing the
-# software by the user in light of its specific status of free software,
-# that may mean  that it is complicated to manipulate,  and  that  also
-# therefore means  that it is reserved for developers  and  experienced
-# professionals having in-depth computer knowledge. Users are therefore
-# encouraged to load and test the software's suitability as regards their
-# requirements in conditions enabling the security of their systems and/or 
-# data to be ensured and,  more generally, to use and operate it in the 
-# same conditions as regards security. 
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL license and that you accept its terms.
-
-
-import unittest
-import os
-from commons.core.utils.FileUtils import FileUtils
-from commons.core.coord.MatchUtils import MatchUtils
-from commons.core.coord.Match import Match
-from commons.core.seq.BioseqDB import BioseqDB
-
-
-class Test_MatchUtils( unittest.TestCase ):
-    
-    def test_getMatchListFromFile( self ):
-        inFile = "dummyInFile"
-        inFileHandler = open( inFile, "w" )
-        inFileHandler.write( "query.name\tquery.start\tquery.end\tquery.length\tquery.length.%\tmatch.length.%\tsubject.name\tsubject.start\tsubject.end\tsubject.length\tsubject.length.%\tE.value\tScore\tIdentity\tpath\n" )
-        m1 = Match()
-        m1.setFromTuple( ("QName", 1, 5, 5, 0.1, 0.2, "SName1", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1) )
-        m1.write( inFileHandler )
-        m2 = Match()
-        m2.setFromTuple( ("QName", 1, 5, 5, 0.1, 0.2, "SName2", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1) )
-        m2.write( inFileHandler )
-        inFileHandler.close()
-        
-        lExp = [ m1, m2 ]
-        
-        lObs = MatchUtils.getMatchListFromFile( inFile )
-        
-        self.assertEquals( lExp, lObs )
-        
-        os.remove( inFile )
-        
-    def test_getDictOfListsWithSubjectAsKey( self ):
-        m1 = Match()
-        m1.setFromTuple( ("QName", 1, 5, 5, 0.1, 0.2, "SName1", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1) )
-        m2 = Match()
-        m2.setFromTuple( ("QName", 1, 5, 5, 0.1, 0.2, "SName2", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1) )
-        lMatch = [ m1, m2 ]
-        
-        dExp = { "SName1": [ m1 ], "SName2": [ m2 ] }
-        
-        dObs = MatchUtils.getDictOfListsWithSubjectAsKey( lMatch )
-        
-        self.assertEquals( dExp, dObs )
-        
-    def test_getDictOfListsWithQueryAsKey( self ):
-        m1 = Match()
-        m1.setFromTuple( ("QName1", 1, 5, 5, 0.1, 0.2, "SName1", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1) )
-        m2 = Match()
-        m2.setFromTuple( ("QName2", 1, 5, 5, 0.1, 0.2, "SName2", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1) )
-        m3 = Match()
-        m3.setFromTuple( ("QName1", 1, 5, 5, 0.1, 0.2, "SName3", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1) )
-        lMatch = [ m1, m2, m3 ]
-        
-        dExp = { "QName1": [ m1, m3 ], "QName2": [ m2 ] }
-        
-        dObs = MatchUtils.getDictOfListsWithQueryAsKey( lMatch )
-        
-        self.assertEquals( dExp, dObs )
-    
-    def test_getIdListFromMatchList( self ):
-        m1 = Match()
-        m1.setFromTuple( ("QName", 1, 5, 5, 0.1, 0.2, "SName1", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1) )
-        m2 = Match()
-        m2.setFromTuple( ("QName", 1, 5, 5, 0.1, 0.2, "SName2", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 10) )
-        lMatch = [ m1, m2 ]  
-        
-        lExp = [1, 10]       
-        
-        lObs = MatchUtils.getIdListFromMatchList( lMatch )
-        
-        self.assertEquals(lExp, lObs)
-        
-    def test_getIdListFromMatchList_empty_list( self ):
-        lMatch = []  
-        lExp = []       
-        
-        lObs = MatchUtils.getIdListFromMatchList( lMatch )
-        
-        self.assertEquals(lExp, lObs)
-        
-    def test_writeListInFile_without_header( self ):
-        m1 = Match()
-        m1.setFromTuple( ("QName", 1, 5, 5, 0.1, 0.2, "SName1", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1) )
-        m2 = Match()
-        m2.setFromTuple( ("QName", 1, 5, 5, 0.1, 0.2, "SName2", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 10) )
-        lMatch = [ m1, m2 ]  
-        
-        line1 = "QName\t1\t5\t5\t0.100000\t0.200000\tSName1\t5\t25\t20\t0.150000\t1e-20\t15\t87.200000\t1\n"
-        line2 = "QName\t1\t5\t5\t0.100000\t0.200000\tSName2\t5\t25\t20\t0.150000\t1e-20\t15\t87.200000\t10\n"
-        
-        expFileName = "expFileName.match"
-        expFileHandle = open ( expFileName, 'w' )
-        expFileHandle.write(line1)
-        expFileHandle.write(line2)
-        expFileHandle.close()
-        
-        obsFileName = "obsFileName.match"
-        
-        MatchUtils.writeListInFile( lMatch, obsFileName )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFileName, obsFileName ) )
-        
-        os.remove( obsFileName )
-        os.remove( expFileName )
-
-    def test_writeListInFile_with_header( self ):
-        m1 = Match()
-        m1.setFromTuple( ("QName", 1, 5, 5, 0.1, 0.2, "SName1", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1) )
-        m2 = Match()
-        m2.setFromTuple( ("QName", 1, 5, 5, 0.1, 0.2, "SName2", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 10) )
-        lMatch = [ m1, m2 ]  
-        
-        headerLine = "query.name\tquery.start\tquery.end\tquery.length\tquery.length.%\tmatch.length.%\tsubject.name\tsubject.start\tsubject.end\tsubject.length\tsubject.length.%\tE.value\tScore\tIdentity\tpath\n"
-        
-        line1 = headerLine
-        line2 = "QName\t1\t5\t5\t0.100000\t0.200000\tSName1\t5\t25\t20\t0.150000\t1e-20\t15\t87.200000\t1\n"
-        line3 = "QName\t1\t5\t5\t0.100000\t0.200000\tSName2\t5\t25\t20\t0.150000\t1e-20\t15\t87.200000\t10\n"
-        
-        expFileName = "expFileName.match"
-        expFileHandle = open ( expFileName, 'w' )
-        expFileHandle.write(line1)
-        expFileHandle.write(line2)
-        expFileHandle.write(line3)
-        expFileHandle.close()
-        
-        obsFileName = "obsFileName.match"
-        
-        MatchUtils.writeListInFile( lMatch, obsFileName, header=headerLine )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFileName, obsFileName ) )
-        
-        os.remove( obsFileName )
-        os.remove( expFileName )
-        
-    def test_writeListInFile_with_append_mode( self ):
-        m1 = Match()
-        m1.setFromTuple( ("QName", 1, 5, 5, 0.1, 0.2, "SName1", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1) )
-        m2 = Match()
-        m2.setFromTuple( ("QName", 1, 5, 5, 0.1, 0.2, "SName2", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 10) )
-        lMatch = [ m1, m2 ]  
-        
-        line1 = "QName\t1\t5\t5\t0.100000\t0.200000\tSName1\t5\t25\t20\t0.150000\t1e-20\t15\t87.200000\t1\n"
-        line2 = "QName\t1\t5\t5\t0.100000\t0.200000\tSName2\t5\t25\t20\t0.150000\t1e-20\t15\t87.200000\t10\n"
-        
-        expFileName = "expFileName.match"
-        expFileHandle = open ( expFileName, 'w' )
-        expFileHandle.write(line1)
-        expFileHandle.write(line1)
-        expFileHandle.write(line2)
-        expFileHandle.close()
-        
-        obsFileName = "obsFileName.match"
-        obsFileHandle = open ( obsFileName, 'w' )
-        obsFileHandle.write(line1)
-        obsFileHandle.close()
-        
-        MatchUtils.writeListInFile( lMatch, obsFileName, 'a' )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFileName, obsFileName ) )
-        
-        os.remove( obsFileName )
-        os.remove( expFileName )       
-
-    def test_rmvDuplicateMatches(self):
-        m1 = Match()
-        m1.setFromTuple( ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1) )
-        m2 = Match()
-        m2.setFromTuple( ("QName", 1, 5, 5, 0.1, 0.2, "SName2", 5, 25, 20, 0.15, 1e-20, 15, 86.2, 1) )
-        m3 = Match()
-        m3.setFromTuple( ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1) )
-        lMatch = [ m1, m3, m2 ]  
-        
-        lExp = [m1, m2]
-        lObs = MatchUtils.rmvDuplicateMatches(lMatch)
-        
-        self.assertEquals(lExp, lObs)
-        
-    def test_filterDiffQrySbj_same_seq(self):
-        fastaFileName = "file.fa"
-        self._writeFastaFile(fastaFileName)
-        qryDB = BioseqDB(fastaFileName)
-        tabFileName = "file.tab"
-        self._writeMatchFile(tabFileName)
-        
-        expListToKeep = ["HELITRON2"]
-        obsListToKeep = MatchUtils.filterDiffQrySbj(qryDB,tabFileName, 0.95, 0.98, 2)
-        self.assertEquals(expListToKeep, obsListToKeep)
-        os.remove(fastaFileName)
-        os.remove(tabFileName)
-
-    def test_filterDiffQrySbj_TE_included_in_67percent_in_other_TE(self):
-        fastaFileName = "file.fa"
-        self._writeFastaFile2(fastaFileName)
-        qryDB = BioseqDB(fastaFileName)
-        tabFileName = "file.tab"
-        self._writeMatchFile2(tabFileName)
-        expListToKeep = []
-        obsListToKeep = MatchUtils.filterDiffQrySbj(qryDB, tabFileName, 0.95, 0.98, 2)
-        self.assertEquals(expListToKeep, obsListToKeep)
-        os.remove(fastaFileName)
-        os.remove(tabFileName)
-        
-    def test_getNbDistinctSequencesInsideMatchesWithThresh_query(self):
-        tabFileName = "file.tab"
-        self._writeMatchFile3(tabFileName)
-        lMatches = MatchUtils.getMatchListFromFile(tabFileName)
-        expNbDistinctMatches = 1
-        obsNbDistinctMatches = MatchUtils.getNbDistinctSequencesInsideMatchesWithThresh(lMatches,0.95, 0.98,"query")
-        self.assertEquals(expNbDistinctMatches, obsNbDistinctMatches)
-        os.remove(tabFileName)
-        
-    def test_getNbDistinctSequencesInsideMatchesWithThresh_subject(self):
-        tabFileName = "file.tab"
-        self._writeMatchFile3(tabFileName)
-        lMatches = MatchUtils.getMatchListFromFile(tabFileName)
-        expNbDistinctMatches = 1
-        obsNbDistinctMatches = MatchUtils.getNbDistinctSequencesInsideMatchesWithThresh(lMatches,0.95, 0.98,"subject")
-        self.assertEquals(expNbDistinctMatches, obsNbDistinctMatches)
-        os.remove(tabFileName)
-        
-    def test_convertMatchFileToAlignFile(self):
-        inputMatchFileName = "file.tab"
-        expAlignFileName = "expected.align"
-        obsAlignFileName = "file.align"
-        
-        self._writeExpAlignFile(expAlignFileName)
-        self._writeMatchFile4(inputMatchFileName)
-        MatchUtils.convertMatchFileToAlignFile(inputMatchFileName)
-        
-        self.assertTrue(FileUtils.are2FilesIdentical(expAlignFileName, obsAlignFileName))
-        
-        os.remove(inputMatchFileName)
-        os.remove(expAlignFileName)
-        os.remove(obsAlignFileName)
-    
-    def test_convertMatchFileToAlignFile_empty_file(self):
-        inputMatchFileName = "file.tab"
-        expAlignFileName = "expected.align"
-        obsAlignFileName = "file.align"
-        
-        f = open(expAlignFileName, "w")
-        f.close()
-        f = open(inputMatchFileName, "w")
-        f.close()
-        MatchUtils.convertMatchFileToAlignFile(inputMatchFileName)
-        
-        self.assertTrue(FileUtils.are2FilesIdentical(expAlignFileName, obsAlignFileName))
-        
-        os.remove(inputMatchFileName)
-        os.remove(expAlignFileName)
-        os.remove(obsAlignFileName)
-            
-    def test_generateMatchFileWithNewPathId(self):
-        inputMatchFileName = "file.tab"
-        expMatchFileName = "expected.tab"
-        obsMatchFileName = "obsFile.tab"
-        
-        self._writeMatchFile5(inputMatchFileName)
-        self._writeExpMatchFile(expMatchFileName)        
-        MatchUtils.generateMatchFileWithNewPathId(inputMatchFileName, obsMatchFileName)
-        
-        self.assertTrue(FileUtils.are2FilesIdentical(expMatchFileName, obsMatchFileName))
-        
-        os.remove(inputMatchFileName)
-        os.remove(expMatchFileName)
-        os.remove(obsMatchFileName)
-        
-    def test_generateMatchFileWithNewPathId_empty_file(self):
-        inputMatchFileName = "file.tab"
-        expMatchFileName = "expected.tab"
-        obsMatchFileName = "obsFile.tab"
-        
-        f = open(expMatchFileName, "w")
-        f.write("query.name\tquery.start\tquery.end\tquery.length\tquery.length.%\tmatch.length.%\tsubject.name\tsubject.start\tsubject.end\tsubject.length\tsubject.length.%\tE.value\tScore\tIdentity\tpath\n")
-        f.close()
-        f = open(inputMatchFileName, "w")
-        f.close()
-        MatchUtils.generateMatchFileWithNewPathId(inputMatchFileName, obsMatchFileName)
-        
-        self.assertTrue(FileUtils.are2FilesIdentical(expMatchFileName, obsMatchFileName))
-        
-        os.remove(inputMatchFileName)
-        os.remove(expMatchFileName)
-        os.remove(obsMatchFileName)
-        
-    def test_convertMatchFileIntoABCFileOnQueryCoverage(self):
-        matchFileName = "dummy.tab"
-        with open(matchFileName, "w") as f:
-            f.write("query.name\tquery.start\tquery.end\tquery.length\tquery.length.%\tmatch.length.%\tsubject.name\tsubject.start\tsubject.end\tsubject.length\tsubject.length.%\tE.value\tScore\tIdentity\tpath\n")
-            f.write("chr3\t1\t100\t100\t0.98\t0.95\tchr5\t11\t110\t100\t0.95\t1e-52\t133\t87.200000\n")
-            f.write("chr7\t1\t200\t200\t0.98\t0.95\tchr2\t11\t210\t200\t0.95\t1e-78\t235\t98.900000\n")
-            f.write("chr5\t1\t100\t100\t0.95\t0.95\tchr3\t11\t110\t100\t0.98\t1e-52\t133\t87.200000\n")
-            f.write("chr2\t1\t200\t200\t0.95\t0.95\tchr7\t11\t210\t200\t0.98\t1e-78\t235\t98.900000\n")
-        expFileName = "exp.abc"
-        with open(expFileName, "w") as f:
-            f.write("chr3\tchr5\t0.98\n")
-            f.write("chr7\tchr2\t0.98\n")
-            f.write("chr5\tchr3\t0.95\n")
-            f.write("chr2\tchr7\t0.95\n")
-        obsFileName = "obs.abc"
-        
-        MatchUtils.convertMatchFileIntoABCFileOnQueryCoverage(matchFileName, obsFileName)
-        
-        self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName))
-        
-        os.remove(matchFileName)
-        os.remove(expFileName)
-        os.remove(obsFileName)
-        
-    def test_convertMatchFileIntoABCFileOnQueryCoverage_coverage_threshold_85(self):
-        matchFileName = "dummy.tab"
-        with open(matchFileName, "w") as f:
-            f.write("query.name\tquery.start\tquery.end\tquery.length\tquery.length.%\tmatch.length.%\tsubject.name\tsubject.start\tsubject.end\tsubject.length\tsubject.length.%\tE.value\tScore\tIdentity\tpath\n")
-            f.write("chr3\t1\t100\t100\t0.98\t0.95\tchr5\t11\t110\t100\t0.95\t1e-52\t133\t87.200000\n")
-            f.write("chr7\t1\t200\t200\t0.98\t0.95\tchr2\t11\t210\t200\t0.95\t1e-78\t235\t98.900000\n")
-            f.write("chr5\t1\t100\t100\t0.85\t0.95\tchr3\t11\t110\t100\t0.98\t1e-52\t133\t87.200000\n")
-            f.write("chr2\t1\t200\t200\t0.80\t0.95\tchr7\t11\t210\t200\t0.98\t1e-78\t235\t98.900000\n")
-        expFileName = "exp.abc"
-        with open(expFileName, "w") as f:
-            f.write("chr3\tchr5\t0.98\n")
-            f.write("chr7\tchr2\t0.98\n")
-            f.write("chr5\tchr3\t0.85\n")
-        obsFileName = "obs.abc"
-        
-        MatchUtils.convertMatchFileIntoABCFileOnQueryCoverage(matchFileName, obsFileName, coverage = 0.85)
-        
-        self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName))
-        
-        os.remove(matchFileName)
-        os.remove(expFileName)
-        os.remove(obsFileName)
-        
-    def _writeFastaFile(self, fileName):
-        f = open(fileName, "w")
-        f.write(">HELITRON3\n")
-        f.write("GGCCAGTCACAATGGGGGTTTCACTGGTGTGTCATGCACATTTAATAGGGGTAAGACTGA\n")
-        f.write("ATAAAAAATGATTATTTGCATGAAATGGGGATGAGAGAGAAGGAAAGAGTTTCATCCTGG\n")
-        f.write("GATTCGTTTCATTCACCGGATCTCTTGCGTCCGCCTCCGCCGTGCGACCTCCGCATTCTC\n")
-        f.write(">HELITRON2\n")
-        f.write("GGCCAGTCACAATGGGGGTTTCACTGGTGTGTCATGCACATTTAATAGGGGTAAGACTGA\n")
-        f.write("ATAAAAAATGATTATTTGCATGAAATGGGGATGAGAGAGAAGGAAAGAGTTTCATCCTGG\n")
-        f.write("GATTCGTTTCATTCACCGGATCTCTTGCGTCCGCCTCCGCCGTGCGACCTCCGCATTCTC\n")
-        f.close()
-
-    def _writeMatchFile(self, fileName):
-        f = open(fileName, "w")
-        f.write("query.name\tquery.start\tquery.end\tquery.length\tquery.length.%\tmatch.length.%\tsubject.name\tsubject.start\tsubject.end\tsubject.length\tsubject.length.%\tE.value\tScore\tIdentity\tpath\n")
-        f.write("HELITRON3\t1\t180\t180\t1\t1\tHELITRON2\t1\t180\t180\t1\t2e-103\t357\t100\t1\n")
-        f.close()
-        
-    def _writeFastaFile2(self, fileName):
-        f = open(fileName, "w")
-        f.write(">header2\n")
-        f.write("TTTCACTGGTGTGTCATGCACATTTAATAGGGGTAAGACTGAATAAAAAATGATTATTTG\n")
-        f.write("CATGAAATGGGGATGAGAGAGAAGGAAAGAGTTTCATCCTGGGATTCGTTTCATTCACCG\n")
-        f.close()
-
-    def _writeMatchFile2(self, fileName):
-        f = open(fileName, "w")
-        f.write("query.name\tquery.start\tquery.end\tquery.length\tquery.length.%\tmatch.length.%\tsubject.name\tsubject.start\tsubject.end\tsubject.length\tsubject.length.%\tE.value\tScore\tIdentity\tpath\n")
-        f.write("header2\t1\t120\t120\t1\t0.674157\tBS31790\t19\t138\t120\t0.674157\t3e-68\t238\t100\t1\n")
-        f.close()
-        
-    def _writeMatchFile3(self, fileName):
-        f = open(fileName, "w")
-        f.write("query.name\tquery.start\tquery.end\tquery.length\tquery.length.%\tmatch.length.%\tsubject.name\tsubject.start\tsubject.end\tsubject.length\tsubject.length.%\tE.value\tScore\tIdentity\tpath\n")
-        f.write("header2\t1\t120\t120\t0.674157\t0.674157\tBS31790\t19\t138\t120\t0.674157\t3e-68\t238\t100\t1\n")
-        f.write("header3\t1\t120\t120\t0.99\t0.994157\tBS31790\t19\t138\t120\t0.994157\t3e-68\t238\t100\t1\n")
-        f.write("header4\t1\t120\t120\t1\t0.94157\tBS31790\t19\t138\t120\t0.674157\t3e-68\t238\t67\t1\n")
-        f.close()
-        
-    def _writeMatchFile4(self, fileName):
-        f = open(fileName, "w")
-        f.write("query.name\tquery.start\tquery.end\tquery.length\tquery.length.%\tmatch.length.%\tsubject.name\tsubject.start\tsubject.end\tsubject.length\tsubject.length.%\tE.value\tScore\tIdentity\tpath\n")
-        f.write("header2\t1\t120\t120\t0.674157\t0.674157\tBS31790\t19\t138\t120\t0.674157\t3e-68\t238\t100\t1\n")
-        f.write("header3\t120\t220\t120\t0.99\t0.994157\tBS31790\t19\t138\t120\t0.994157\t3e-65\t238\t100\t1\n")
-        f.write("header4\t1\t120\t120\t1\t0.94157\tBS31790\t19\t138\t120\t0.674157\t3e-67\t244\t90\t1\n")
-        f.close()
-        
-    def _writeExpAlignFile(self,fileName):
-        f = open(fileName, "w")
-        f.write("header2\t1\t120\tBS31790\t19\t138\t3e-68\t238.0\t100.0\n")
-        f.write("header3\t120\t220\tBS31790\t19\t138\t3e-65\t238.0\t100.0\n")
-        f.write("header4\t1\t120\tBS31790\t19\t138\t3e-67\t244.0\t90.0\n")
-        f.close()
-        
-    def _writeMatchFile5(self,fileName):
-        f = open(fileName, "w")
-        f.write("query.name\tquery.start\tquery.end\tquery.length\tquery.length.%\tmatch.length.%\tsubject.name\tsubject.start\tsubject.end\tsubject.length\tsubject.length.%\tE.value\tScore\tIdentity\tpath\n")
-        f.write("header2\t1\t120\t120\t0.674157\t0.674157\tBS31790\t19\t138\t120\t0.674157\t3e-68\t238\t100\t1\n")
-        f.write("header2\t124\t144\t120\t0.674157\t0.674157\tBS31790\t19\t138\t120\t0.674157\t3e-68\t238\t100\t1\n")
-        f.write("header3\t120\t220\t120\t0.99\t0.994157\tBS31790\t19\t138\t120\t0.994157\t3e-65\t238\t100\t1\n")
-        f.write("header4\t1\t120\t120\t1\t0.94157\tBS31790\t19\t138\t120\t0.674157\t3e-67\t244\t90\t1\n")
-        f.close()
-        
-    def _writeExpMatchFile(self,fileName):
-        f = open(fileName, "w")
-        f.write("query.name\tquery.start\tquery.end\tquery.length\tquery.length.%\tmatch.length.%\tsubject.name\tsubject.start\tsubject.end\tsubject.length\tsubject.length.%\tE.value\tScore\tIdentity\tpath\n")
-        f.write("header2\t1\t120\t120\t0.674157\t0.674157\tBS31790\t19\t138\t120\t0.674157\t3e-68\t238\t100.000000\t1\n")
-        f.write("header2\t124\t144\t120\t0.674157\t0.674157\tBS31790\t19\t138\t120\t0.674157\t3e-68\t238\t100.000000\t1\n")
-        f.write("header3\t120\t220\t120\t0.990000\t0.994157\tBS31790\t19\t138\t120\t0.994157\t3e-65\t238\t100.000000\t2\n")
-        f.write("header4\t1\t120\t120\t1.000000\t0.941570\tBS31790\t19\t138\t120\t0.674157\t3e-67\t244\t90.000000\t3\n")
-        f.close()
-    
-
-test_suite = unittest.TestSuite()
-test_suite.addTest( unittest.makeSuite( Test_MatchUtils ) )
-if __name__ == "__main__":
-    unittest.TextTestRunner(verbosity=2).run( test_suite )
--- a/commons/core/coord/test/Test_MergedRange.py	Mon Apr 29 03:26:07 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-import unittest
-from commons.core.coord.MergedRange import MergedRange
-from commons.core.coord.Match import Match
-
-class Test_MergedRange(unittest.TestCase):
-    
-    def test_eq_True(self):
-        mr1 = MergedRange([1], 6, 10)
-        mr2 = MergedRange([1], 6, 10)
-        self.assertEquals(mr1, mr2)
-    
-    def test_eq_different_list(self):
-        mr1 = MergedRange([1], 6, 10)
-        mr2 = MergedRange([1, 2], 6, 10)
-        self.assertNotEquals(mr1, mr2)
-    
-    def test_eq_different_start(self):
-        mr1 = MergedRange([1], 5, 10)
-        mr2 = MergedRange([1], 6, 10)
-        self.assertNotEquals(mr1, mr2)
-    
-    def test_eq_different_end(self):
-        mr1 = MergedRange([1], 6, 10)
-        mr2 = MergedRange([1], 6, 11)
-        self.assertNotEquals(mr1, mr2)
-
-    def test_isOverlapping_no( self ):
-        mr1 = MergedRange([1], 6, 10)
-        mr2 = MergedRange([2], 16, 20)
-        exp = False
-        obs = mr1.isOverlapping( mr2 )
-        self.assertEquals( exp, obs )
-        
-    def test_isOverlapping_yes( self ):
-        mr1 = MergedRange([1], 6, 10)
-        mr2 = MergedRange([2], 5, 20)
-        exp = True
-        obs = mr1.isOverlapping( mr2 )
-        self.assertEquals( exp, obs )
-
-    def test_isOverlapping_range1_before_range2( self ):
-        mr1 = MergedRange([1], 6, 10)
-        mr2 = MergedRange([2], 8, 15)
-        exp = True
-        obs = mr1.isOverlapping( mr2 )
-        self.assertEquals( exp, obs )
-        
-    def test_isOverlapping_range1_after_range2( self ):
-        mr1 = MergedRange([1], 6, 10)
-        mr2 = MergedRange([2], 1, 8)
-        exp = True
-        obs = mr1.isOverlapping( mr2 )
-        self.assertEquals( exp, obs )
-        
-    def test_isOverlapping_range1_equal_range2( self ):
-        mr1 = MergedRange([1], 6, 10)
-        mr2 = MergedRange([2], 6, 10)
-        exp = True
-        obs = mr1.isOverlapping( mr2 )
-        self.assertEquals( exp, obs )
-    
-    def test_merge_mr1_with_mr2(self):
-        otherMergedRange = MergedRange()
-        otherMergedRange._lId.append(3)
-        otherMergedRange._start = 1
-        otherMergedRange._end = 10
-        
-        mr1 = MergedRange()
-        mr1._lId.append(1)
-        mr1._start = 6
-        mr1._end = 10
-        
-        mr2 = MergedRange([2], 1, 15)
-        mr1.merge(mr2)
-        
-        exp = MergedRange([1, 2], 1, 15)
-        self.assertEquals(exp, mr1)
-        
-    def test_merge_mr2_with_mr1(self):
-        mr1 = MergedRange([1], 6, 10)
-        mr2 = MergedRange([2], 1, 15)
-        mr2.merge(mr1)
-        exp = MergedRange([1, 2], 1, 15)
-        self.assertEquals(exp, mr2)
-        
-    def test_setFromMatch(self):
-        tuple = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        iMatch = Match()
-        iMatch.setFromTuple(tuple)
-        
-        expMergedRange = MergedRange([1], 1, 5)
-        obsMergedRange = MergedRange()
-        obsMergedRange.setFromMatch(iMatch)
-        
-        self.assertEquals(expMergedRange, obsMergedRange)
-    
-    def test_getMergedRangeListFromMatchList(self):
-        tuple1 = ("QName", 1, 5, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 1)
-        iMatch1 = Match()
-        iMatch1.setFromTuple(tuple1)
-        tuple2 = ("QName", 10, 15, 5, 0.1, 0.2, "SName", 5, 25, 20, 0.15, 1e-20, 15, 87.2, 2)
-        iMatch2 = Match()
-        iMatch2.setFromTuple(tuple2)
-        lMatch = [iMatch1, iMatch2]
-        
-        explMergedRange = [MergedRange([1], 1, 5), MergedRange([2], 10, 15)]
-        obslMergedRange = MergedRange.getMergedRangeListFromMatchList(lMatch)
-
-        self.assertEquals(explMergedRange, obslMergedRange)
-    
-    def test_getMergedRangeListFromMatchList_empty_list(self):
-        lMatch = []
-        explMergedRange = []
-        obslMergedRange = MergedRange.getMergedRangeListFromMatchList(lMatch)
-
-        self.assertEquals(explMergedRange, obslMergedRange)
-        
-if __name__ == "__main__":
-    unittest.main()
\ No newline at end of file
--- a/commons/core/coord/test/Test_Path.py	Mon Apr 29 03:26:07 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-# Copyright INRA (Institut National de la Recherche Agronomique)
-# http://www.inra.fr
-# http://urgi.versailles.inra.fr
-#
-# This software is governed by the CeCILL license under French law and
-# abiding by the rules of distribution of free software.  You can  use, 
-# modify and/ or redistribute the software under the terms of the CeCILL
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# "http://www.cecill.info". 
-#
-# As a counterpart to the access to the source code and  rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty  and the software's author,  the holder of the
-# economic rights,  and the successive licensors  have only  limited
-# liability. 
-#
-# In this respect, the user's attention is drawn to the risks associated
-# with loading,  using,  modifying and/or developing or reproducing the
-# software by the user in light of its specific status of free software,
-# that may mean  that it is complicated to manipulate,  and  that  also
-# therefore means  that it is reserved for developers  and  experienced
-# professionals having in-depth computer knowledge. Users are therefore
-# encouraged to load and test the software's suitability as regards their
-# requirements in conditions enabling the security of their systems and/or 
-# data to be ensured and,  more generally, to use and operate it in the 
-# same conditions as regards security. 
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL license and that you accept its terms.
-
-
-import unittest
-from commons.core.coord.Path import Path
-from commons.core.coord.Align import Align
-from commons.core.coord.Set import Set
-
-
-class Test_Path( unittest.TestCase ):
-    
-    def setUp( self ):
-        self._path = Path()
-        
-    def test_setFromTuple( self ):
-        line = "1\tchr1\t1\t10\tTE2\t11\t17\t1e-20\t30\t90.2"
-        self._path.setFromTuple( line.split("\t") )
-        self.assertEqual( self._path.id, 1 )
-        self.assertEqual( self._path.range_query.seqname, "chr1" )
-        self.assertEqual( self._path.range_query.start, 1 )
-        self.assertEqual( self._path.range_query.end, 10 )
-        self.assertEqual( self._path.range_subject.seqname, "TE2" )
-        self.assertEqual( self._path.range_subject.start, 11 )
-        self.assertEqual( self._path.range_subject.end, 17 )
-        self.assertEqual( self._path.e_value, float("1e-20") )
-        self.assertEqual( self._path.score, float("30") )
-        self.assertEqual( self._path.identity, float("90.2") )
-        
-    def test___eq__( self ):
-        self._path.setFromString( "1\tchr1\t1\t6\tTE2\t11\t16\t1e-20\t30\t90.2\n" )
-        o = Path()
-        o.setFromString( "1\tchr1\t1\t6\tTE2\t11\t16\t1e-20\t30\t90.2\n" )
-        self.assertEqual( self._path,  o )
-        o.setFromString( "2\tchr1\t1\t6\tTE2\t11\t16\t1e-20\t30\t90.2\n" )
-        self.assertNotEqual( self._path,  o )
-        o.setFromString( "1\tchr1\t1\t6\tTE2\t11\t16\t1e-20\t3000000\t90.2\n" )
-        self.assertNotEqual( self._path,  o )
-        
-    def test_canMerge( self ):
-        tuple = ("1", "chr1","1", "10","TE2","11","17","1e-20","30","90.2")
-        self._path.setFromTuple(tuple)
-        tuple = ("2", "chr1","2", "9","TE2","10","13","1e-20","30","90.2")
-        o = Path()
-        o.setFromTuple(tuple)
-        self.assertTrue(self._path.canMerge(o))
-        
-    def test_canMerge_on_same_id ( self ): 
-        tuple = ("1", "chr1","1", "10","TE2","11","17","1e-20","30","90.2")
-        self._path.setFromTuple(tuple)
-        tuple = ("1", "chr1","2", "9","TE2","10","13","1e-20","30","90.2")
-        o = Path()
-        o.setFromTuple(tuple)
-        self.assertFalse(self._path.canMerge(o))
-        
-    def test_canMerge_on_same_chr( self ):     
-        tuple = ("1", "chr1","1", "10","TE2","11","17","1e-20","30","90.2")
-        self._path.setFromTuple(tuple)
-        tuple = ("2", "chr2","2", "9","TE2","10","13","1e-20","30","90.2")
-        o = Path()
-        o.setFromTuple(tuple)
-        self.assertFalse(self._path.canMerge(o))
-        
-    def test_canMerge_on_diff_subj( self ):      
-        tuple = ("1", "chr1","1", "10","TE2","11","17","1e-20","30","90.2")
-        self._path.setFromTuple(tuple)
-        tuple = ("2", "chr1","2", "9","TE3","10","13","1e-20","30","90.2")
-        o = Path()
-        o.setFromTuple(tuple)
-        self.assertFalse(self._path.canMerge(o)) 
-        
-    def test_canMerge_on_queries_that_do_not_overlap( self ):
-        tuple = ("1", "chr1","5", "11","TE2","11","17","1e-20","30","90.2")
-        self._path.setFromTuple(tuple)
-        tuple = ("2", "chr1","1", "4","TE2","10","13","1e-20","30","90.2")
-        o = Path()
-        o.setFromTuple(tuple)
-        self.assertFalse(self._path.canMerge(o)) 
-        
-    def test_canMerge_on_subjects_that_do_not_overlap( self ):    
-        tuple = ("1", "chr1","1", "10","TE2","11","17","1e-20","30","90.2")
-        self._path.setFromTuple(tuple)
-        tuple = ("2", "chr1","2", "9","TE2","1","10","1e-20","30","90.2")
-        o = Path()
-        o.setFromTuple(tuple)
-        self.assertFalse(self._path.canMerge(o))
-        
-    def test_getSubjectAsSetOfQuery( self ):
-        tuple = ("1","chr1","1","10","TE2","11","17","1e-20","30","90.2")
-        self._path.setFromTuple(tuple)
-        exp = Set(1,"TE2","chr1",1,10)
-        obs = self._path.getSubjectAsSetOfQuery()
-        self.assertEqual( exp, obs )
-        
-    def test_getSubjectAsSetOfQuery_on_neg_strand( self ):
-        tuple = ("1","chr1","10","1","TE2","11","17","1e-20","30","90.2")
-        self._path.setFromTuple(tuple)
-        exp = Set(1,"TE2","chr1",10,1)
-        obs = self._path.getSubjectAsSetOfQuery()
-        self.assertEqual( exp, obs )
-        
-    def test_toString( self ):
-        self._path.setFromString( "1\tchr1\t1\t10\tTE3\t11\t17\t1e-20\t30\t85.2\n" )
-        exp = "1\tchr1\t1\t10\tTE3\t11\t17\t%g\t30\t%f" % ( 1e-20, 85.2 )
-        obs = self._path.toString()
-        self.assertEqual( obs, exp )
-        
-    def test_getAlignInstance( self ):
-        self._path.setFromTuple( ( "2", "chr3", "250", "151", "seq5", "1", "100", "1e-32", "147", "87.9" ) )
-        expAlign = Align()
-        expAlign.setFromTuple( ( "chr3", "151", "250", "seq5", "100", "1", "1e-32", "147", "87.9" ) )
-        obsAlign = self._path.getAlignInstance()
-        self.assertEqual( expAlign, obsAlign )
-        
-        
-test_suite = unittest.TestSuite()
-test_suite.addTest( unittest.makeSuite( Test_Path ) )
-if __name__ == "__main__":
-    unittest.TextTestRunner(verbosity=2).run( test_suite )
--- a/commons/core/coord/test/Test_PathUtils.py	Mon Apr 29 03:26:07 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1667 +0,0 @@
-# Copyright INRA (Institut National de la Recherche Agronomique)
-# http://www.inra.fr
-# http://urgi.versailles.inra.fr
-#
-# This software is governed by the CeCILL license under French law and
-# abiding by the rules of distribution of free software.  You can  use, 
-# modify and/ or redistribute the software under the terms of the CeCILL
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# "http://www.cecill.info". 
-#
-# As a counterpart to the access to the source code and  rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty  and the software's author,  the holder of the
-# economic rights,  and the successive licensors  have only  limited
-# liability. 
-#
-# In this respect, the user's attention is drawn to the risks associated
-# with loading,  using,  modifying and/or developing or reproducing the
-# software by the user in light of its specific status of free software,
-# that may mean  that it is complicated to manipulate,  and  that  also
-# therefore means  that it is reserved for developers  and  experienced
-# professionals having in-depth computer knowledge. Users are therefore
-# encouraged to load and test the software's suitability as regards their
-# requirements in conditions enabling the security of their systems and/or 
-# data to be ensured and,  more generally, to use and operate it in the 
-# same conditions as regards security. 
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL license and that you accept its terms.
-
-
-import unittest
-import os
-import time
-from commons.core.coord.PathUtils import PathUtils
-from commons.core.coord.Path import Path
-from commons.core.coord.Set import Set
-from commons.core.utils.FileUtils import FileUtils
-from commons.core.coord.Range import Range
-from commons.core.coord.Align import Align
-
-
-class Test_PathUtils ( unittest.TestCase ):
-
-    def test_getSetListFromQueries( self ):
-        set1 = Set(1,"TE2","chr1",1,10)
-        set2 = Set(1,"TE2","chr1",10,1)
-        set3 = Set(1,"TE3","chr4",12,22)
-    
-        expList = [set1, set2, set3]
-
-        tuple1 = ("1","chr1","1","10","TE2","11","17","1e-20","30","90.2")
-        tuple2 = ("1","chr1","10","1","TE2","11","17","1e-20","30","90.2")
-        tuple3 = ("1","chr4","12","22","TE3","11","17","1e-20","30","90.2")
-
-        pathList = self._makePathListFromTupleList( [ tuple1, tuple2, tuple3 ] )
-
-        obsList = PathUtils.getSetListFromQueries( pathList )
-
-        self.assertEquals( expList, obsList )
-        
-    
-    def test_getSetListFromQueries_on_empty_list( self ):
-        expList = []
-        obsList = PathUtils.getSetListFromQueries( [] )
-
-        self.assertEquals( expList, obsList )
-        
-        
-    def test_getSetListFromQueries_on_list_size1( self ):
-        set1 = Set(1,"TE2","chr1",1,10)
-        
-        expList = [set1]
-        
-        tuple1 = ("1","chr1","1","10","TE2","11","17","1e-20","30","90.2")
-        path1 = Path()
-        path1.setFromTuple(tuple1)
-        
-        pathList = [path1]
-        obsList = PathUtils.getSetListFromQueries( pathList )
-        
-        self.assertEquals( expList, obsList )
-        
-        
-    def test_getRangeListFromSubjects_initiallyOrdered_directStrand( self ):
-        tuple1 = ("1","chr1","1","10","TE2","1","10","1e-20","30","90.2")
-        tuple2 = ("1","chr1","21","30","TE2","11","20","1e-20","30","90.2")
-        tuple3 = ("1","chr1","41","50","TE2","21","30","1e-20","30","90.2")
-        lPaths = self._makePathListFromTupleList( [ tuple1, tuple2, tuple3 ] )
-        
-        iSet1 = Range( "TE2", 1, 10 )
-        iSet2 = Range( "TE2", 11, 20 )
-        iSet3 = Range( "TE2", 21, 30 )
-        lExp = [ iSet1, iSet2, iSet3 ]
-        
-        lObs = PathUtils.getRangeListFromSubjects( lPaths )
-        
-        self.assertEquals( lExp, lObs )
-        
-        
-    def test_getRangeListFromSubjects_initiallyUnordered_directStrand( self ):
-        tuple1 = ("1","chr1","1","10","TE2","1","10","1e-20","30","90.2")
-        tuple2 = ("1","chr1","41","50","TE2","21","30","1e-20","30","90.2")
-        tuple3 = ("1","chr1","21","30","TE2","11","20","1e-20","30","90.2")
-        lPaths = self._makePathListFromTupleList( [ tuple1, tuple2, tuple3 ] )
-        
-        iSet1 = Range( "TE2", 1, 10 )
-        iSet2 = Range( "TE2", 11, 20 )
-        iSet3 = Range( "TE2", 21, 30 )
-        lExp = [ iSet1, iSet2, iSet3 ]
-        
-        lObs = PathUtils.getRangeListFromSubjects( lPaths )
-        
-        self.assertEquals( lExp, lObs )
-        
-        
-    def test_getRangeListFromSubjects_initiallyUnordered_reverseStrand( self ):
-        tuple1 = ("1","chr1","1","10","TE2","10","1","1e-20","30","90.2")
-        tuple2 = ("1","chr1","41","50","TE2","30","21","1e-20","30","90.2")
-        tuple3 = ("1","chr1","21","30","TE2","20","11","1e-20","30","90.2")
-        lPaths = self._makePathListFromTupleList( [ tuple1, tuple2, tuple3 ] )
-        
-        iSet3 = Range( "TE2", 30, 21 )
-        iSet2 = Range( "TE2", 20, 11 )
-        iSet1 = Range( "TE2", 10, 1 )
-        lExp = [ iSet1, iSet2, iSet3 ]
-        
-        lObs = PathUtils.getRangeListFromSubjects( lPaths )
-        
-        self.assertEquals( lExp, lObs )
-        
-        
-    def test_getQueryMinMaxFromPathList( self ):
-        tuple1 = ("1","chr1","1","10","TE2","11","17","1e-20","30","90.2")
-        tuple2 = ("1","chr1","10","1","TE2","11","17","1e-20","30","90.2")
-        tuple3 = ("1","chr4","12","22","TE3","11","17","1e-20","30","90.2")
-        
-        pathList = self._makePathListFromTupleList([tuple1, tuple2, tuple3])
-        
-        obsTuple = PathUtils.getQueryMinMaxFromPathList( pathList )
-        expTuple = (1,22) 
-        
-        self.assertEquals(expTuple, obsTuple)
-        
-    def test_getQueryMinMaxFromPathList_on_empty_list( self ):
-        obsTuple = PathUtils.getQueryMinMaxFromPathList( [] )
-        expTuple = (-1,-1)
-        self.assertEquals( expTuple, obsTuple )
-        
-    def test_getQueryMinMaxFromPathList_on_list_size1( self ):
-        tuple1 = ("1","chr1","1","10","TE2","11","17","1e-20","30","90.2")
-        path1 = Path()
-        path1.setFromTuple(tuple1)
-        
-        pathList = [path1]
-        obsTuple = PathUtils.getQueryMinMaxFromPathList( pathList )
-        
-        expTuple = (1,10) 
-        
-        self.assertEquals(expTuple, obsTuple)
-        
-    def test_getSubjectMinMaxFromPathList( self ):
-        tuple1 = ("1","chr1","1","10","TE2","11","17","1e-20","30","90.2")
-        tuple2 = ("1","chr1","10","1","TE2","17","11","1e-20","30","90.2")
-        tuple3 = ("1","chr4","12","22","TE3","22","34","1e-20","30","90.2")
-        
-        pathList = self._makePathListFromTupleList([tuple1, tuple2, tuple3])
-        obsTuple = PathUtils.getSubjectMinMaxFromPathList(pathList)
-        
-        expTuple = (11,34) 
-        
-        self.assertEquals(expTuple, obsTuple)
-        
-    def test_getSubjectMinMaxFromPathList_on_empty_list( self ):
-        obsTuple = PathUtils.getSubjectMinMaxFromPathList([])
-        expTuple = (-1,-1)
-        self.assertEquals(expTuple, obsTuple)
-        
-    def test_getSubjectMinMaxFromPathList_on_list_size1( self ):
-        tuple1 = ("1","chr1","1","10","TE2","11","17","1e-20","30","90.2")
-        path1 = Path()
-        path1.setFromTuple(tuple1)
-        
-        pathList = [path1]
-        obsTuple = PathUtils.getSubjectMinMaxFromPathList(pathList)
-        
-        expTuple = (11,17) 
-        
-        self.assertEquals(expTuple, obsTuple)
-        
-    def test_areQueriesOverlappingBetweenPathLists_list2_empty( self ):
-        tuple1 = ("1","chr1","100","110","TE2","15","10","1e-20","30","90.2")
-        tuple2 = ("1","chr1","200","220","TE2","15","10","1e-20","30","90.2")
-        tuple3 = ("1","chr1","300","330","TE2","15","10","1e-20","30","90.2")
-        pathList1 = self._makePathListFromTupleList([tuple1, tuple2, tuple3])
-        
-        pathList2 = []
-        
-        expRes = False
-        obsRes = PathUtils.areQueriesOverlappingBetweenPathLists( pathList1, pathList2 )
-        
-        self.assertEquals( expRes, obsRes )
-        
-    def test_areQueriesOverlappingBetweenPathLists_list2_size1( self ):
-        tuple1 = ("1","chr1","9","11","TE2","150","200","1e-20","30","90.2")
-        tuple2 = ("1","chr1","20","22","TE2","150","200","1e-20","30","90.2")
-        tuple3 = ("1","chr1","30","33","TE2","150","200","1e-20","30","90.2")
-        pathList1 = self._makePathListFromTupleList( [ tuple1, tuple2, tuple3 ] )
-        
-        tuple11 = ("1","chr1","8","11","TE2","150","200","1e-20","30","90.2")
-        pathList2 = self._makePathListFromTupleList( [ tuple11 ] )
-        
-        expRes = True
-        obsRes = PathUtils.areQueriesOverlappingBetweenPathLists( pathList1, pathList2 )
-        
-        self.assertEquals( expRes, obsRes )
-        
-    def test_areQueriesOverlappingBetweenPathLists_list1_greater_list2( self ):
-        tuple1 = ("1","chr1","100","110","TE2","15","10","1e-20","30","90.2")
-        tuple2 = ("1","chr1","200","220","TE2","15","10","1e-20","30","90.2")
-        tuple3 = ("1","chr1","300","330","TE2","15","10","1e-20","30","90.2")
-        pathList1 = self._makePathListFromTupleList( [ tuple1, tuple2, tuple3 ] )
-        
-        tuple11 = ("1","chr1","10","11","TE2","150","200","1e-20","30","90.2")
-        tuple22 = ("1","chr1","20","22","TE2","150","200","1e-20","30","90.2")
-        tuple33 = ("1","chr1","30","33","TE2","150","200","1e-20","30","90.2")
-        pathList2 = self._makePathListFromTupleList( [ tuple11, tuple22, tuple33 ] )
-        
-        expRes = False
-        obsRes = PathUtils.areQueriesOverlappingBetweenPathLists( pathList1, pathList2 )
-        
-        self.assertEquals( expRes, obsRes )
-        
-    def test_areQueriesOverlappingBetweenPathLists_unordered_first_item_of_list1_greater_second_item_smaller( self ):
-        tuple1 = ("1","chr1","400","440","TE2","15","10","1e-20","30","90.2")
-        tuple2 = ("1","chr1","1","11","TE2","15","10","1e-20","30","90.2")
-        pathList1 = self._makePathListFromTupleList( [ tuple1, tuple2 ] )
-        
-        tuple11 = ("1","chr1","15","17","TE2","150","200","1e-20","30","90.2")
-        tuple22 = ("1","chr1","20","22","TE2","150","200","1e-20","30","90.2")
-        tuple33 = ("1","chr1","30","33","TE2","150","200","1e-20","30","90.2")
-        pathList2 = self._makePathListFromTupleList( [ tuple11, tuple22, tuple33 ] )
-        
-        expRes = False
-        obsRes = PathUtils.areQueriesOverlappingBetweenPathLists( pathList1, pathList2 )
-        
-        self.assertEquals( expRes, obsRes )
-        
-    def test_areQueriesOverlappingBetweenPathLists_unorderd_second_item_of_list1_overlap_first_item( self ):
-        tuple1 = ("1","chr1","400","440","TE2","15","10","1e-20","30","90.2")
-        tuple2 = ("1","chr1","1","18","TE2","15","10","1e-20","30","90.2")
-        pathList1 = self._makePathListFromTupleList( [ tuple1, tuple2 ] )
-        
-        tuple11 = ("1","chr1","15","17","TE2","150","200","1e-20","30","90.2")
-        tuple22 = ("1","chr1","20","22","TE2","150","200","1e-20","30","90.2")
-        tuple33 = ("1","chr1","30","33","TE2","150","200","1e-20","30","90.2")
-        pathList2 = self._makePathListFromTupleList( [ tuple11, tuple22, tuple33 ] )
-        
-        expRes = True
-        obsRes = PathUtils.areQueriesOverlappingBetweenPathLists( pathList1, pathList2 )
-        
-        self.assertEquals( expRes, obsRes )
-        
-    def test_areQueriesOverlappingBetweenPathLists_last_item_list1_overlap_last_item_list2( self ):
-        tuple1 = ("1","chr1","400","440","TE2","15","10","1e-20","30","90.2")
-        tuple2 = ("1","chr1","320","340","TE2","15","10","1e-20","30","90.2")
-        pathList1 = self._makePathListFromTupleList( [ tuple1, tuple2 ] )
-        
-        tuple11 = ("1","chr1","100","110","TE2","150","200","1e-20","30","90.2")
-        tuple22 = ("1","chr1","200","220","TE2","150","200","1e-20","30","90.2")
-        tuple33 = ("1","chr1","300","330","TE2","150","200","1e-20","30","90.2")
-        pathList2 = self._makePathListFromTupleList( [ tuple11, tuple22, tuple33 ] )
-        
-        expRes = True
-        obsRes = PathUtils.areQueriesOverlappingBetweenPathLists( pathList1, pathList2 )
-        
-        self.assertEquals( expRes, obsRes )
-        
-    def test_writeListInFile( self ):
-        line1 = ("1\tchr1\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.200000\n")
-        line2 = ("1\tchr1\t200\t220\tTE2\t150\t200\t1e-20\t30\t90.200000\n")
-        line3 = ("1\tchr1\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.200000\n")
-        
-        expFileName = "expFileName.path"
-        expFileHandle = open ( expFileName, 'w' )
-        expFileHandle.write(line1)
-        expFileHandle.write(line2)
-        expFileHandle.write(line3)
-        expFileHandle.close()
-        
-        line1 = ("1\tchr1\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        line2 = ("1\tchr1\t200\t220\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        line3 = ("1\tchr1\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        
-        obsFileName = "obsFileName.path"
-        obsPathList = self._makePathListFromStringList( [ line1, line2, line3 ] )
-        
-        PathUtils.writeListInFile( obsPathList, obsFileName )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFileName, obsFileName ) )
-        
-        os.remove( obsFileName )
-        os.remove( expFileName )
-
-    def test_writeListInFile_in_append_mode( self ):
-        line1 = ("1\tchr1\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.200000\n")
-        line2 = ("1\tchr1\t200\t220\tTE2\t150\t200\t1e-20\t30\t90.200000\n")
-        line3 = ("1\tchr1\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.200000\n")
-        line4 = ("1\tchr1\t400\t410\tTE2\t150\t200\t1e-20\t30\t90.200000\n")
-        line5 = ("1\tchr1\t500\t520\tTE2\t150\t200\t1e-20\t30\t90.200000\n")
-        line6 = ("1\tchr1\t600\t630\tTE2\t150\t200\t1e-20\t30\t90.200000\n")
-        
-        expFileName = "expFileName.path"
-        expFileHandle = open ( expFileName, 'w' )
-        expFileHandle.write(line1)
-        expFileHandle.write(line2)
-        expFileHandle.write(line3)
-        expFileHandle.write(line4)
-        expFileHandle.write(line5)
-        expFileHandle.write(line6)
-        expFileHandle.close()
-        
-        line1 = ("1\tchr1\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.200000\n")
-        line2 = ("1\tchr1\t200\t220\tTE2\t150\t200\t1e-20\t30\t90.200000\n")
-        line3 = ("1\tchr1\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.200000\n")
-        line4 = ("1\tchr1\t400\t410\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        line5 = ("1\tchr1\t500\t520\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        line6 = ("1\tchr1\t600\t630\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        
-        obsFileName = "obsFileName.path"
-        obsFileHandle = open( obsFileName, 'w' )
-        obsFileHandle.write(line1)
-        obsFileHandle.write(line2)
-        obsFileHandle.write(line3)
-        obsFileHandle.close()
-      
-        obsPathList = self._makePathListFromStringList( [ line4, line5, line6 ] )
-
-        PathUtils.writeListInFile( obsPathList, obsFileName, "a" )
-
-        self.assertTrue( FileUtils.are2FilesIdentical( expFileName, obsFileName ) )
-
-        os.remove(obsFileName)
-        os.remove(expFileName)
-
-    def test_getPathListWithoutDuplicates_empty_list( self ):
-        pathList = []
-        obsPathList = PathUtils.getPathListWithoutDuplicates( pathList )
-        
-        expPathList = []
-        
-        self.assertEquals( expPathList, obsPathList )
-        
-    def test_getPathListWithoutDuplicates_list_size1( self ):
-        line1 = ("1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathList = self._makePathListFromStringList([line1])
-        
-        obsPathList = PathUtils.getPathListWithoutDuplicates( pathList )
-        
-        expPathList = pathList
-        
-        self.assertEquals( expPathList, obsPathList )
-        
-    def test_getPathListWithoutDuplicates_list_with_only_doublons( self ):
-        line1 = ("1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line2 = ("1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line3 = ("1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line4 = ("1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathList = self._makePathListFromStringList( [ line1, line2, line3, line4 ] )
-        
-        obsPathList = PathUtils.getPathListWithoutDuplicates( pathList )
-        
-        expPathList = self._makePathListFromStringList( [ line1 ] )
-        
-        self.assertEquals( expPathList, obsPathList )
-        
-    def test_getPathListWithoutDuplicates_list_with_doublons_at_start_and_at_end( self ):
-        line1 = ("1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line2 = ("1\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line3 = ("1\tchr1\t300\t310\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line4 = ("1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathList = self._makePathListFromStringList( [ line1, line2, line3, line4 ] )
-        
-        obsPathList = PathUtils.getPathListWithoutDuplicates( pathList )
-        
-        expPathList = self._makePathListFromStringList( [ line1, line2, line3 ] )
-        expPathList = PathUtils.getPathListSortedByIncreasingMinQueryThenMaxQuery( expPathList )
-        
-        self.assertEquals( expPathList, obsPathList )
-        
-    def test_getPathListWithoutDuplicates_list_with_contiguus_doublons( self ):
-        line1 = ("1\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line2 = ("1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line3 = ("1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line4 = ("1\tchr1\t300\t310\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathList = self._makePathListFromStringList( [ line1, line2, line3, line4 ] )
-        
-        obsPathList = PathUtils.getPathListWithoutDuplicates( pathList )
-        
-        expPathList = self._makePathListFromStringList( [ line1, line2, line4 ] )
-        expPathList = PathUtils.getPathListSortedByIncreasingMinQueryThenMaxQuery( expPathList )
-        
-        self.assertEquals( expPathList, obsPathList )
-        
-    def test_getPathListWithoutDuplicates_list_with_one_doublon( self ):
-        line1 = ("1\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line2 = ("1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line3 = ("1\tchr1\t210\t250\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line4 = ("1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line5 = ("1\tchr1\t300\t310\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathList = self._makePathListFromStringList( [ line1, line2, line3, line4, line5 ] )
-        
-        obsPathList = PathUtils.getPathListWithoutDuplicates( pathList )
-        
-        expPathList = self._makePathListFromStringList( [ line1, line2, line3, line5 ] )
-        expPathList = PathUtils.getPathListSortedByIncreasingMinQueryThenMaxQuery( expPathList )
-        
-        self.assertEquals( expPathList, obsPathList )
-        
-    def test_getPathListWithoutDuplicates_list_with_two_doublons( self ):
-        line1 = ("1\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line2 = ("1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line3 = ("1\tchr1\t210\t250\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line4 = ("1\tchr1\t230\t250\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line5 = ("1\tchr1\t210\t250\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line6 = ("1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line7 = ("1\tchr1\t300\t310\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathList = self._makePathListFromStringList( [ line1, line2, line3, line4, line5, line6, line7 ] )
-        
-        obsPathList = PathUtils.getPathListWithoutDuplicates( pathList )
-        
-        expPathList = self._makePathListFromStringList( [ line1, line2, line3, line4, line7 ] )
-        expPathList = PathUtils.getPathListSortedByIncreasingMinQueryThenMaxQuery( expPathList )
-        
-        self.assertEquals( expPathList, obsPathList )
-        
-    def test_getPathListWithoutDuplicates_list_with_two_doublons_useOnlyCoord_is_False_different_id( self ):
-        line1 = ("1\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line2 = ("2\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line3 = ("3\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line4 = ("4\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line5 = ("1\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line6 = ("1\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line7 = ("5\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathList = self._makePathListFromStringList( [ line1, line2, line3, line4, line5, line6, line7 ] )
-        
-        obsPathList = PathUtils.getPathListWithoutDuplicates( pathList )
-        
-        expPathList = self._makePathListFromStringList( [ line1, line2, line3, line4, line7 ] )
-        expPathList = PathUtils.getPathListSortedByIncreasingMinQueryThenMaxQuery( expPathList )
-        
-        self.assertEquals( expPathList, obsPathList )
-        
-    def test_getPathListWithoutDuplicates_list_with_two_doublons_useOnlyCoord_is_True_different_id( self ):
-        line1 = ("1\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line2 = ("2\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line3 = ("3\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line4 = ("4\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line5 = ("1\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line6 = ("1\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line7 = ("5\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathList = self._makePathListFromStringList( [ line1, line2, line3, line4, line5, line6, line7 ] )
-        
-        obsPathList = PathUtils.getPathListWithoutDuplicates( pathList, True )
-        
-        expPathList = self._makePathListFromStringList( [ line1 ] )
-        expPathList = PathUtils.getPathListSortedByIncreasingMinQueryThenMaxQuery( expPathList )
-        
-        self.assertEquals( expPathList, obsPathList )
-        
-    def test_path_getDictOfListsWithIdAsKey_empty_list( self ):
-        pathList = []
-      
-        obsDict = PathUtils.getDictOfListsWithIdAsKey( pathList )
-        expDict = {}
-      
-        self.assertEquals( expDict, obsDict )
-        
-    def test_path_getDictOfListsWithIdAsKey_list_size1( self ):
-        line1 = ( "1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n" )
-        pathList = self._makePathListFromStringList( [ line1 ] )
-        
-        obsDict = PathUtils.getDictOfListsWithIdAsKey( pathList )
-        
-        expPathInstance = Path()
-        expPathInstance.setFromString( line1 )
-        expDict = { 1: [ expPathInstance ] }
-        
-        self.assertEquals( expDict, obsDict )
-        
-    def test_getDictOfListsWithIdAsKey_ids_only_once( self ):
-        line1 = ( "1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n" )
-        line2 = ( "2\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n" )
-        line3 = ( "3\tchr1\t210\t250\tTE2\t150\t200\t0.000000\t30\t90.200000\n" ) 
-        
-        pathList = self._makePathListFromStringList( [ line1, line2, line3 ] )
-        
-        obsDict = PathUtils.getDictOfListsWithIdAsKey( pathList )
-        
-        expPathInstance1 = Path()
-        expPathInstance1.setFromString( line1 )
-        
-        expPathInstance2 = Path()
-        expPathInstance2.setFromString( line2 )
-        
-        expPathInstance3 = Path()
-        expPathInstance3.setFromString( line3 )
-        
-        expDict = { 1: [ expPathInstance1 ], 2: [ expPathInstance2 ], 3: [ expPathInstance3 ] }
-        
-        self.assertEquals( expDict, obsDict )
-        
-    def test_getDictOfListsWithIdAsKey_ids_more_than_only_once( self ):
-        line1 = ( "1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n" )
-        line2 = ( "2\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n" )
-        line3 = ( "3\tchr1\t210\t250\tTE2\t150\t200\t0.000000\t30\t90.200000\n" )
-        
-        line4 = ( "1\tchr1\t100\t120\tTE2\t150\t200\t0.000000\t30\t90.200000\n" ) 
-        line5 = ( "2\tchr1\t200\t220\tTE2\t150\t200\t0.000000\t30\t90.200000\n" )
-        line6 = ( "3\tchr1\t210\t260\tTE2\t150\t200\t0.000000\t30\t90.200000\n" )
-        
-        line7 = ( "1\tchr1\t110\t120\tTE2\t150\t200\t0.000000\t30\t90.200000\n" )
-        line8 = ( "2\tchr1\t210\t220\tTE2\t150\t200\t0.000000\t30\t90.200000\n" )
-        line9 = ( "3\tchr1\t220\t260\tTE2\t150\t200\t0.000000\t30\t90.200000\n" )
-        
-        pathList = self._makePathListFromStringList( [ line1, line2, line3, line4, line5, line6, line7, line8, line9 ] )
-        
-        obsDict = PathUtils.getDictOfListsWithIdAsKey( pathList )
-        
-        expPathInstance1 = Path()
-        expPathInstance1.setFromString( line1 )
-        
-        expPathInstance2 = Path()
-        expPathInstance2.setFromString( line2 )
-        
-        expPathInstance3 = Path()
-        expPathInstance3.setFromString( line3 )
-        
-        expPathInstance4 = Path()
-        expPathInstance4.setFromString( line4 )
-        
-        expPathInstance5 = Path()
-        expPathInstance5.setFromString( line5 )
-        
-        expPathInstance6 = Path()
-        expPathInstance6.setFromString( line6 )
-        
-        expPathInstance7 = Path()
-        expPathInstance7.setFromString( line7 )
-        
-        expPathInstance8 = Path()
-        expPathInstance8.setFromString( line8 )
-        
-        expPathInstance9 = Path()
-        expPathInstance9.setFromString( line9 )
-        
-        expDict = { 1: [ expPathInstance1, expPathInstance4, expPathInstance7 ], 2 :[ expPathInstance2, expPathInstance5, expPathInstance8 ], 3: [ expPathInstance3, expPathInstance6, expPathInstance9 ] }
-        
-        self.assertEquals( expDict, obsDict )
-        
-    def test_getPathListUnjoinedBasedOnQuery_listToKeep_empty_listToUnjoin_empty( self ):
-        pathListToKeep = []
-        pathListToUnjoin = []
-        
-        expList = []
-        
-        obsList = PathUtils.getPathListUnjoinedBasedOnQuery( pathListToKeep, pathListToUnjoin )
-        
-        self.assertEquals( expList, obsList )
-        
-    def test_getPathListUnjoinedBasedOnQuery_listToKeep_empty_listToUnjoin_size1( self ):
-        pathListToKeep = []
-        
-        line1 = ("1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathListToUnjoin = self._makePathListFromStringList( [ line1 ] ) 
-        
-        expList = [ pathListToUnjoin ]
-        
-        obsList = PathUtils.getPathListUnjoinedBasedOnQuery( pathListToKeep, pathListToUnjoin )
-        
-        self.assertEquals( expList, obsList )
-        
-    def test_getPathListUnjoinedBasedOnQuery_listToKeep_size1_listToUnjoin_empty( self ):
-        lineKeep1 = ("1\tchr1\t1\t11\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathListToKeep = self._makePathListFromStringList( [ lineKeep1 ] )
-        
-        pathListToUnjoin = []
-        
-        expList = []
-        
-        obsList = PathUtils.getPathListUnjoinedBasedOnQuery( pathListToKeep, pathListToUnjoin )
-        
-        self.assertEquals( expList, obsList )
-        
-    def test_getPathListUnjoinedBasedOnQuery_listToKeep_empty( self ):
-        pathListToKeep = []
-        
-        line1 = ("1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line2 = ("1\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line3 = ("1\tchr1\t250\t280\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathListToUnjoin = self._makePathListFromStringList( [ line1, line2, line3 ] )
-        
-        expList = [ pathListToUnjoin ]
-        
-        obsList = PathUtils.getPathListUnjoinedBasedOnQuery( pathListToKeep, pathListToUnjoin )
-        
-        self.assertEquals( expList, obsList )
-        
-    def test_getPathListUnjoinedBasedOnQuery_listToKeep_size1_listToUnjoin_size1( self ):
-        lineKeep1 = ("1\tchr1\t1\t11\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathListToKeep = self._makePathListFromStringList( [ lineKeep1 ] )
-        
-        lineUnjoin1 = ("1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathListToUnjoin = self._makePathListFromStringList( [ lineUnjoin1 ] )
-        
-        expList = [ pathListToUnjoin ]
-        
-        obsList = PathUtils.getPathListUnjoinedBasedOnQuery( pathListToKeep, pathListToUnjoin )
-        
-        self.assertEquals( expList, obsList )
-        
-    def test_getPathListUnjoinedBasedOnQuery_listToKeep_size1_listToUnjoin_size2_noSplit_minKeep( self ):
-        lineKeep1 = ("1\tchr1\t1\t10\tTE2\t150\t90\t0.000000\t30\t90.200000\n")
-        pathListToKeep = self._makePathListFromStringList( [ lineKeep1 ] )
-        
-        lineUnjoin1 = ("1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        lineUnjoin2 = ("1\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathListToUnjoin = self._makePathListFromStringList( [ lineUnjoin1, lineUnjoin2 ] )
-        
-        expList = [ pathListToUnjoin ]
-        
-        obsList = PathUtils.getPathListUnjoinedBasedOnQuery( pathListToKeep, pathListToUnjoin )
-        
-        self.assertEquals( expList, obsList )
-        
-    def test_getPathListUnjoinedBasedOnQuery_listToKeep_size1_listToUnjoin_size3_noSplit_minKeep( self ):
-        lineKeep1 = ("1\tchr1\t1\t10\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathListToKeep = self._makePathListFromStringList( [ lineKeep1 ] )
-        
-        lineUnjoin1 = ("1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        lineUnjoin2 = ("1\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        lineUnjoin3 = ("1\tchr1\t250\t280\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathListToUnjoin = self._makePathListFromStringList( [ lineUnjoin1, lineUnjoin2, lineUnjoin3 ] )
-        
-        obsList = PathUtils.getPathListUnjoinedBasedOnQuery( pathListToKeep, pathListToUnjoin )
-        
-        expList = [ pathListToUnjoin ]
-        
-        self.assertEquals( expList, obsList )
-        
-    def test_getPathListUnjoinedBasedOnQuery_listToKeep_size1_listToUnjoin_size2_noSplit_minUnjoin( self ):
-        lineKeep1 = ("1\tchr1\t101\t150\tTE2\t150\t90\t0.000000\t30\t90.200000\n")
-        pathListToKeep = self._makePathListFromStringList( [ lineKeep1 ] )
-        
-        lineUnjoin1 = ("1\tchr1\t1\t10\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        lineUnjoin2 = ("1\tchr1\t21\t40\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathListToUnjoin = self._makePathListFromStringList( [ lineUnjoin1, lineUnjoin2 ] )
-        
-        expList = [ pathListToUnjoin ]
-        
-        obsList = PathUtils.getPathListUnjoinedBasedOnQuery( pathListToKeep, pathListToUnjoin )
-        
-        self.assertEquals( expList, obsList )
-        
-    def test_getPathListUnjoinedBasedOnQuery_listToKeep_size3_listToUnjoin_size2_oneSplit_minKeep( self ):
-        lineKeep1 = ("1\tchr1\t1\t10\tTE2\t150\t90\t0.000000\t30\t90.200000\n")
-        lineKeep2 = ("1\tchr1\t21\t30\tTE2\t150\t90\t0.000000\t30\t90.200000\n")
-        lineKeep3 = ("1\tchr1\t61\t70\tTE2\t150\t90\t0.000000\t30\t90.200000\n")
-        pathListToKeep = self._makePathListFromStringList( [ lineKeep1, lineKeep2, lineKeep3 ] )
-        
-        lineUnjoin1 = ("1\tchr1\t41\t50\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        lineUnjoin2 = ("1\tchr1\t81\t90\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathListToUnjoin = self._makePathListFromStringList( [ lineUnjoin1, lineUnjoin2 ] )
-        
-        expList = []
-        expList.append( self._makePathListFromStringList( [ lineUnjoin1 ] ) )
-        expList.append( self._makePathListFromStringList( [ lineUnjoin2 ] ) )
-        
-        obsList = PathUtils.getPathListUnjoinedBasedOnQuery( pathListToKeep, pathListToUnjoin )
-        
-        self.assertEquals( expList, obsList )
-        
-    def test_getPathListUnjoinedBasedOnQuery_listToKeep_size3_listToUnjoin_size3_twoSplits_minUnjoin( self ):
-        lineKeep1 = ("1\tchr1\t21\t30\tTE2\t150\t90\t0.000000\t30\t90.200000\n")
-        lineKeep2 = ("1\tchr1\t41\t50\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        lineKeep3 = ("1\tchr1\t81\t90\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathListToKeep = self._makePathListFromStringList( [ lineKeep1, lineKeep2, lineKeep3 ] )
-        
-        lineUnjoin1 = ("1\tchr1\t1\t10\tTE2\t150\t90\t0.000000\t30\t90.200000\n")
-        lineUnjoin2 = ("1\tchr1\t61\t70\tTE2\t150\t90\t0.000000\t30\t90.200000\n")
-        lineUnjoin3 = ("1\tchr1\t101\t110\tTE2\t150\t90\t0.000000\t30\t90.200000\n")
-        pathListToUnjoin = self._makePathListFromStringList( [ lineUnjoin1, lineUnjoin2, lineUnjoin3 ] )
-        
-        expList = []
-        expList.append( self._makePathListFromStringList( [ lineUnjoin1 ] ) )
-        expList.append( self._makePathListFromStringList( [ lineUnjoin2 ] ) )
-        expList.append( self._makePathListFromStringList( [ lineUnjoin3 ] ) )
-        
-        obsList = PathUtils.getPathListUnjoinedBasedOnQuery( pathListToKeep, pathListToUnjoin )
-        
-        self.assertEquals( expList, obsList )
-        
-    def test_getPathListUnjoinedBasedOnQuery_listToKeep_size1_listToUnjoin_size2_split( self ):
-        lineKeep1 = ("1\tchr1\t51\t80\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathListToKeep = self._makePathListFromStringList( [ lineKeep1 ] )
-        
-        lineUnjoin1 = ("1\tchr1\t21\t40\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        lineUnjoin2 = ("1\tchr1\t101\t150\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathListToUnjoin = self._makePathListFromStringList( [ lineUnjoin1, lineUnjoin2 ] )
-        
-        expList = []
-        expList.append( self._makePathListFromStringList( [ lineUnjoin1 ] ) )
-        expList.append( self._makePathListFromStringList( [ lineUnjoin2 ] ) )
-        
-        obsList = PathUtils.getPathListUnjoinedBasedOnQuery( pathListToKeep, pathListToUnjoin )
-        
-        self.assertEquals( expList, obsList )
-        
-    def test_getPathListUnjoinedBasedOnQuery_listToKeep_size2_listToUnjoin_size2_split( self ):
-        lineKeep1 = ("1\tchr1\t1\t15\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        lineKeep2 = ("1\tchr1\t81\t130\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathListToKeep = self._makePathListFromStringList( [ lineKeep1, lineKeep2 ] )
-        
-        lineUnjoin1 = ("1\tchr1\t21\t40\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        lineUnjoin2 = ("1\tchr1\t201\t250\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathListToUnjoin = self._makePathListFromStringList( [ lineUnjoin1, lineUnjoin2 ] )
-        
-        expList = []
-        expList.append( self._makePathListFromStringList( [ lineUnjoin1 ] ) )
-        expList.append( self._makePathListFromStringList( [ lineUnjoin2 ] ) )
-        
-        obsList = PathUtils.getPathListUnjoinedBasedOnQuery( pathListToKeep, pathListToUnjoin )
-        
-        self.assertEquals( expList, obsList )
-        
-    def test_getPathListUnjoinedBasedOnQuery_listToKeep_size1_listToUnjoin_ordered_OneSplit( self ):
-        lineKeep1 = ("1\tchr1\t120\t180\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathListToKeep = self._makePathListFromStringList( [ lineKeep1 ] )
-        
-        lineUnjoin1 = ("1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        lineUnjoin2 = ("1\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        lineUnjoin3 = ("1\tchr1\t250\t280\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathListToUnjoin = self._makePathListFromStringList( [ lineUnjoin1, lineUnjoin2, lineUnjoin3 ] )
-        
-        expList = []
-        expList.append( self._makePathListFromStringList( [ lineUnjoin1 ] ) )
-        expList.append( self._makePathListFromStringList( [ lineUnjoin2, lineUnjoin3 ] ) )
-        
-        obsList = PathUtils.getPathListUnjoinedBasedOnQuery( pathListToKeep, pathListToUnjoin )
-        
-        self.assertEquals( expList, obsList )
-        
-    def test_getPathListUnjoinedBasedOnQuery_listToKeep_size1_listToUnjoin_unordered_OneSplit( self ):
-        lineKeep1 = ("1\tchr1\t120\t180\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathListToKeep = self._makePathListFromStringList( [ lineKeep1 ] )
-        
-        lineUnjoin1 = ("1\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        lineUnjoin2 = ("1\tchr1\t250\t280\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        lineUnjoin3 = ("1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathListToUnjoin = self._makePathListFromStringList( [ lineUnjoin1, lineUnjoin2, lineUnjoin3 ] )
-        
-        expList = []
-        expList.append( self._makePathListFromStringList( [ lineUnjoin3 ] ) )
-        expList.append( self._makePathListFromStringList( [ lineUnjoin1, lineUnjoin2 ] ) )
-        
-        obsList = PathUtils.getPathListUnjoinedBasedOnQuery( pathListToKeep, pathListToUnjoin )
-        
-        self.assertEquals( expList, obsList )
-
-    def test_getPathListUnjoinedBasedOnQuery_listToKeep_size2_listToUnjoin_size4_twoSplits( self ):
-        lineKeep1 = ("1\tchr1\t21\t30\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        lineKeep2 = ("1\tchr1\t81\t90\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathListToKeep = self._makePathListFromStringList( [ lineKeep1, lineKeep2 ] )
-        
-        lineUnjoin1 = ("1\tchr1\t1\t10\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        lineUnjoin2 = ("1\tchr1\t41\t50\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        lineUnjoin3 = ("1\tchr1\t61\t70\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        lineUnjoin4 = ("1\tchr1\t101\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        pathListToUnjoin = self._makePathListFromStringList( [ lineUnjoin1, lineUnjoin2, lineUnjoin3, lineUnjoin4 ] )
-        
-        expList = []
-        expList.append( self._makePathListFromStringList( [ lineUnjoin1 ] ) )
-        expList.append( self._makePathListFromStringList( [ lineUnjoin2, lineUnjoin3 ] ) )
-        expList.append( self._makePathListFromStringList( [ lineUnjoin4 ] ) )
-        
-        obsList = PathUtils.getPathListUnjoinedBasedOnQuery( pathListToKeep, pathListToUnjoin )
-        
-        self.assertEquals( expList, obsList )
-
-    def test_changeIdInList_empty_list ( self ):
-        pathList = []
-        
-        PathUtils.changeIdInList(pathList,1)
-        
-        obsList = pathList
-        expList = []
-        
-        self.assertEquals(expList, obsList)
-        
-    def test_changeIdInList_list_size1 ( self ):
-        line1 = ("1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        line2 = ("2\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n")
-        
-        pathList = self._makePathListFromStringList([line1]) 
-        PathUtils.changeIdInList(pathList,2)
-        
-        expPathList = pathList   
-        
-        obsPathList = self._makePathListFromStringList([line2])  
-        
-        self.assertEquals(expPathList, obsPathList)
-        
-    def test_changeIdInList( self ):
-        line1 = ( "1\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n" )
-        line2 = ( "2\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n" )
-        line3 = ( "3\tchr1\t300\t310\tTE2\t150\t200\t0.000000\t30\t90.200000\n" )
-        
-        pathList = self._makePathListFromStringList( [ line1, line2, line3 ] ) 
-        PathUtils.changeIdInList( pathList, 2 )
-        obsPathList = pathList
-        
-        line11 = ( "2\tchr1\t100\t110\tTE2\t150\t200\t0.000000\t30\t90.200000\n" )
-        line22 = ( "2\tchr1\t200\t210\tTE2\t150\t200\t0.000000\t30\t90.200000\n" )
-        line33 = ( "2\tchr1\t300\t310\tTE2\t150\t200\t0.000000\t30\t90.200000\n" )
-        
-        expPathList = self._makePathListFromStringList( [ line11, line22, line33 ] )
-        
-        self.assertEquals( expPathList, obsPathList )
-        
-        
-    def test_getIdentityFromPathList( self ):
-        p1 = Path()
-        p1.setFromTuple( ( "1", "qry1", "1", "100", "sbj1", "1", "100", "0.0", "239", "90.0" ) )
-        p2 = Path()
-        p2.setFromTuple( ( "2", "qry1", "121", "350", "sbj1", "101", "200", "0.0", "176", "91.2" ) )
-        lPaths = [ p1, p2 ]
-        exp = ( 90.0 * ( 100-1+1) + 91.2 * (350-121+1) ) / ( (100-1+1) + (350-121+1) )   # 90.836363636363643
-        obs = PathUtils.getIdentityFromPathList( lPaths )
-        self.assertEqual( exp, obs )
-        
-        
-    def test_getIdentityFromPathList_withOverlap( self ):
-        p1 = Path()
-        p1.setFromTuple( ( "1", "qry1", "1", "100", "sbj1", "1", "100", "0.0", "239", "90.0" ) )
-        p2 = Path()
-        p2.setFromTuple( ( "2", "qry1", "21", "80", "sbj1", "21", "80", "0.0", "176", "91.2" ) )
-        p3 = Path()
-        p3.setFromTuple( ( "2", "qry1", "121", "350", "sbj1", "101", "200", "0.0", "176", "91.2" ) )
-        lPaths = [ p1, p2, p3 ]
-        exp = ( 91.2 * ( 100-1+1) + 91.2 * (350-121+1) ) / ( (100-1+1) + (350-121+1) )
-        obs = PathUtils.getIdentityFromPathList( lPaths )
-        self.assertEqual( exp, obs )
-        
-        
-    def test_getIdentityFromPathList_diffQueries( self ):
-        p1 = Path()
-        p1.setFromTuple( ( "1", "qry1", "1", "100", "sbj1", "1", "100", "0.0", "239", "90.0" ) )
-        p2 = Path()
-        p2.setFromTuple( ( "2", "qry2", "121", "350", "sbj1", "101", "200", "0.0", "176", "91.2" ) )
-        lPaths = [ p1, p2 ]
-        try:
-            obs = PathUtils.getIdentityFromPathList( lPaths )
-        except:
-            pass
-        
-        
-    def test_getIdentityFromPathList_diffSubjects_check( self ):
-        p1 = Path()
-        p1.setFromTuple( ( "1", "qry1", "1", "100", "sbj1", "1", "100", "0.0", "239", "90.0" ) )
-        p2 = Path()
-        p2.setFromTuple( ( "1", "qry1", "121", "350", "sbj2", "101", "200", "0.0", "176", "91.2" ) )
-        lPaths = [ p1, p2 ]
-        try:
-            obs = PathUtils.getIdentityFromPathList( lPaths, True )
-        except:
-            pass
-        
-        
-    def test_getIdentityFromPathList_diffSubjects_noCheck( self ):
-        p1 = Path()
-        p1.setFromTuple( ( "1", "qry1", "1", "100", "sbj1", "1", "100", "0.0", "239", "90.0" ) )
-        p2 = Path()
-        p2.setFromTuple( ( "1", "qry1", "121", "350", "sbj2", "101", "200", "0.0", "176", "91.2" ) )
-        lPaths = [ p1, p2 ]
-        exp = ( 90.0 * ( 100-1+1) + 91.2 * (350-121+1) ) / ( (100-1+1) + (350-121+1) )   # 90.836363636363643
-        obs = PathUtils.getIdentityFromPathList( lPaths, False )
-        self.assertEqual( exp, obs )
-        
-        
-    def test_getPathListSortedByIncreasingMinQueryThenMaxQuery_alreadyOrdered_diffIdentifier( self ):
-        p1 = Path()
-        p1.setFromTuple( ( "1", "qry1", "1", "10", "sbj1", "1", "100", "0.0", "239", "90.0" ) )
-        p2 = Path()
-        p2.setFromTuple( ( "2", "qry1", "21", "30", "sbj1", "101", "200", "0.0", "176", "91.2" ) )
-        lPaths = [ p1, p2 ]
-        
-        expList = [ p1, p2 ]
-        
-        obsList = PathUtils.getPathListSortedByIncreasingMinQueryThenMaxQuery( lPaths )
-        
-        self.assertEqual( expList, obsList )
-        
-    def test_getPathListSortedByIncreasingMinQueryThenMaxQuery_unordered_diffIdentifier( self ):
-        p1 = Path()
-        p1.setFromTuple( ( "2", "qry1", "21", "30", "sbj1", "101", "200", "0.0", "176", "91.2" ) )
-        p2 = Path()
-        p2.setFromTuple( ( "1", "qry1", "1", "10", "sbj1", "1", "100", "0.0", "239", "90.0" ) )
-        lPaths = [ p1, p2 ]
-        
-        expList = [ p2, p1 ]
-        
-        obsList = PathUtils.getPathListSortedByIncreasingMinQueryThenMaxQuery( lPaths )
-        
-        self.assertEqual( expList, obsList )
-        
-    def test_getPathListSortedByIncreasingMinQueryThenMaxQuery_unordered_sameIdentifier( self ):
-        p1 = Path()
-        p1.setFromTuple( ( "1", "qry1", "21", "30", "sbj1", "101", "200", "0.0", "176", "91.2" ) )
-        p2 = Path()
-        p2.setFromTuple( ( "1", "qry1", "1", "10", "sbj1", "1", "100", "0.0", "239", "90.0" ) )
-        lPaths = [ p1, p2 ]
-        
-        expList = [ p2, p1 ]
-        
-        obsList = PathUtils.getPathListSortedByIncreasingMinQueryThenMaxQuery( lPaths )
-        
-        self.assertEqual( expList, obsList )
-        
-    def test_getPathListSortedByIncreasingMinQueryThenMaxQuery_unordered_overlapping( self ):
-        p1 = Path()
-        p1.setFromTuple( ( "1", "qry1", "6", "15", "sbj1", "101", "200", "0.0", "176", "91.2" ) )
-        p2 = Path()
-        p2.setFromTuple( ( "2", "qry1", "1", "10", "sbj1", "1", "100", "0.0", "239", "90.0" ) )
-        lPaths = [ p1, p2 ]
-        
-        expList = [ p2, p1 ]
-        
-        obsList = PathUtils.getPathListSortedByIncreasingMinQueryThenMaxQuery( lPaths )
-        
-        self.assertEqual( expList, obsList )
-        
-    def test_getPathListSortedByIncreasingMinQueryThenMaxQuery_unordered_sameMin_threeSets( self ):
-        p1 = Path()
-        p1.setFromTuple( ( "1", "qry1", "1", "15", "sbj1", "1", "100", "0.0", "239", "90.0" ) )
-        p2 = Path()
-        p2.setFromTuple( ( "2", "qry1", "1", "10", "sbj1", "101", "200", "0.0", "176", "91.2" ) )
-        p3 = Path()
-        p3.setFromTuple( ( "2", "qry1", "1", "12", "sbj1", "101", "200", "0.0", "176", "91.2" ) )
-        lPaths = [ p1, p2, p3 ]
-        
-        expList = [ p2, p3, p1 ]
-        
-        obsList = PathUtils.getPathListSortedByIncreasingMinQueryThenMaxQuery( lPaths )
-        
-        self.assertEqual( expList, obsList )
-        
-    def test_getPathListSortedByIncreasingMinQueryThenMaxQuery_unordered_included( self ):
-        p1 = Path()
-        p1.setFromTuple( ( "1", "qry1", "2", "4", "sbj1", "101", "200", "0.0", "176", "91.2" ) )
-        p2 = Path()
-        p2.setFromTuple( ( "2", "qry1", "1", "5", "sbj1", "1", "100", "0.0", "239", "90.0" ) )
-        lPaths = [ p1, p2 ]
-        
-        expList = [ p2, p1 ]
-        
-        obsList = PathUtils.getPathListSortedByIncreasingMinQueryThenMaxQuery( lPaths )
-        
-        self.assertEqual( expList, obsList )
-        
-    def test_getPathListSortedByIncreasingMinQueryThenMaxQueryThenIdentifier_sameCoord_diffId( self ):
-        p1 = Path()
-        p1.setFromTuple( ( "1", "qry1", "1", "5", "sbj1", "101", "200", "0.0", "176", "91.2" ) )
-        p2 = Path()
-        p2.setFromTuple( ( "2", "qry1", "1", "5", "sbj1", "101", "200", "0.0", "176", "91.2" ) )
-        lPaths = [ p2, p1 ]
-        
-        expList = [ p1, p2 ]
-        
-        obsList = PathUtils.getPathListSortedByIncreasingMinQueryThenMaxQueryThenIdentifier( lPaths )
-        
-        self.assertEqual( expList, obsList )
-        
-    def test_getListOfDistinctIdentifiers( self ):
-        p1 = Path()
-        p1.setFromTuple( ( "1", "qry1", "1", "100", "sbj1", "1", "100", "0.0", "239", "90.0" ) )
-        p2 = Path()
-        p2.setFromTuple( ( "2", "qry1", "121", "350", "sbj1", "101", "200", "0.0", "176", "91.2" ) )
-        p3 = Path()
-        p3.setFromTuple( ( "2", "qry1", "121", "350", "sbj1", "101", "200", "0.0", "176", "91.2" ) )
-        lPaths = [ p1, p2, p3 ]
-        lExp = [ 1, 2 ]
-        lObs = PathUtils.getListOfDistinctIdentifiers( lPaths )
-        lExp.sort()
-        lObs.sort()
-        self.assertEqual( lObs, lExp )
-        
-    def test_getListOfDistinctQueryNames( self ):
-        p1 = Path()
-        p1.setFromTuple( ( "1", "qry1", "1", "100", "sbj1", "1", "100", "0.0", "239", "90.0" ) )
-        p2 = Path()
-        p2.setFromTuple( ( "2", "qry2", "121", "350", "sbj1", "101", "200", "0.0", "176", "91.2" ) )
-        p3 = Path()
-        p3.setFromTuple( ( "2", "qry2", "121", "350", "sbj1", "101", "200", "0.0", "176", "91.2" ) )
-        lPaths = [ p1, p2, p3 ]
-        lExp = [ "qry1", "qry2" ]
-        lObs = PathUtils.getListOfDistinctQueryNames( lPaths )
-        lExp.sort()
-        lObs.sort()
-        self.assertEqual( lObs, lExp )
-        
-    def test_getListOfDistinctSubjectNames( self ):
-        p1 = Path()
-        p1.setFromTuple( ( "1", "qry1", "1", "100", "sbj1", "1", "100", "0.0", "239", "90.0" ) )
-        p2 = Path()
-        p2.setFromTuple( ( "2", "qry2", "121", "350", "sbj1", "101", "200", "0.0", "176", "91.2" ) )
-        p3 = Path()
-        p3.setFromTuple( ( "2", "qry2", "121", "350", "sbj2", "101", "200", "0.0", "176", "91.2" ) )
-        lPaths = [ p1, p2, p3 ]
-        lExp = [ "sbj1", "sbj2" ]
-        lObs = PathUtils.getListOfDistinctSubjectNames( lPaths )
-        lExp.sort()
-        lObs.sort()
-        self.assertEqual( lObs, lExp )
-        
-    def test_getListOfJoinCoordinatesOnQuery_returnCoord( self ):
-        p1a = Path()
-        p1a.setFromTuple( ( "1", "qry1", "1", "500", "sbj1", "1", "500", "0.0", "532", "95.0" ) )
-        p1b = Path()
-        p1b.setFromTuple( ( "1", "qry1", "701", "900", "sbj1", "501", "700", "0.0", "232", "95.3" ) )
-        lExp = [ [ 501, 700 ] ]
-        lPaths = [ p1a, p1b ]
-        lObs = PathUtils.getListOfJoinCoordinatesOnQuery( lPaths )
-        lExp.sort()
-        lObs.sort()
-        self.assertEqual( lObs, lExp )
-        
-    def test_getListOfJoinCoordinatesOnQuery_overlap( self ):
-        p1a = Path()
-        p1a.setFromTuple( ( "1", "qry1", "1", "500", "sbj1", "1", "500", "0.0", "532", "95.0" ) )
-        p1b = Path()
-        p1b.setFromTuple( ( "1", "qry1", "491", "900", "sbj1", "501", "770", "0.0", "232", "95.3" ) )
-        lExp = []
-        lPaths = [ p1a, p1b ]
-        minLength = 100
-        lObs = PathUtils.getListOfJoinCoordinatesOnQuery( lPaths, minLength )
-        lExp.sort()
-        lObs.sort()
-        self.assertEqual( lObs, lExp )
-        
-    def test_getListOfJoinCoordinates_tooShort( self ):
-        p1a = Path()
-        p1a.setFromTuple( ( "1", "qry1", "1", "500", "sbj1", "1", "500", "0.0", "532", "95.0" ) )
-        p1b = Path()
-        p1b.setFromTuple( ( "1", "qry1", "551", "900", "sbj1", "501", "750", "0.0", "232", "95.3" ) )
-        lExp = []
-        lPaths = [ p1a, p1b ]
-        minLength = 100
-        lObs = PathUtils.getListOfJoinCoordinatesOnQuery( lPaths, minLength )
-        lExp.sort()
-        lObs.sort()
-        self.assertEqual( lObs, lExp )
-        
-    def test_getLengthOnQueryFromPathList( self ):
-        p1 = Path()
-        p1.setFromTuple( ( "1", "qry1", "1", "70", "sbj1", "1", "70", "0.0", "132", "95.0" ) )
-        p2 = Path()
-        p2.setFromTuple( ( "2", "qry1", "51", "90", "sbj2", "40", "1", "0.0", "132", "95.0" ) )
-        lPaths = [ p1, p2 ]
-        exp = 90
-        obs = PathUtils.getLengthOnQueryFromPathList( lPaths )
-        self.assertEqual( obs, exp )
-        
-    def test_convertPathFileIntoAlignFile( self ):
-        pathFile = "dummyPathFile_%s_%s" % ( time.strftime("%Y%m%d%H%M%S"), os.getpid() )
-        pathFileHandler = open( pathFile, "w" )
-        pathFileHandler.write( "3\tchr2\t250\t151\tseq5\t1\t100\t1e-31\t147\t98.3\n" )
-        pathFileHandler.close()
-        
-        expFile = "dummyExpFile_%s_%s" % ( time.strftime("%Y%m%d%H%M%S"), os.getpid() )
-        expFileHandler = open( expFile, "w" )
-        expFileHandler.write( "chr2\t151\t250\tseq5\t100\t1\t1e-31\t147\t98.300000\n" )
-        expFileHandler.close()
-        
-        obsFile = "dummyObsFile_%s_%s" % ( time.strftime("%Y%m%d%H%M%S"), os.getpid() )
-        
-        PathUtils.convertPathFileIntoAlignFile( pathFile, obsFile )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
-        
-        for f in [ pathFile, expFile, obsFile ]:
-            if os.path.exists( f ):
-                os.remove ( f )
-                
-    def test_convertPathFileIntoMapFileWithQueryCoordsOnly( self ):
-        pathFile = "dummyPathFile_%s_%s" % ( time.strftime("%Y%m%d%H%M%S"), os.getpid() )
-        pathFileHandler = open( pathFile, "w" )
-        pathFileHandler.write( "3\tchr2\t250\t151\tseq5\t1\t100\t1e-31\t147\t98.3\n" )
-        pathFileHandler.write( "4\tchr2\t191\t230\tseq8\t237\t387\t1e-11\t187\t95.3\n" )
-        pathFileHandler.write( "3\tchr2\t500\t301\tseq5\t101\t300\t1e-81\t247\t96.2\n" )
-        pathFileHandler.close()
-        
-        expFile = "dummyExpFile_%s_%s" % ( time.strftime("%Y%m%d%H%M%S"), os.getpid() )
-        expFileHandler = open( expFile, "w" )
-        expFileHandler.write( "seq5\tchr2\t250\t151\n" )
-        expFileHandler.write( "seq8\tchr2\t191\t230\n" )
-        expFileHandler.write( "seq5\tchr2\t500\t301\n" )
-        expFileHandler.close()
-        
-        obsFile = "dummyObsFile_%s_%s" % ( time.strftime("%Y%m%d%H%M%S"), os.getpid() )
-        
-        PathUtils.convertPathFileIntoMapFileWithQueryCoordsOnly( pathFile, obsFile )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
-        
-        for f in [ pathFile, expFile, obsFile ]:
-            if os.path.exists( f ):
-                os.remove( f )
-                
-                
-    def test_mergeMatchesOnQueries( self ):
-        pathFile = "dummyPathFile_%s_%s" % ( time.strftime("%Y%m%d%H%M%S"), os.getpid() )
-        pathFileHandler = open( pathFile, "w" )
-        pathFileHandler.write( "3\tchr2\t250\t151\tseq5\t1\t100\t1e-31\t147\t98.3\n" )
-        pathFileHandler.write( "4\tchr2\t230\t191\tseq8\t237\t387\t1e-11\t187\t95.3\n" )
-        pathFileHandler.write( "3\tchr2\t500\t301\tseq5\t101\t300\t1e-81\t247\t96.2\n" )
-        pathFileHandler.close()
-        
-        expFile = "dummyExpFile_%s_%s" % ( time.strftime("%Y%m%d%H%M%S"), os.getpid() )
-        expFileHandler = open( expFile, "w" )
-        expFileHandler.write( "0\tchr2\t151\t250\tseq5\t0\t0\t0.0\t0\t0\n" )
-        expFileHandler.write( "0\tchr2\t301\t500\tseq5\t0\t0\t0.0\t0\t0\n" )
-        expFileHandler.close()
-        
-        obsFile = "dummyObsFile_%s_%s" % ( time.strftime("%Y%m%d%H%M%S"), os.getpid() )
-        
-        PathUtils.mergeMatchesOnQueries( pathFile, obsFile )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
-        
-        for f in [ pathFile, expFile, obsFile ]:
-            if os.path.exists( f ):
-                os.remove( f )
-                
-                
-    def test_filterPathListOnChainLength( self ):
-        p1a = Path()
-        p1a.setFromTuple( ( "1", "qry1", "1", "12", "sbj1", "1", "12", "0.0", "132", "95.0" ) )
-        p1b = Path()
-        p1b.setFromTuple( ( "1", "qry1", "15", "30", "sbj1", "13", "28", "0.0", "132", "95.0" ) )
-        p2 = Path()
-        p2.setFromTuple( ( "2", "qry1", "51", "90", "sbj2", "40", "1", "0.0", "132", "95.0" ) )
-        p3 = Path()
-        p3.setFromTuple( ( "3", "qry2", "1", "12", "sbj3", "15", "1", "0.0", "132", "95.0" ) )
-        lPaths = [ p1a, p1b, p2, p3 ]
-        lExp = [ p1a, p1b, p2 ]
-        lObs = PathUtils.filterPathListOnChainLength( lPaths, 20 )
-        self.assertEqual( lExp, lObs )
-        
-    def test_getPathListFromFile(self):
-        file = "dummyFile_%s_%s" % ( time.strftime("%Y%m%d%H%M%S"), os.getpid() )
-        fileHandler = open( file, "w" )
-        fileHandler.write( "1\tchr2\t151\t250\tseq5\t0\t0\t0.0\t0\t0\n" )
-        fileHandler.write( "2\tchr2\t301\t500\tseq5\t0\t0\t0.0\t0\t0\n" )
-        fileHandler.close()
-        p1 = Path()
-        p1.setFromTuple( ( "1", "chr2", "151", "250", "seq5", "0", "0", "0.0", "0", "0" ) )
-        p2 = Path()
-        p2.setFromTuple( ( "2", "chr2", "301", "500", "seq5", "0", "0", "0.0", "0", "0" ) )
-        expLPath = [ p1, p2 ]
-        obsLPath = PathUtils.getPathListFromFile(file)
-        expLPathSorted = PathUtils.getPathListSortedByIncreasingQueryMinThenInvQueryLength(expLPath)
-        obsLPathSorted = PathUtils.getPathListSortedByIncreasingQueryMinThenInvQueryLength(obsLPath)
-        os.remove(file)
-        self.assertEqual( expLPathSorted, obsLPathSorted )
-        
-    def test_getPathListFromFile_empty_file(self):
-        file = "dummyFile_%s_%s" % ( time.strftime("%Y%m%d%H%M%S"), os.getpid() )
-        fileHandler = open( file, "w" )
-        fileHandler.close()
-        expLPath = []
-        obsLPath = PathUtils.getPathListFromFile(file)
-        expLPathSorted = PathUtils.getPathListSortedByIncreasingQueryMinThenInvQueryLength(expLPath)
-        obsLPathSorted = PathUtils.getPathListSortedByIncreasingQueryMinThenInvQueryLength(obsLPath)
-        os.remove(file)
-        self.assertEqual( expLPathSorted, obsLPathSorted )
-        
-    def test_convertPathFileIntoAlignFileViaPathrange_sortedInput( self ):
-        p1a = Path()
-        p1a.setFromTuple( ( "1", "qry1", "1", "12", "sbj1", "1", "12", "0.0", "132", "95.0" ) )
-        p1b = Path()
-        p1b.setFromTuple( ( "1", "qry1", "16", "30", "sbj1", "13", "28", "1e-270", "150", "97.0" ) )
-        p2 = Path()
-        p2.setFromTuple( ( "2", "qry1", "51", "90", "sbj2", "40", "1", "0.0", "132", "95.0" ) )
-        inFile = "dummyInFile"
-        inF = open( inFile, "w" )
-        for iPath in [ p1a, p1b, p2 ]:
-            iPath.write( inF )
-        inF.close()
-
-        expFile = "dummyExpFile"
-        expF = open( expFile, "w" )
-        a1 = Align()
-        a1.setFromTuple( ( "qry1", "1", "30", "sbj1", "1", "28", "0.0", "282", str((95*12+97*15)/float(12+15)) ) )
-        a2 = Align()
-        a2.setFromTuple( ( "qry1", "51", "90", "sbj2", "40", "1", "0.0", "132", "95.0" ) )
-        for iAlign in [ a1, a2 ]:
-            iAlign.write( expF )
-        expF.close()
-        
-        obsFile = "dummyObsFile"
-        
-        PathUtils.convertPathFileIntoAlignFileViaPathrange( inFile, obsFile, 0 )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
-        
-        for f in [ inFile, expFile, obsFile ]:
-            os.remove( f )
-            
-            
-    def test_convertPathFileIntoAlignFileViaPathrange_unsortedInput( self ):
-        p1a = Path()
-        p1a.setFromTuple( ( "1", "qry1", "1", "12", "sbj1", "1", "12", "0.0", "132", "95.0" ) )
-        p1b = Path()
-        p1b.setFromTuple( ( "1", "qry1", "16", "30", "sbj1", "13", "28", "0.0", "150", "97.0" ) )
-        p2 = Path()
-        p2.setFromTuple( ( "2", "qry1", "51", "90", "sbj2", "40", "1", "0.0", "132", "95.0" ) )
-        inFile = "dummyInFile"
-        inF = open( inFile, "w" )
-        for iPath in [ p1b, p2, p1a ]:
-            iPath.write( inF )
-        inF.close()
-
-        expFile = "dummyExpFile"
-        expF = open( expFile, "w" )
-        a1 = Align()
-        a1.setFromTuple( ( "qry1", "1", "30", "sbj1", "1", "28", "0.0", "282", str((95*12+97*15)/float(12+15)) ) )
-        a2 = Align()
-        a2.setFromTuple( ( "qry1", "51", "90", "sbj2", "40", "1", "0.0", "132", "95.0" ) )
-        for iAlign in [ a1, a2 ]:
-            iAlign.write( expF )
-        expF.close()
-        
-        obsFile = "dummyObsFile"
-        
-        PathUtils.convertPathFileIntoAlignFileViaPathrange( inFile, obsFile, 0 )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
-        
-        for f in [ inFile, expFile, obsFile ]:
-            os.remove( f )
-            
-            
-    def test_convertPathFileIntoAlignFileViaPathrange_sortedInput_subjectReverseStrand( self ):
-        p1a = Path()
-        p1a.setFromTuple( ( "1", "qry1", "1", "12", "sbj1", "12", "1", "0.0", "132", "95.0" ) )
-        p1b = Path()
-        p1b.setFromTuple( ( "1", "qry1", "16", "30", "sbj1", "28", "13", "0.0", "150", "97.0" ) )
-        p2 = Path()
-        p2.setFromTuple( ( "2", "qry1", "51", "90", "sbj2", "40", "1", "0.0", "132", "95.0" ) )
-        inFile = "dummyInFile"
-        inF = open( inFile, "w" )
-        for iPath in [ p1a, p1b, p2 ]:
-            iPath.write( inF )
-        inF.close()
-
-        expFile = "dummyExpFile"
-        expF = open( expFile, "w" )
-        a1 = Align()
-        a1.setFromTuple( ( "qry1", "1", "30", "sbj1", "28", "1", "0.0", "282", str((95*12+97*15)/float(12+15)) ) )
-        a2 = Align()
-        a2.setFromTuple( ( "qry1", "51", "90", "sbj2", "40", "1", "0.0", "132", "95.0" ) )
-        for iAlign in [ a1, a2 ]:
-            iAlign.write( expF )
-        expF.close()
-        
-        obsFile = "dummyObsFile"
-        
-        PathUtils.convertPathFileIntoAlignFileViaPathrange( inFile, obsFile, 0 )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
-        
-        for f in [ inFile, expFile, obsFile ]:
-            os.remove( f )
-        
-        
-    def test_splitPathListByQueryName_empty_list( self ):
-        lPath = []
-        
-        obsLPath = PathUtils.splitPathListByQueryName( lPath )
-        
-        expLPath = []
-        
-        self.assertEquals( expLPath, obsLPath )
-        
-        
-    def test_splitPathListByQueryName( self ):
-        iPath1 = Path()
-        iPath1.setFromString("1\tchr1\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iPath2 = Path()
-        iPath2.setFromString("2\tchr2\t200\t220\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iPath3 = Path()
-        iPath3.setFromString("3\tchr1\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        lPath = [ iPath1, iPath2, iPath3 ]
-        
-        obsLPath = PathUtils.splitPathListByQueryName( lPath )
-        
-        expLPath = [ [ iPath1, iPath3 ],
-                     [ iPath2 ] ]
-        
-        self.assertEquals( expLPath, obsLPath )
-        
-        
-    def test_splitPathListByQueryName_last_align_alone( self ):
-        iPath1 = Path()
-        iPath1.setFromString("1\tchr1\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iPath2 = Path()
-        iPath2.setFromString("2\tchr2\t200\t220\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iPath3 = Path()
-        iPath3.setFromString("3\tchr1\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iPath4 = Path()
-        iPath4.setFromString("4\tchr3\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iPath5 = Path()
-        iPath5.setFromString("5\tchr2\t200\t220\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iPath6 = Path()
-        iPath6.setFromString("6\tchr1\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iPath7 = Path()
-        iPath7.setFromString("7\tchr1\t100\t110\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iPath8 = Path()
-        iPath8.setFromString("8\tchr2\t200\t220\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        iPath9 = Path()
-        iPath9.setFromString("9\tchr4\t300\t330\tTE2\t150\t200\t1e-20\t30\t90.2\n")
-        lPath = [ iPath1, iPath2, iPath3, iPath4, iPath5, iPath6, iPath7, iPath8, iPath9 ]
-        
-        obsLPath = PathUtils.splitPathListByQueryName( lPath )
-        
-        expLPath = [ [ iPath1, iPath3, iPath6, iPath7 ],
-                     [ iPath2, iPath5, iPath8 ],
-                     [ iPath4 ],
-                     [ iPath9 ] ]
-        
-        self.assertEquals( expLPath, obsLPath )
-        
-        
-    def test_getPathListSortedByIncreasingQueryMinThenInvQueryLength_alreadyOrdered_diffIdentifier( self ):
-        iPath1 = Path( 1, Range("qry1",1,10), Range("sbj1",1,10), 0.0, 10, 98.7 )
-        iPath2 = Path( 2, Range("qry1",21,30), Range("sbj1",11,20), 0.0, 10, 98.7 )
-        lPaths = [ iPath1, iPath2 ]
-        
-        lExp = [ Path( 1, Range("qry1",1,10), Range("sbj1",1,10), 0.0, 10, 98.7 ),
-                Path( 2, Range("qry1",21,30), Range("sbj1",11,20), 0.0, 10, 98.7 ) ]
-        
-        lObs = PathUtils.getPathListSortedByIncreasingQueryMinThenInvQueryLength( lPaths )
-        
-        self.assertEquals( lExp, lObs )
-        
-        
-    def test_getPathListSortedByIncreasingQueryMinThenInvQueryLength_unordered_diffIdentifier( self ):
-        iPath1 = Path( 1, Range("qry1",1,10), Range("sbj1",1,10), 0.0, 10, 98.7 )
-        iPath2 = Path( 2, Range("qry1",21,30), Range("sbj1",11,20), 0.0, 10, 98.7 )
-        lPaths = [ iPath2, iPath1 ]
-        
-        lExp = [ Path( 1, Range("qry1",1,10), Range("sbj1",1,10), 0.0, 10, 98.7 ),
-                Path( 2, Range("qry1",21,30), Range("sbj1",11,20), 0.0, 10, 98.7 ) ]
-        
-        lObs = PathUtils.getPathListSortedByIncreasingQueryMinThenInvQueryLength( lPaths )
-        
-        self.assertEquals( lExp, lObs )
-        
-        
-    def test_getPathListSortedByIncreasingQueryMinThenInvQueryLength_unordered_sameIdentifier( self ):
-        iPath1a = Path( 1, Range("qry1",1,10), Range("sbj1",1,10), 0.0, 10, 98.7 )
-        iPath1b = Path( 1, Range("qry1",21,30), Range("sbj1",11,20), 0.0, 10, 98.7 )
-        lPaths = [ iPath1b, iPath1a ]
-        
-        lExp = [ Path( 1, Range("qry1",1,10), Range("sbj1",1,10), 0.0, 10, 98.7 ),
-                Path( 1, Range("qry1",21,30), Range("sbj1",11,20), 0.0, 10, 98.7 ) ]
-        
-        lObs = PathUtils.getPathListSortedByIncreasingQueryMinThenInvQueryLength( lPaths )
-        
-        self.assertEquals( lExp, lObs )
-        
-        
-    def test_getPathListSortedByIncreasingQueryMinThenInvQueryLength_unordered_overlapping( self ):
-        iPath1 = Path( 1, Range("qry1",1,6), Range("sbj1",1,6), 0.0, 10, 98.7 )
-        iPath2 = Path( 2, Range("qry1",5,10), Range("sbj1",5,10), 0.0, 10, 98.7 )
-        lPaths = [ iPath2, iPath1 ]
-        
-        lExp = [ Path( 1, Range("qry1",1,6), Range("sbj1",1,6), 0.0, 10, 98.7 ),
-                Path( 2, Range("qry1",5,10), Range("sbj1",5,10), 0.0, 10, 98.7 ) ]
-        
-        lObs = PathUtils.getPathListSortedByIncreasingQueryMinThenInvQueryLength( lPaths )
-        
-        self.assertEquals( lExp, lObs )
-        
-        
-    def test_getPathListSortedByIncreasingQueryMinThenInvQueryLength_threePaths_2sameMin( self ):
-        iPath1 = Path( 1, Range("qry1",1,6), Range("sbj1",1,6), 0.0, 10, 98.7 )
-        iPath2 = Path( 2, Range("qry1",5,12), Range("sbj1",5,12), 0.0, 10, 98.7 )
-        iPath3 = Path( 3, Range("qry1",5,10), Range("sbj1",5,10), 0.0, 10, 98.7 )
-        lPaths = [ iPath3, iPath2, iPath1 ]
-        
-        lExp = [ Path( 1, Range("qry1",1,6), Range("sbj1",1,6), 0.0, 10, 98.7 ),
-                Path( 2, Range("qry1",5,12), Range("sbj1",5,12), 0.0, 10, 98.7 ),
-                Path( 3, Range("qry1",5,10), Range("sbj1",5,10), 0.0, 10, 98.7 ) ]
-        
-        lObs = PathUtils.getPathListSortedByIncreasingQueryMinThenInvQueryLength( lPaths )
-        
-        self.assertEquals( lExp, lObs )
-        
-        
-    def test_getPathListSortedByIncreasingQueryMinThenInvQueryLength_unordered_included( self ):
-        iPath1 = Path( 1, Range("qry1",1,6), Range("sbj1",1,6), 0.0, 10, 98.7 )
-        iPath2 = Path( 2, Range("qry1",2,5), Range("sbj1",2,5), 0.0, 10, 98.7 )
-        lPaths = [ iPath2, iPath1 ]
-        
-        lExp = [ Path( 1, Range("qry1",1,6), Range("sbj1",1,6), 0.0, 10, 98.7 ),
-                Path( 2, Range("qry1",2,5), Range("sbj1",2,5), 0.0, 10, 98.7 ) ]
-        
-        lObs = PathUtils.getPathListSortedByIncreasingQueryMinThenInvQueryLength( lPaths )
-        
-        self.assertEquals( lExp, lObs )
-        
-        
-    def test_mergePathsInList_emptyList( self ):
-        lPaths = []
-        lExp = []
-        lObs = PathUtils.mergePathsInList( lPaths )
-        self.assertEquals( lExp, lObs )
-        
-        
-    def test_mergePathsInList_onePath( self ):
-        iPath1 = Path( 1, Range("qry1",1,10), Range("sbj1",1,10), 0.0, 10, 98.7 )
-        lPaths = [ iPath1 ]
-        lExp = [ Path( 1, Range("qry1",1,10), Range("sbj1",1,10), 0.0, 10, 98.7 ) ]
-        lObs = PathUtils.mergePathsInList( lPaths )
-        self.assertEquals( lExp, lObs )
-        
-        
-    def test_mergePathsInList_noOverlap( self ):
-        iPath1 = Path( 1, Range("qry1",1,10), Range("sbj1",1,10), 0.0, 10, 98.7 )
-        iPath2 = Path( 1, Range("qry1",21,30), Range("sbj1",11,20), 0.0, 10, 98.7 )
-        lPaths = [ iPath1, iPath2 ]
-        
-        lExp = [ Path( 1, Range("qry1",1,10), Range("sbj1",1,10), 0.0, 10, 98.7 ),
-                Path( 1, Range("qry1",21,30), Range("sbj1",11,20), 0.0, 10, 98.7 ) ]
-        
-        lObs = PathUtils.mergePathsInList( lPaths )
-        
-        self.assertEquals( lExp, lObs )
-        
-        
-    def test_mergePathsInList_withOverlap( self ):
-        iPath1 = Path( 1, Range("qry1",1,10), Range("sbj1",1,10), 0.0, 10, 98.7 )
-        iPath2 = Path( 1, Range("qry1",6,15), Range("sbj1",6,15), 0.0, 10, 98.7 )
-        lPaths = [ iPath2, iPath1 ]
-        
-        lExp = [ Path( 1, Range("qry1",1,15), Range("sbj1",1,15), 0.0, 10, 98.7 ) ]
-        
-        lObs = PathUtils.mergePathsInList( lPaths )
-        
-        self.assertEquals( lExp, lObs )
-        
-        
-    def test_mergePathsInList_withOverlap_reverseOnly( self ):
-        iPath1 = Path( 1, Range("qry1",10,1), Range("sbj1",10,1), 0.0, 10, 98.7 )
-        iPath2 = Path( 1, Range("qry1",15,6), Range("sbj1",15,6), 0.0, 10, 98.7 )
-        lPaths = [ iPath2, iPath1 ]
-        
-        lExp = [ Path( 1, Range("qry1",15,1), Range("sbj1",15,1), 0.0, 10, 98.7 ) ]
-        
-        lObs = PathUtils.mergePathsInList( lPaths )
-        
-        self.assertEquals( lExp, lObs )
-        
-        
-    def test_mergePathsInList_withOverlap_directAndReverse( self ):
-        iPath1 = Path( 1, Range("qry1",10,1), Range("sbj1",10,1), 0.0, 10, 98.7 )
-        iPath2 = Path( 1, Range("qry1",15,6), Range("sbj1",15,6), 0.0, 10, 98.7 )
-        iPath3 = Path( 1, Range("qry1",2,5), Range("sbj1",2,5), 0.0, 10, 98.7 )
-        lPaths = [ iPath3, iPath2, iPath1 ]
-        
-        lExp = [ Path( 1, Range("qry1",15,1), Range("sbj1",15,1), 0.0, 10, 98.7 ) ]
-        
-        lObs = PathUtils.mergePathsInList( lPaths )
-        
-        self.assertEquals( lExp, lObs )
-        
-        
-    def test_mergePathsInList_diffQueries_withOverlap( self ):
-        iPath1 = Path( 1, Range("qry1",1,10), Range("sbj1",1,10), 0.0, 10, 98.7 )
-        iPath2 = Path( 2, Range("qry2",6,15), Range("sbj1",6,15), 0.0, 10, 98.7 )
-        lPaths = [ iPath2, iPath1 ]
-        
-        lExp = [ Path( 1, Range("qry1",1,10), Range("sbj1",1,10), 0.0, 10, 98.7 ),
-                Path( 2, Range("qry2",6,15), Range("sbj1",6,15), 0.0, 10, 98.7 ) ]
-        
-        lObs = PathUtils.mergePathsInList( lPaths )
-        
-        self.assertEquals( lExp, lObs )
-        
-        
-    def test_mergePathsInList_nonOverlappingSubjects( self ):
-        iPath1 = Path( 1, Range("qry1",398,491), Range("sbj1",10,112), 0.0, 10, 98.7 )
-        iPath2 = Path( 1, Range("qry1",451,492), Range("sbj1",124,169), 0.0, 10, 98.7 )
-        iPath3 = Path( 1, Range("qry1",493,531), Range("sbj1",249,294), 0.0, 10, 98.7 )
-        lPaths = [ iPath3, iPath2, iPath1 ]
-        
-        lExp = [ Path( 1, Range("qry1",398,491), Range("sbj1",10,112), 0.0, 10, 98.7 ),
-                Path( 1, Range("qry1",451,492), Range("sbj1",124,169), 0.0, 10, 98.7 ),
-                Path( 1, Range("qry1",493,531), Range("sbj1",249,294), 0.0, 10, 98.7 ) ]
-        
-        lObs = PathUtils.mergePathsInList( lPaths )
-        
-        self.assertEquals( lExp, lObs )
-        
-        
-    def test_mergePathsInListUsingQueryCoordsOnly( self ):
-        iPath1 = Path( 1, Range("qry1",398,491), Range("sbj1",10,112), 0.0, 10, 98.7 )
-        iPath2 = Path( 1, Range("qry1",451,492), Range("sbj1",124,169), 0.0, 10, 98.7 )
-        iPath3 = Path( 1, Range("qry1",493,531), Range("sbj1",249,294), 0.0, 10, 98.7 )
-        lPaths = [ iPath3, iPath2, iPath1 ]
-        
-        lExp = [ Path( 1, Range("qry1",398,492), Range("sbj1",10,169), 0.0, 10, 98.7 ),
-                Path( 1, Range("qry1",493,531), Range("sbj1",249,294), 0.0, 10, 98.7 ) ]
-        
-        lObs = PathUtils.mergePathsInListUsingQueryCoordsOnly( lPaths )
-        
-        self.assertEquals( lExp, lObs )
-        
-        
-    def test_convertPathFileIntoGffFile( self ):
-        p1 = Path()
-        p1.setFromTuple( ( "1", "qry1", "12", "1", "sbj1", "1", "12", "0.0", "132", "95.0" ) )
-        p2a = Path()
-        p2a.setFromTuple( ( "2", "qry1", "16", "30", "sbj2", "1", "15", "1e-270", "150", "97.0" ) )
-        p2b = Path()
-        p2b.setFromTuple( ( "2", "qry1", "51", "90", "sbj2", "21", "60", "0.0", "132", "95.9" ) )
-        inFile = "dummyInFile"
-        PathUtils.writeListInFile( [ p1, p2a, p2b ], inFile, "w" )
-        
-        expFile = "dummyExpFile"
-        expF = open( expFile, "w" )
-        expF.write( "qry1\tREPET\tmatch\t1\t12\t0\t-\t.\tID=1;Target=sbj1 1 12\n" )
-        expF.write( "qry1\tREPET\tmatch\t16\t90\t0\t+\t.\tID=ms2;Target=sbj2 1 60\n" )
-        expF.write( "qry1\tREPET\tmatch_part\t16\t30\t1e-270\t+\t.\tID=mp2-1;Parent=ms2;Target=sbj2 1 15\n" )
-        expF.write( "qry1\tREPET\tmatch_part\t51\t90\t0\t+\t.\tID=mp2-2;Parent=ms2;Target=sbj2 21 60\n" )
-        expF.close()
-        
-        obsFile = "dummyObsFile"
-        
-        PathUtils.convertPathFileIntoGffFile( inFile, obsFile )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
-        
-        for f in [ inFile, expFile, obsFile ]:
-            os.remove( f )
-            
-            
-    def test_convertPathFileIntoSetFile( self ):
-        pathFile = "dummyPathFile_%s_%s" % ( time.strftime("%Y%m%d%H%M%S"), os.getpid() )
-        pathFileHandler = open( pathFile, "w" )
-        pathFileHandler.write( "3\tchr2\t250\t151\tseq5\t1\t100\t1e-31\t147\t98.3\n" )
-        pathFileHandler.close()
-        
-        expFile = "dummyExpFile_%s_%s" % ( time.strftime("%Y%m%d%H%M%S"), os.getpid() )
-        expFileHandler = open( expFile, "w" )
-        expFileHandler.write( "3\tseq5\tchr2\t250\t151\n" )
-        expFileHandler.close()
-        
-        obsFile = "dummyObsFile_%s_%s" % ( time.strftime("%Y%m%d%H%M%S"), os.getpid() )
-        
-        PathUtils.convertPathFileIntoSetFile( pathFile, obsFile )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
-        
-        for f in [ pathFile, expFile, obsFile ]:
-            if os.path.exists( f ):
-                os.remove ( f )
-                
-                
-    def test_removeInPathFileDuplicatedPathOnQueryNameQueryCoordAndSubjectName(self):
-        pathFile = "dummyPathFile"
-        f = open(pathFile, "w")
-        f.write("1\tG4\t1\t3856\tAtha5Chr4_Pals_Piler_3590_69_MAP_3\t1\t3856\t0\t7642\t99.9741\n")
-        f.write("1\tG4\t1\t3856\tAtha5Chr4_Pals_Piler_3590_69_MAP_3\t100\t3956\t0\t7642\t99.9741\n")
-        f.write("2\trooA\t1\t386\tAtha5Chr4_Pals_Piler_3589_69_MAP_3\t1\t386\t6.3e-220\t758\t99.4819\n")
-        f.write("3\trooA\t7236\t7621\tAtha5Chr4_Pals_Piler_3536_69_MAP_3\t1\t386\t6.3e-220\t758\t99.4819\n")
-        f.write("4\trooA\t387\t7235\tAtha5Chr4_Pals_Piler_3596_69_MAP_3\t1\t6849\t0\t13580\t99.9854\n")
-        f.write("5\taurora-element\t4046\t4257\tAtha5Chr4_Pals_Piler_3540_69_MAP_3\t1\t204\t6.1e-80\t300\t96.5686\n")
-        f.write("6\taurora-element\t274\t381\tAtha5Chr4_Pals_Piler_3595_23_MAP_3\t177\t284\t0\t191\t97.2222\n")
-        f.write("6\taurora-element\t116\t287\tAtha5Chr4_Pals_Piler_3595_30_MAP_3\t3\t170\t0\t290\t98.8095\n")
-        f.write("7\taurora-element\t393\t902\tAtha5Chr4_Pals_Piler_3595_31_MAP_3\t1467\t1945\t0\t873\t97.2441\n")
-        f.write("7\taurora-element\t393\t902\tAtha5Chr4_Pals_Piler_3595_31_MAP_3\t276\t100784\t0\t869\t98.1211\n")
-        f.write("7\taurora-element\t1387\t2271\tAtha5Chr4_Pals_Piler_3595_31_MAP_3\t276\t10780\t0\t1576\t97.6244\n")
-        f.write("8\taurora-element\t2486\t2828\tAtha5Chr4_Pals_Piler_3595_50_MAP_3\t4301\t4641\t0\t585\t97.3607\n")
-        f.write("9\taurora-element\t2265\t2483\tAtha5Chr4_Pals_Piler_3595_62_MAP_3\t3999\t4218\t0\t361\t96.347\n")
-        f.write("10\taurora-element\t2834\t4045\tAtha5Chr4_Pals_Piler_3595_69_MAP_3\t4800\t6011\t0\t2074\t97.0248\n")
-        f.write("11\taurora-element\t2\t113\tAtha5Chr4_Pals_Piler_3598_69_MAP_3\t205\t317\t8.5e-37\t157\t93.75\n")
-        f.write("11\taurora-element\t2\t113\tAtha5Chr4_Pals_Piler_3598_69_MAP_3\t305\t417\t8.5e-37\t157\t93.75\n")
-        f.write("11\taurora-element\t2\t113\tAtha5Chr4_Pals_Piler_3598_69_MAP_3\t305\t417\t8.5e-37\t157\t93.75\n")
-        f.close()            
-        
-        obsPathFile = "obsDummyPathFile"
-        PathUtils.removeInPathFileDuplicatedPathOnQueryNameQueryCoordAndSubjectName(pathFile, obsPathFile)
-        
-        expPathFile = "expDummyPathFile"
-        f = open(expPathFile, "w")
-        f.write("1\tG4\t1\t3856\tAtha5Chr4_Pals_Piler_3590_69_MAP_3\t1\t3856\t0\t7642\t99.974100\n")
-        f.write("2\trooA\t1\t386\tAtha5Chr4_Pals_Piler_3589_69_MAP_3\t1\t386\t6.3e-220\t758\t99.481900\n")
-        f.write("3\trooA\t7236\t7621\tAtha5Chr4_Pals_Piler_3536_69_MAP_3\t1\t386\t6.3e-220\t758\t99.481900\n")
-        f.write("4\trooA\t387\t7235\tAtha5Chr4_Pals_Piler_3596_69_MAP_3\t1\t6849\t0\t13580\t99.985400\n")
-        f.write("5\taurora-element\t4046\t4257\tAtha5Chr4_Pals_Piler_3540_69_MAP_3\t1\t204\t6.1e-80\t300\t96.568600\n")
-        f.write("6\taurora-element\t274\t381\tAtha5Chr4_Pals_Piler_3595_23_MAP_3\t177\t284\t0\t191\t97.222200\n")
-        f.write("6\taurora-element\t116\t287\tAtha5Chr4_Pals_Piler_3595_30_MAP_3\t3\t170\t0\t290\t98.809500\n")
-        f.write("7\taurora-element\t393\t902\tAtha5Chr4_Pals_Piler_3595_31_MAP_3\t1467\t1945\t0\t873\t97.244100\n")
-        f.write("7\taurora-element\t1387\t2271\tAtha5Chr4_Pals_Piler_3595_31_MAP_3\t276\t10780\t0\t1576\t97.624400\n")
-        f.write("8\taurora-element\t2486\t2828\tAtha5Chr4_Pals_Piler_3595_50_MAP_3\t4301\t4641\t0\t585\t97.360700\n")
-        f.write("9\taurora-element\t2265\t2483\tAtha5Chr4_Pals_Piler_3595_62_MAP_3\t3999\t4218\t0\t361\t96.347000\n")
-        f.write("10\taurora-element\t2834\t4045\tAtha5Chr4_Pals_Piler_3595_69_MAP_3\t4800\t6011\t0\t2074\t97.024800\n")
-        f.write("11\taurora-element\t2\t113\tAtha5Chr4_Pals_Piler_3598_69_MAP_3\t205\t317\t8.5e-37\t157\t93.750000\n")
-        f.close()
-        
-        self.assertTrue(FileUtils.are2FilesIdentical(expPathFile, obsPathFile))
-        
-        os.remove(pathFile)
-        os.remove(expPathFile)
-        os.remove(obsPathFile)
-        
-        
-    def test_getPathListWithoutDuplicatesOnQueryCoord(self):
-        iPath1 = Path(1, Range("qry1",398,491), Range("sbj1",10,112), 0.0, 10, 98.7)
-        iPath2 = Path(1, Range("qry1",451,492), Range("sbj1",124,169), 0.0, 10, 98.7)
-        iPath3 = Path(1, Range("qry1",451,492), Range("sbj1",249,294), 0.0, 10, 98.7)
-        lPaths = [iPath3, iPath2, iPath1]
-       
-        obslPaths = PathUtils.getPathListWithoutDuplicatesOnQueryCoord(lPaths)
-       
-        explPaths = [iPath1, iPath3]
-        
-        self.assertEquals(explPaths, obslPaths)
-        
-                
-    def _makePathListFromTupleList ( self, tupleList ):
-        pathList = []
-        for tuple in tupleList:
-            path = Path()
-            path.setFromTuple(tuple)
-            pathList.append(path)
-        return pathList
-    
-    def _makePathListFromStringList (self, stringList):
-        pathList = []
-        for string in stringList:
-            path = Path()
-            path.setFromString(string)
-            pathList.append(path)
-        return pathList
-    
-    def _show (self, list):
-        for item in list:
-            print item.toString()
-            
-            
-test_suite = unittest.TestSuite()
-test_suite.addTest( unittest.makeSuite( Test_PathUtils ) )
-if __name__ == "__main__":
-    unittest.TextTestRunner(verbosity=2).run( test_suite )
--- a/commons/core/coord/test/Test_Range.py	Mon Apr 29 03:26:07 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,698 +0,0 @@
-# Copyright INRA (Institut National de la Recherche Agronomique)
-# http://www.inra.fr
-# http://urgi.versailles.inra.fr
-#
-# This software is governed by the CeCILL license under French law and
-# abiding by the rules of distribution of free software.  You can  use, 
-# modify and/ or redistribute the software under the terms of the CeCILL
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# "http://www.cecill.info". 
-#
-# As a counterpart to the access to the source code and  rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty  and the software's author,  the holder of the
-# economic rights,  and the successive licensors  have only  limited
-# liability. 
-#
-# In this respect, the user's attention is drawn to the risks associated
-# with loading,  using,  modifying and/or developing or reproducing the
-# software by the user in light of its specific status of free software,
-# that may mean  that it is complicated to manipulate,  and  that  also
-# therefore means  that it is reserved for developers  and  experienced
-# professionals having in-depth computer knowledge. Users are therefore
-# encouraged to load and test the software's suitability as regards their
-# requirements in conditions enabling the security of their systems and/or 
-# data to be ensured and,  more generally, to use and operate it in the 
-# same conditions as regards security. 
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL license and that you accept its terms.
-
-
-import unittest
-from commons.core.coord.Range import Range
-from commons.core.coord.Range import getBin, getIdx
-
-
-class Test_Range( unittest.TestCase ):
-    
-    def setUp(self):
-        self._range = Range()
-        
-    def test_setFromString(self):
-        line = "chunk1\t190000\t390000"
-        self._range.setFromString( line )
-        self.assertEqual( self._range.seqname, "chunk1" )
-        self.assertEqual( self._range.start, 190000 )
-        self.assertEqual( self._range.end, 390000 )
-        
-        line = "chunk1\t190000\t390000\n"
-        self._range.setFromString( line )
-        self.assertEqual( self._range.seqname, "chunk1" )
-        self.assertEqual( self._range.start, 190000 )
-        self.assertEqual( self._range.end, 390000 )
-        
-        line = "chunk1;190000;390000"
-        self._range.setFromString( line, ";" )
-        self.assertEqual( self._range.seqname, "chunk1" )
-        self.assertEqual( self._range.start, 190000 )
-        self.assertEqual( self._range.end, 390000 )
-        
-    def test_setFromTuple(self):
-        tuple = ("chunk1","190000","390000")
-        self._range.setFromTuple( tuple)
-        
-        self.assertEqual( self._range.seqname, "chunk1" )
-        self.assertEqual( self._range.start, 190000 )
-        self.assertEqual( self._range.end, 390000 )
-        
-    def test___eq__(self):
-        self._range.setFromString( "chunk1\t190000\t390000\n" )
-        o = Range()
-        o.setFromString( "chunk1\t190000\t390000\n" )
-        self.assertEqual( self._range, o )
-        
-        o.setFromString( "chunk1\t190000\t39" )
-        self.assertNotEquals( self._range, o )
-        
-        o.setFromString( "chromosome1\t190000\t390000" )
-        self.assertNotEquals( self._range, o )
-        
-        o.setFromString( "chunk1\t390000\t190000" )
-        self.assertNotEquals( self._range, o )
-        
-        o.setFromString( "chromosome1\t390000\t190000" )
-        self.assertNotEquals( self._range, o )
-        
-    def test_getMin(self):
-        self._range.setFromTuple( ("chunk1", 190000, 390000) )
-        expMin = 190000
-        obsMin = self._range.getMin() 
-        self.assertTrue(expMin, obsMin)
-        
-    def test_getMax(self):
-        self._range.setFromTuple( ("chunk1", 190000, 390000) )
-        expMax = 390000
-        obsMax = self._range.getMax() 
-        self.assertTrue(expMax, obsMax)
-        
-    def test_isOnDirectStrand_true(self):
-        self._range.setFromTuple( ("chunk1", 190000, 390000) )
-        self.assertTrue(self._range.isOnDirectStrand())
-        
-    def test_isOnDirectStrand_false(self):
-        self._range.setFromTuple( ("chunk1", 390000, 190000) )
-        self.assertFalse(self._range.isOnDirectStrand())
-        
-    def test_isOnReverseStrand_true(self):
-        self._range.setFromTuple( ("chunk1", 390000, 190000) )
-        self.assertTrue(self._range.isOnReverseStrand())
-        
-    def test_isOnReverseStrand_false(self):
-        self._range.setFromTuple( ("chunk1", 190000, 390000) )
-        self.assertFalse(self._range.isOnReverseStrand())
-        
-    def test_getStrand_direct(self):
-        self._range.setFromTuple( ("chunk1", 190000, 390000) )
-        expStrand = '+'
-        obsStrand = self._range.getStrand()
-        self.assertEqual(expStrand, obsStrand)
-        
-    def test_getStrand_reverse(self):
-        self._range.setFromTuple( ("chunk1", 390000, 190000) )
-        expStrand = '-'
-        obsStrand = self._range.getStrand()
-        self.assertEqual(expStrand, obsStrand)
-        
-    def test_reverse(self):
-        obsRange = Range("chunk1", 190000, 390000)
-        expRange = Range("chunk1", 390000, 190000)
-        obsRange.reverse()
-        self.assertEquals(expRange, obsRange)
-        
-    def test_getLength(self):
-        self._range.setFromTuple( ("chunk1", 190000, 390000) )
-        expLength = 200001 
-        obsLength = self._range.getLength()
-        self.assertEquals(expLength, obsLength)
-        
-    def test_isEmpty_true( self ):
-        exp = True
-        obs = self._range.isEmpty()
-        self.assertEquals( exp, obs )
-        
-    def test_isEmpty_false( self ):
-        self._range.setFromTuple( ( "seq1", 1, 10 ) )
-        exp = False
-        obs = self._range.isEmpty()
-        self.assertEquals( exp, obs )
-        
-    def test_merge_diff_sequences( self ):
-        self._range.setFromTuple( ( "seq1", 6, 10 ) )
-        range2 = Range( "seq2", 6, 12 )
-        expReturn = None
-        expRange = Range( "seq1", 6, 10 )
-        obsReturn = self._range.merge( range2 )
-        obsRange = self._range
-        self.assertEquals( expReturn, obsReturn )
-        self.assertEquals( expRange, obsRange )
-        
-    def test_merge_no_overlapping_ranges( self ):
-        self._range.setFromTuple( ( "seq1", 6, 10 ) )
-        range2 = Range( "seq1", 12, 20 )
-        expReturn = None
-        expRange = Range( "seq1", 6, 20 )
-        obsReturn = self._range.merge( range2 )
-        obsRange = self._range
-        self.assertEquals( expReturn, obsReturn )
-        self.assertEquals( expRange, obsRange )
-        
-    def test_merge_no_overlapping_ranges_range1_on_neg_strand( self ):
-        self._range.setFromTuple( ( "seq1", 10, 6 ) )
-        range2 = Range( "seq1", 12, 20 )
-        expReturn = None
-        expRange = Range( "seq1", 20, 6 )
-        obsReturn = self._range.merge( range2 )
-        obsRange = self._range
-        self.assertEquals( expReturn, obsReturn )
-        self.assertEquals( expRange, obsRange )
-        
-    def test_merge_overlapping_ranges_range1_and_range2_on_neg_strand( self ):
-        self._range.setFromTuple( ( "seq1", 10, 6 ) )
-        range2 = Range( "seq1", 20, 12 )
-        expReturn = None
-        expRange = Range( "seq1", 20, 6 )
-        obsReturn = self._range.merge( range2 )
-        obsRange = self._range
-        self.assertEquals( expReturn, obsReturn )
-        self.assertEquals( expRange, obsRange )
-        
-    def test_merge_on_overlapping_ranges_range1_and_range2( self ):
-        self._range.setFromTuple( ( "seq1", 6, 10 ) )
-        range2 = Range( "seq1", 8, 20 )
-        expReturn = None
-        expRange = Range( "seq1", 6, 20 )
-        obsReturn = self._range.merge( range2 )
-        obsRange = self._range
-        self.assertEquals( expReturn, obsReturn )
-        self.assertEquals( expRange, obsRange )
-        
-    def test_isOverlapping_diff_sequences( self ):
-        self._range.setFromTuple( ( "seq1", 6, 10 ) )
-        r2 = Range( "seq2", 6, 10 )
-        exp = False
-        obs = self._range.isOverlapping( r2 )
-        self.assertEquals( exp, obs )
-        
-    def test_isOverlapping_no( self ):
-        self._range.setFromTuple( ( "seq1", 6, 10 ) )
-        r2 = Range( "seq1", 16, 20 )
-        exp = False
-        obs = self._range.isOverlapping( r2 )
-        self.assertEquals( exp, obs )
-        
-    def test_isOverlapping_yes( self ):
-        self._range.setFromTuple( ( "seq1", 6, 10 ) )
-        r2 = Range( "seq1", 1, 15 )
-        exp = True
-        obs = self._range.isOverlapping( r2 )
-        self.assertEquals( exp, obs )
-        
-    def test_isOverlapping_yes_range2_on_neg_strand( self ):
-        self._range.setFromTuple( ( "seq1", 6, 10 ) )
-        r2 = Range( "seq1", 15, 1 )
-        exp = True
-        obs = self._range.isOverlapping( r2 )
-        self.assertEquals( exp, obs )
-        
-    def test_isOverlapping_range1_before_range2( self ):
-        self._range.setFromTuple( ( "seq1", 6, 10 ) )
-        r2 = Range( "seq1", 8, 15 )
-        exp = True
-        obs = self._range.isOverlapping( r2 )
-        self.assertEquals( exp, obs )
-        
-    def test_isOverlapping_range1_after_range2( self ):
-        self._range.setFromTuple( ( "seq1", 6, 10 ) )
-        r2 = Range( "seq1", 1, 8 )
-        exp = True
-        obs = self._range.isOverlapping( r2 )
-        self.assertEquals( exp, obs )
-        
-    def test_isOverlapping_range1_equal_range2( self ):
-        self._range.setFromTuple( ( "seq1", 6, 10 ) )
-        r2 = Range( "seq1", 6, 10 )
-        exp = True
-        obs = self._range.isOverlapping( r2 )
-        self.assertEquals( exp, obs )
-        
-    def test_isOverlapping_yes_edges_left( self ):
-        self._range.setFromTuple( ( "seq1", 6, 10 ) )
-        r2 = Range( "seq1", 1, 6 )
-        exp = True
-        obs = self._range.isOverlapping( r2 )
-        self.assertEquals( exp, obs )
-        
-    def test_isOverlapping_yes_edges_right( self ):
-        self._range.setFromTuple( ( "seq1", 6, 10 ) )
-        r2 = Range( "seq1", 10, 20 )
-        exp = True
-        obs = self._range.isOverlapping( r2 )
-        self.assertEquals( exp, obs )
-        
-    def test_isOverlapping_yes_one_nt( self ):
-        self._range.setFromTuple( ( "seq1", 10, 10 ) )
-        r2 = Range( "seq1", 10, 20 )
-        exp = True
-        obs = self._range.isOverlapping( r2 )
-        self.assertEquals( exp, obs )
-        
-    def test_isOverlapping_yes_span_1( self ):
-        self._range.setFromTuple( ( "seq1", 10, 100 ) )
-        r2 = Range( "seq1", 5, 110 )
-        exp = True
-        obs = self._range.isOverlapping( r2 )
-        self.assertEquals( exp, obs )
-        
-    def test_isOverlapping_yes_span_2( self ):
-        self._range.setFromTuple( ( "seq1", 5, 110 ) )
-        r2 = Range( "seq1", 10, 100 )
-        exp = True
-        obs = self._range.isOverlapping( r2 )
-        self.assertEquals( exp, obs )
-        
-    def test_isOverlapping_yes_include_1( self ):
-        self._range.setFromTuple( ( "seq1", 10, 100 ) )
-        r2 = Range( "seq1", 15, 90 )
-        exp = True
-        obs = self._range.isOverlapping( r2 )
-        self.assertEquals( exp, obs )
-        
-    def test_isOverlapping_yes_include_2( self ):
-        self._range.setFromTuple( ( "seq1", 15, 90 ) )
-        r2 = Range( "seq1", 10, 100 )
-        exp = True
-        obs = self._range.isOverlapping( r2 )
-        self.assertEquals( exp, obs )
-        
-    def test_getOverlapLength_on_different_range( self ):
-        range1 = Range( "chunk1", 190000, 390000 )
-        range2 = Range( "chunk2", 290000, 590000 )
-        expSize = 0
-        obsSize = range1.getOverlapLength( range2 )
-        self.assertEquals( expSize, obsSize )
-        
-        
-    def test_getOverlapLength_on_no_overalping_range( self ):
-        range1 =Range( "chunk1", 190000, 390000 )
-        range2 =Range( "chunk1", 490000, 590000 )
-        expSize = 0
-        obsSize = range1.getOverlapLength( range2 )
-        self.assertEquals( expSize, obsSize )
-        
-        
-    def test_getOverlapLength_range2_included_in_range1( self ):
-        range1 = Range( "chunk1", 19, 39 )
-        range2 = Range( "chunk1", 22, 25 )
-        expSize = 4
-        obsSize = range1.getOverlapLength( range2 )
-        self.assertEquals( expSize, obsSize )
-        obsSize = range2.getOverlapLength( range1 )
-        self.assertEquals( expSize, obsSize )
-        
-        
-    def test_getOverlapLength_range1_included_in_range2( self ):
-        range1 = Range( "chunk1", 220000, 250000 )
-        range2 = Range( "chunk1", 190000, 390000 )
-        expSize = 30001
-        obsSize = range1.getOverlapLength( range2 )
-        self.assertEquals( expSize, obsSize )
-        
-        
-    def test_getOverlapLength_range1_before_range2( self ):
-        range1 = Range( "chunk1", 190000, 390000 )
-        range2 = Range( "chunk1", 290000, 590000 )
-        expSize = 100001
-        obsSize = range1.getOverlapLength( range2 )
-        self.assertEquals( expSize, obsSize )
-        
-        
-    def test_getOverlapLength_range1_after_range2( self ):
-        range1 = Range( "chunk1", 390000, 790000 )
-        range2 = Range( "chunk1", 290000, 590000 )
-        expSize = 200001
-        obsSize = range1.getOverlapLength( range2 )
-        self.assertEquals( expSize, obsSize )
-        
-        
-    def test_isIncludedIn( self ):
-        iRange1 = Range( "chunk1", 21, 30 )
-        iRange2 = Range( "chunk1", 11, 40 )
-        self.assertTrue( iRange1.isIncludedIn( iRange2 ) )
-        
-        
-    def test_isIncludedIn_diffStrand( self ):
-        iRange1 = Range( "chunk1", 21, 30 )
-        iRange2 = Range( "chunk1", 40, 11 )
-        self.assertTrue( iRange1.isIncludedIn( iRange2 ) )
-        
-        
-    def test_isIncludedIn_onlyOverlap( self ):
-        iRange1 = Range( "chunk1", 21, 50 )
-        iRange2 = Range( "chunk1", 11, 40 )
-        self.assertFalse( iRange1.isIncludedIn( iRange2 ) )
-        
-        
-    def test_isIncludedIn_diffSeqname( self ):
-        iRange1 = Range( "chunk1", 21, 30 )
-        iRange2 = Range( "chunk2", 11, 40 )
-        self.assertFalse( iRange1.isIncludedIn( iRange2 ) )
-        
-        
-    def test_getDistance_on_overlapping_range(self):
-        overlapTuple1 = ("chunk1", 220000, 250000)
-        overlapRange1 = Range()
-        overlapRange1.setFromTuple(overlapTuple1)
-        
-        overlapTuple2 = ("chunk1", 190000, 390000)
-        overlapRange2 = Range()
-        overlapRange2.setFromTuple(overlapTuple2)
-        
-        expDistance = 0
-        obsDistance = overlapRange1.getDistance(overlapRange2)
-        
-        self.assertEquals(expDistance, obsDistance)
-        
-    def test_getDistance_on_range1_on_plus_strand_included_in_range2_on_neg_strand(self):
-        tuple1 = ("chunk1", 220000, 250000)
-        range1 = Range()
-        range1.setFromTuple(tuple1)
-        
-        tuple2 = ("chunk1", 390000, 190000)
-        range2 = Range()
-        range1.setFromTuple(tuple2)
-        
-        expDistance = -1
-        obsDistance = range1.getDistance(range2)
-        
-        self.assertEquals(expDistance, obsDistance)
-        
-    def test_getDistance_range1_after_range2(self):
-        tuple1 = ("chunk1", 390000, 590000)
-        range1 = Range()
-        range1.setFromTuple(tuple1)
-        
-        tuple2 = ("chunk1", 190000, 290000)
-        range2 = Range()
-        range2.setFromTuple(tuple2)
-        
-        expDistance = 100000
-        obsDistance = range1.getDistance(range2)
-        
-        self.assertEquals(expDistance, obsDistance)
-        
-    def test_getDistance_range1_before_range2(self):
-        tuple1 = ("chunk1", 190000, 290000)
-        range1 = Range()
-        range1.setFromTuple(tuple1)
-        
-        tuple2 = ("chunk1", 390000, 590000)
-        range2 = Range()
-        range2.setFromTuple(tuple2)
-        
-        expDistance = 100000
-        obsDistance = range1.getDistance(range2)
-        
-        self.assertEquals(expDistance, obsDistance)
-        
-    def test_getDistance_range1_after_range2_both_on_neg_strand(self):   
-        tuple1 = ("chunk1", 590000, 390000)
-        range1 = Range()
-        range1.setFromTuple(tuple1)
-        
-        tuple2 = ("chunk1", 290000, 190000)
-        range2 = Range()
-        range2.setFromTuple(tuple2)
-        
-        expDistance = 100000
-        obsDistance = range1.getDistance(range2)
-        
-        self.assertEquals(expDistance, obsDistance)
-        
-    def test_getDistance_range1_before_range2_both_on_neg_strand(self):   
-        tuple1 = ("chunk1", 290000, 190000)
-        range1 = Range()
-        range1.setFromTuple(tuple1)
-        
-        tuple2 = ("chunk1", 590000, 390000)
-        range2 = Range()
-        range2.setFromTuple(tuple2)
-        
-        expDistance = 100000
-        obsDistance = range1.getDistance(range2)
-        
-        self.assertEquals(expDistance, obsDistance)
-        
-    def test_diff_on_no_overlapping_range(self):
-        range1 = Range("chunk1", 190000, 390000)
-        range2 = Range("chunk1", 490000, 590000)
-        
-        expRange1 = Range("chunk1",190000,390000)
-        expReturnedRange = Range("chunk1")
-        
-        obsReturnedRange = range1.diff(range2)
-        obsRange1 = range1
-        
-        self.assertEquals(expRange1, obsRange1)
-        self.assertEquals(expReturnedRange, obsReturnedRange)
-        
-    def test_diff_on_different_chunks(self):
-        range1 = Range("chunk1", 190000, 390000)
-        range2 = Range("chunk2", 290000, 590000)
-        
-        expRange1 = Range("chunk1", 190000, 390000)
-        expReturnedRange = Range("chunk1")
-        
-        obsReturnedRange = range1.diff(range2)
-        obsRange1 = range1
-        
-        self.assertEquals(expRange1, obsRange1)
-        self.assertEquals(expReturnedRange, obsReturnedRange)
-        
-    def test_diff_range1_before_range2(self):
-        range1 = Range("chunk1", 190000, 390000)
-        range2 = Range("chunk1", 290000, 590000)
-        
-        expRange1 = Range("chunk1", 190000, 289999)
-        expReturnedRange = Range("chunk1")
-        
-        obsReturnedRange = range1.diff(range2)
-        obsRange1 = range1
-        
-        self.assertEquals(expRange1, obsRange1)
-        self.assertEquals(expReturnedRange, obsReturnedRange)
-        
-    def test_diff_range1_before_range2_range1_on_neg_strand(self):
-        range1 = Range("chunk1", 390000, 190000)
-        range2 = Range("chunk1", 290000, 590000)
-        
-        expRange1 = Range("chunk1", 289999, 190000)
-        expReturnedRange = Range("chunk1")
-        
-        obsReturnedRange = range1.diff(range2)
-        obsRange1 = range1
-        
-        self.assertEquals(expRange1, obsRange1)
-        self.assertEquals(expReturnedRange, obsReturnedRange)
-        
-    def test_diff_range2_included_in_range1(self):
-        range1 = Range("chunk1", 190000, 590000)
-        range2 = Range("chunk1", 290000, 390000)
-        
-        expRange1 = Range("chunk1", 190000, 289999)
-        expReturnedRange = Range("chunk1", 390001, 590000)
-        
-        obsReturnedRange = range1.diff(range2)
-        obsRange1 = range1
-        
-        self.assertEquals(expRange1, obsRange1)
-        self.assertEquals(expReturnedRange, obsReturnedRange)
-        
-    def test_diff_range2_included_in_range1_range1_on_reverse_strand(self):
-        range1 = Range("chunk1", 590000, 190000)
-        range2 = Range("chunk1", 290000, 390000)
-        
-        expRange1 = Range("chunk1", 289999, 190000)
-        expReturnedRange = Range("chunk1", 590000, 390001)
-        
-        obsReturnedRange = range1.diff(range2)
-        obsRange1 = range1
-        
-        self.assertEquals(expRange1, obsRange1)
-        self.assertEquals(expReturnedRange, obsReturnedRange)
-        
-    def test_diff_range1_included_in_range2(self):
-        range1 = Range("chunk1", 390000, 490000)
-        range2 = Range("chunk1", 290000, 590000)
-        
-        expRange1 = Range("chunk1",0,0)
-        expReturnedRange = Range("chunk1")
-        
-        obsReturnedRange = range1.diff(range2)
-        obsRange1 = range1
-        
-        self.assertEquals(expRange1, obsRange1)
-        self.assertEquals(expReturnedRange, obsReturnedRange)
-        
-    def test_diff_range1_after_range2(self):
-        range1 = Range("chunk1", 390000, 590000)
-        range2 = Range("chunk1", 290000, 490000)
-        
-        expRange1 = Range("chunk1", 490001, 590000)
-        expReturnedRange = Range("chunk1")
-        
-        obsReturnedRange = range1.diff(range2)
-        obsRange1 = range1
-        
-        self.assertEquals(expRange1, obsRange1)
-        self.assertEquals(expReturnedRange, obsReturnedRange)
-        
-    def test_diff_range1_after_range2_range1_on_neg_strand(self):
-        range1 = Range("chunk1", 590000, 390000)
-        range2 = Range("chunk1", 290000, 490000)
-        
-        expRange1 = Range("chunk1", 590000, 490001)
-        expReturnedRange = Range("chunk1")
-        
-        obsReturnedRange = range1.diff(range2)
-        obsRange1 = range1
-        
-        self.assertEquals(expRange1, obsRange1)
-        self.assertEquals(expReturnedRange, obsReturnedRange)
-        
-    def test_getIdx(self):
-        self.assertEqual(getIdx(1000,3),1000001)
-        self.assertEqual(getIdx(999,3),1000000)
-        self.assertEqual(getIdx(2000,3),1000002)
-        self.assertEqual(getIdx(2000,4),2000000)
-        self.assertEqual(getIdx(2000,5),3000000)
-        self.assertEqual(getIdx(20000000,6),4000000)
-        self.assertEqual(getIdx(20000000,5),3000200)
-        self.assertEqual(getIdx(20000000,4),2002000)
-        self.assertEqual(getIdx(20000000,3),1020000)
-        
-    def test_getBin_bin_level_9(self):
-        tuple1 = ("chunk1", 190000000, 390000000)
-        range1 =Range()
-        range1.setFromTuple(tuple1)
-        
-        expRes = 100000000.0
-        obsRes = range1.getBin()
-        
-        self.assertEquals(expRes, obsRes)
-        
-    def test_getBin_bin_level_8(self):
-        tuple1 = ("chunk1", 19000000, 39000000)
-        range1 =Range()
-        range1.setFromTuple(tuple1)
-        
-        expRes = 100000000.0
-        obsRes = range1.getBin()
-        
-        self.assertEquals(expRes, obsRes)
-        
-    def test_getBin_bin_level_7(self):
-        tuple1 = ("chunk1", 1900000, 3900000)
-        range1 =Range()
-        range1.setFromTuple(tuple1)
-        
-        expRes = 10000000.0
-        obsRes = range1.getBin()
-        
-        self.assertEquals(expRes, obsRes)
-        
-    def test_getBin_bin_level_6(self):
-        tuple1 = ("chunk1", 190000, 390000)
-        range1 =Range()
-        range1.setFromTuple(tuple1)
-        
-        expRes = 1000000.0
-        obsRes = range1.getBin()
-        
-        self.assertEquals(expRes, obsRes)
-        
-    def test_getBin_bin_level_5(self):
-        tuple = ("chunk1", 19000, 39000)
-        range =Range()
-        range.setFromTuple(tuple)
-        expRes = 100000.0
-        obsRes = range.getBin()
-        
-        self.assertEquals(expRes, obsRes)
-        
-    def test_getBin_bin_level_4(self):
-        tuple = ("chunk1", 1900, 3900)
-        range =Range()
-        range.setFromTuple(tuple)
-        
-        expRes = 10000.0
-        obsRes = range.getBin()
-        
-        self.assertEquals(expRes, obsRes)
-        
-    def test_getBin_bin_level_3(self):
-        tuple = ("chunk1", 190, 390)
-        range =Range()
-        range.setFromTuple(tuple)
-        
-        expRes = 1000.0
-        obsRes = range.getBin()
-        
-        self.assertEquals(expRes, obsRes)
-        
-    def test_getBin_bin_level_2(self):
-        tuple = ("chunk1", 19, 39)
-        range =Range()
-        range.setFromTuple(tuple)
-        
-        expRes = 1000.0
-        obsRes = range.getBin()
-        
-        self.assertEquals(expRes, obsRes)
-        
-    def test_getBin_bin_level_1(self):
-        tuple = ("chunk1", 1, 3)
-        range =Range()
-        range.setFromTuple(tuple)
-        
-        expRes = 1000.0
-        obsRes = range.getBin()
-        
-        self.assertEquals(expRes, obsRes)
-        
-        
-    def test_getBin_function(self):
-        expBin = 2L
-        obsBin = getBin(200, 2)
-        
-        self.assertEquals(expBin, obsBin)
-        
-    def test_findIdx(self):
-        o = Range()
-        o.setFromString( "chunk1\t1000\t2000\n" )
-        self.assertEqual(o.findIdx(),2000000)
-        
-        o.setFromString( "chunk1\t2000\t1000\n" )       
-        self.assertEqual(o.findIdx(),2000000)
-        
-        o.setFromString( "chunk1\t200\t999\n" )       
-        self.assertEqual(o.findIdx(),1000000)
-        
-        o.setFromString( "chunk1\t1\t20000000\n" )       
-        self.assertEqual(o.findIdx(),4000000)
-        
-        
-test_suite = unittest.TestSuite()
-test_suite.addTest( unittest.makeSuite( Test_Range ) )
-if __name__ == "__main__":
-    unittest.TextTestRunner(verbosity=2).run( test_suite )
--- a/commons/core/coord/test/Test_Set.py	Mon Apr 29 03:26:07 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,282 +0,0 @@
-# Copyright INRA (Institut National de la Recherche Agronomique)
-# http://www.inra.fr
-# http://urgi.versailles.inra.fr
-#
-# This software is governed by the CeCILL license under French law and
-# abiding by the rules of distribution of free software.  You can  use, 
-# modify and/ or redistribute the software under the terms of the CeCILL
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# "http://www.cecill.info". 
-#
-# As a counterpart to the access to the source code and  rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty  and the software's author,  the holder of the
-# economic rights,  and the successive licensors  have only  limited
-# liability. 
-#
-# In this respect, the user's attention is drawn to the risks associated
-# with loading,  using,  modifying and/or developing or reproducing the
-# software by the user in light of its specific status of free software,
-# that may mean  that it is complicated to manipulate,  and  that  also
-# therefore means  that it is reserved for developers  and  experienced
-# professionals having in-depth computer knowledge. Users are therefore
-# encouraged to load and test the software's suitability as regards their
-# requirements in conditions enabling the security of their systems and/or 
-# data to be ensured and,  more generally, to use and operate it in the 
-# same conditions as regards security. 
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL license and that you accept its terms.
-
-
-import unittest
-import os
-from commons.core.coord.Set import Set
-from commons.core.coord.Map import Map
-
-
-class Test_Set( unittest.TestCase ):
-    
-    def test__eq__sets_equals(self):
-        set1 = Set( 1, "set1", "seq1", 1, 2 )
-        set2 = Set( 1, "set1", "seq1", 1 ,2 )   
-        self.assertEquals( set1, set2 )
-        
-    def test__eq__sets_not_equals_ids(self):
-        set1 = Set( 1, "set1", "seq1", 1, 2 )
-        set2 = Set( 2, "set1", "seq1", 1 ,2 )   
-        self.assertNotEquals( set1, set2 )
-        
-    def test__eq__sets_not_equals_name(self):
-        set1 = Set( 1, "set1", "seq1", 1, 2 )
-        set2 = Set( 1, "set2", "seq1", 1 ,2 )   
-        self.assertNotEquals( set1, set2 )
-    
-    def test__eq__on_empty_set(self):
-        set1 = Set()
-        set2 = Set()
-        self.assertEquals( set1, set2 )
-        
-    def test_setFromTuple_equals_instances(self):
-        tuple = ( 1, "set1", "seq1", 1, 2 )
-        obsSet = Set()
-        obsSet.setFromTuple(tuple)
-        expSet = Set( 1, "set1", "seq1", 1, 2 )
-        self.assertEquals( expSet, obsSet )
-   
-    def test_setFromTuple_not_equals_instances(self):
-        tuple = ( 1, "set1", "seq1", 1, 2 )
-        obsSet = Set()
-        obsSet.setFromTuple(tuple)
-        expSet = Set( 2, "set1", "seq1", 1, 2 )
-        self.assertNotEquals( expSet, obsSet )
-        
-    def test_read_empty_line_file(self):
-        fileName = "dummyFile"
-        
-        os.system(" touch " + fileName)
-        
-        fileHandler = open(fileName, "r")
-        
-        obsSet = Set()
-        
-        obsRes = obsSet.read( fileHandler )
-        expRes = 0
-        
-        fileHandler.close()
-        os.remove(fileName)
-        
-        self.assertEquals( expRes, obsRes )
-
-    def test_read_one_line_file(self):
-        line = ( "1\tset1\tseq1\t1\t2" )
-        fileName = "dummyFile"
-        
-        fileHandler = open( fileName, "w" )
-        fileHandler.write( line )
-        fileHandler.close()
-        
-        fileHandler = open( fileName, "r" )
-        
-        tuple = line.split("\t")
-        expSet = Set()
-        expSet.setFromTuple(tuple)
-        
-        obsSet = Set()
-        
-        expRes = 1
-        obsRes = obsSet.read(fileHandler)
-        
-        fileHandler.close()
-        os.remove(fileName)
-        self.assertEquals( expRes, obsRes )
-        self.assertEquals( expSet, obsSet ) 
-        
-    def test_read_two_line_file(self):
-        line1 = ( "1\tset1\tseq1\t1\t2\n" )
-        line2 = ( "2\tset2\tseq2\t3\t4" )
-        fileName = "dummyFile"
-        
-        fileHandler = open( fileName, "w" )
-        fileHandler.write( line1 )
-        fileHandler.write( line2 )
-        fileHandler.close()
-        
-        tuple1 = line1.split("\t")
-        tuple2 = line2.split("\t")
-        
-        expSet1 = Set()
-        expSet2 = Set()
-        
-        expSet1.setFromTuple(tuple1)
-        expSet2.setFromTuple(tuple2)
-        
-        expSetList = [ expSet1, expSet2 ]
-        expResList = [ 1, 1 ]
-        
-        fileHandler = open( fileName, "r" )
-        
-        obsSet1 = Set()
-        obsSet2 = Set()
-
-        obsRes1 = obsSet1.read(fileHandler)
-        obsRes2 = obsSet2.read(fileHandler)
-        
-        obsSetList= [ obsSet1, obsSet2 ]
-        obsResList = [ obsRes1, obsRes2 ]
-        
-        fileHandler.close()
-        os.remove(fileName)
-        
-        self.assertEquals( expSetList, obsSetList )
-        self.assertEquals( expResList, obsResList )
-        
-    def test_merge_first_id_greater_than_second_id(self):
-        firstSet = Set( 2, "set1", "seq1", 10, 40 )
-        secondSet = Set( 1, "set2", "seq1", 20, 60 )
-        
-        firstSet.merge( secondSet )
-        
-        expSet = Set( 1, "set1", "seq1", 10, 60)
-        obsSet = firstSet
-        
-        self.assertEquals( expSet, obsSet)
-        
-    def test_merge_first_id_smaller_than_second_id(self):
-        firstSet = Set( 1, "set1", "seq1", 10, 40 )
-        secondSet = Set( 2, "set2", "seq1", 20, 60 )
-        
-        firstSet.merge( secondSet )
-        
-        expSet = Set( 1, "set1", "seq1", 10, 60)
-        obsSet = firstSet
-        
-        self.assertEquals( expSet, obsSet)
-
-    def test_merge_first_id_equals_second_id(self):
-        firstSet = Set( 1, "set1", "seq1", 10, 40 )
-        secondSet = Set( 1, "set2", "seq1", 20, 60 )
-        
-        firstSet.merge( secondSet )
-        
-        expSet = Set( 1, "set1", "seq1", 10, 60)
-        obsSet = firstSet
-        
-        self.assertEquals( expSet, obsSet)
-    
-    def test_merge_different_seqnames(self):
-        firstSet = Set( 2, "set1", "seq1", 10, 40 )
-        secondSet = Set( 1, "set1", "seq2", 20, 60 )
-        expSet = Set( 2, "set1", "seq1", 10, 40 )
-        firstSet.merge( secondSet )
-        obsSet = firstSet
-        self.assertEquals( expSet, obsSet )
-        
-    def test_diff_on_empty_sets(self):
-        firstSet = Set()
-        firstSet.seqname = "seq1"
-        secondSet = Set()
-        secondSet.seqname = "seq2"
-        
-        obsSet = firstSet.diff( secondSet )
-        expSet = Set()
-        
-        self.assertEquals( expSet, obsSet )
-    
-    def test_diff(self):
-        firstSet = Set( 2, "set1", "seq1", 10, 80 )
-        secondSet = Set( 1, "set2", "seq1", 20, 60 )
-        
-        expSet1 = Set( 2, "set1", "seq1", 10, 19 )
-        expSet2 = Set( 2, "set1", "seq1", 61, 80 )        
-        
-        obsSet2 = firstSet.diff( secondSet )
-        obsSet1 = firstSet
-                
-        self.assertEquals( expSet1, obsSet1 ) 
-        self.assertEquals( expSet2, obsSet2 )
-        
-    def test_diff_reverse(self):
-        firstSet = Set( 2, "set1", "seq1", 20, 60 )
-        secondSet = Set( 1, "set2", "seq1", 10, 80 )
-        
-        expSet1 = Set( 2, "set1", "seq1", 0, 0 )
-        expSet2 = Set( )        
-        
-        obsSet2 = firstSet.diff( secondSet )
-        obsSet1 = firstSet
-                
-        self.assertEquals( expSet1, obsSet1 ) 
-        self.assertEquals( expSet2, obsSet2 )
-        
-    def test_diff_list1_overlap_end_list2(self):
-        firstSet = Set( 2, "set1", "seq1", 20, 100 )
-        secondSet = Set( 1, "set2", "seq1", 10, 80 )
-        
-        expSet1 = Set( 2, "set1", "seq1", 81, 100 )  
-        expSet2 = Set( )             
-        
-        obsSet2 = firstSet.diff( secondSet )
-        obsSet1 = firstSet
-                
-        self.assertEquals( expSet1, obsSet1 ) 
-        self.assertEquals( expSet2, obsSet2 )
-        
-    def test_diff_with_empty_set1(self):
-        set2 = Set( 1, "set1", "seq1", 2, 45 )
-        set1 = Set( )
-        
-        expSet1 = Set( )
-        expSet2 = Set( )
-        
-        obsSet2 = set1.diff( set2 )
-        obsSet1 = set1
-        
-        self.assertEquals( expSet1, obsSet1 ) 
-        self.assertEquals( expSet2, obsSet2 )
-        
-    def test_diff_list2_overlap_end_list1(self):
-        firstSet = Set( 2, "set1", "seq1", 10, 70 )
-        secondSet = Set( 1, "set2", "seq1", 40, 100 )
-        
-        expSet1 = Set( 2, "set1", "seq1", 10, 39 )
-        expSet2 = Set( )        
-        
-        obsSet2 = firstSet.diff( secondSet )
-        obsSet1 = firstSet
-                
-        self.assertEquals( expSet1, obsSet1 ) 
-        self.assertEquals( expSet2, obsSet2 )
-        
-    def test_set2map(self):
-        set = Set( 1, "set", "seq", 1, 2 )
-        
-        expMap = Map( "set::1", "seq", 1, 2 )
-        obsMap = set.set2map()
-        
-        self.assertEquals( expMap, obsMap )
-    
-test_suite = unittest.TestSuite()
-test_suite.addTest( unittest.makeSuite( Test_Set ) )
-if __name__ == "__main__":
-    unittest.TextTestRunner(verbosity=2).run( test_suite )
--- a/commons/core/coord/test/Test_SetUtils.py	Mon Apr 29 03:26:07 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1689 +0,0 @@
-# Copyright INRA (Institut National de la Recherche Agronomique)
-# http://www.inra.fr
-# http://urgi.versailles.inra.fr
-#
-# This software is governed by the CeCILL license under French law and
-# abiding by the rules of distribution of free software.  You can  use, 
-# modify and/ or redistribute the software under the terms of the CeCILL
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# "http://www.cecill.info". 
-#
-# As a counterpart to the access to the source code and  rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty  and the software's author,  the holder of the
-# economic rights,  and the successive licensors  have only  limited
-# liability. 
-#
-# In this respect, the user's attention is drawn to the risks associated
-# with loading,  using,  modifying and/or developing or reproducing the
-# software by the user in light of its specific status of free software,
-# that may mean  that it is complicated to manipulate,  and  that  also
-# therefore means  that it is reserved for developers  and  experienced
-# professionals having in-depth computer knowledge. Users are therefore
-# encouraged to load and test the software's suitability as regards their
-# requirements in conditions enabling the security of their systems and/or 
-# data to be ensured and,  more generally, to use and operate it in the 
-# same conditions as regards security. 
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL license and that you accept its terms.
-
-
-import unittest
-import os
-import time
-from commons.core.coord.Set import Set
-from commons.core.coord.Map import Map
-from commons.core.coord.SetUtils import SetUtils
-from commons.core.utils.FileUtils import FileUtils
-
-
-class Test_SetUtils( unittest.TestCase ):
-    
-    def test_changeIdInList_on_empty_list(self):
-        lSets = []
-        SetUtils.changeIdInList( lSets , 1 )
-        obsLSets = lSets
-        expLSets = []
-        self.assertEquals( expLSets , obsLSets )
-        
-    def test_changeIdInList_on_list_size_one(self):
-        set1 = Set( 1, "set1", "seq1", 1, 2 )
-        lSets = [ set1 ]
-        SetUtils.changeIdInList( lSets , 9 )
-        obsLSets = lSets
-        set1 = Set( 9, "set1", "seq1", 1, 2 )
-        expLSets = [ set1 ]
-        self.assertEquals( expLSets , obsLSets )
-        
-    def test_changeIdInList(self):
-        set1 = Set( 1, "set1", "seq1", 1, 2 )
-        set2 = Set( 2, "set2", "seq2", 2, 3 )
-        lSets = [ set1, set2 ]
-        SetUtils.changeIdInList( lSets , 9 )
-        obsLSets = lSets
-        set1 = Set( 9, "set1", "seq1", 1, 2 )
-        set2 = Set( 9, "set2", "seq2", 2, 3 )
-        expLSets = [ set1, set2 ]
-        
-        self.assertEquals( expLSets , obsLSets )
-        
-    def test_getOverlapLengthBetweenLists_all_list_are_empty (self):
-        lSets1 = []
-        lSets2 = []
-        
-        expOverlapSize = 0
-        obsOverlapSize = SetUtils.getOverlapLengthBetweenLists( lSets1, lSets2 )
-        
-        self.assertEquals( expOverlapSize, obsOverlapSize )
-        
-    def test_getOverlapLengthBetweenLists_list1_empty_list2_size_one (self):
-        lSets1 = []
-        lSets2 = [ Set( 9, "set1", "seq1", 1, 2 ) ]
-        
-        expOverlapSize = 0
-        obsOverlapSize = SetUtils.getOverlapLengthBetweenLists( lSets1, lSets2 )
-        
-        self.assertEquals( expOverlapSize, obsOverlapSize )
-        
-    def test_getOverlapLengthBetweenLists_list1_empty_list2_size_two (self):
-        lSets1 = []
-        lSets2 = [ Set( 9, "set1", "seq1", 1, 2 ), Set( 9, "set2", "seq2", 2, 3 ) ]
-        
-        expOverlapSize = 0
-        obsOverlapSize = SetUtils.getOverlapLengthBetweenLists( lSets1, lSets2 )
-        
-        self.assertEquals( expOverlapSize, obsOverlapSize )
-        
-    def test_getOverlapLengthBetweenLists_list1_size_one_list2_empty (self):
-        lSets1 = [ Set( 9, "set1", "seq1", 1, 2 ) ]
-        lSets2 = []
-        
-        expOverlapSize = 0
-        obsOverlapSize = SetUtils.getOverlapLengthBetweenLists( lSets1, lSets2 )
-        
-        self.assertEquals( expOverlapSize, obsOverlapSize )
-        
-    def test_getOverlapLengthBetweenLists_list1_size_one_list2_size_one_without_overlapp (self):
-        lSets1 = [ Set( 1, "set1", "seq1", 1, 2 ) ]
-        lSets2 = [ Set( 2, "set2", "seq2", 2, 3 ) ]
-        
-        expOverlapSize = 0
-        obsOverlapSize = SetUtils.getOverlapLengthBetweenLists( lSets1, lSets2 )
-        
-        self.assertEquals( expOverlapSize, obsOverlapSize )
-        
-    def test_getOverlapLengthBetweenLists_list1_size_one_list2_size_one_with_overlap_size_1 (self):
-        lSets1 = [ Set( 1, "set1", "seq1", 1, 2 ) ]
-        lSets2 = [ Set( 2, "set1", "seq1", 2, 3 ) ]
-        
-        expOverlapSize = 1
-        obsOverlapSize = SetUtils.getOverlapLengthBetweenLists( lSets1, lSets2 )
-        
-        self.assertEquals( expOverlapSize, obsOverlapSize )
-        
-    def test_getOverlapLengthBetweenLists_list1_size_one_list2_size_one_with_overlap_size_2 (self):
-        lSets1 = [ Set( 1, "set1", "seq1", 1, 2 ) ]
-        lSets2 = [ Set( 2, "set1", "seq1", 1, 3 ) ]
-        
-        expOverlapSize = 2
-        obsOverlapSize = SetUtils.getOverlapLengthBetweenLists( lSets1, lSets2 )
-        
-        self.assertEquals( expOverlapSize, obsOverlapSize )
-        
-    def test_getOverlapLengthBetweenLists_list1_size_one_list2_size_two_without_overlap_sets_in_list1_greater_than_sets_in_list2 (self):
-        lSets1 = [ Set( 1, "set1", "seq1", 4, 6 ) ]
-        lSets2 = [ Set( 2, "set2", "seq1", 2, 3 ), Set( 3, "set3", "seq3", 1, 2 ) ]
-        
-        expOverlapSize = 0
-        obsOverlapSize = SetUtils.getOverlapLengthBetweenLists( lSets1, lSets2 )
-        
-        self.assertEquals( expOverlapSize, obsOverlapSize )
-        
-    def test_getOverlapLengthBetweenLists_list1_size_one_list2_size_two_with_overlap_sets_in_list1_greater_than_sets_in_list2 (self):
-        lSets1 = [ Set( 1, "set1", "seq1", 4, 6 ) ]
-        lSets2 = [ Set( 2, "set2", "seq2", 2, 3 ), Set( 3, "set3", "seq1", 4, 5 ) ]
-        
-        expOverlapSize = 2
-        obsOverlapSize = SetUtils.getOverlapLengthBetweenLists( lSets1, lSets2 )
-        
-        self.assertEquals( expOverlapSize, obsOverlapSize )
-        
-    def test_getOverlapLengthBetweenLists_list1_size_one_list2_size_two_with_overlap_on_redundant_position (self):
-        lSets1 = [ Set( 1, "set1", "seq1", 1, 2 ) ]
-        lSets2 = [ Set( 2, "set2", "seq1", 2, 3 ), Set( 3, "set1", "seq1", 1, 2 ) ]
-        
-        expOverlapSize = 3
-        obsOverlapSize = SetUtils.getOverlapLengthBetweenLists( lSets1, lSets2 )
-        
-        self.assertEquals( expOverlapSize, obsOverlapSize )
-        
-    def test_getOverlapLengthBetweenLists_list1_size_two_list2_empty (self):
-        lSets1 = [ Set( 1, "set1", "seq1", 1, 2 ), Set( 2, "set2", "seq2", 2, 3 ) ]
-        lSets2 = []
-        
-        expOverlapSize = 0
-        obsOverlapSize = SetUtils.getOverlapLengthBetweenLists( lSets1, lSets2 )
-        
-        self.assertEquals( expOverlapSize, obsOverlapSize )
-        
-    def test_getOverlapLengthBetweenLists_on_different_seq_names (self):
-        lSets1 = [ Set( 1, "set1", "seq1", 1, 2 ), Set( 2, "set2", "seq2", 2, 3 ) ]
-        lSets2 = [ Set( 3, "set1", "seq2", 4, 5 ), Set( 5, "set2", "seq4", 2, 3 ) ]
-        
-        expOverlapSize = 0
-        obsOverlapSize = SetUtils.getOverlapLengthBetweenLists( lSets1, lSets2 )
-        
-        self.assertEquals( expOverlapSize, obsOverlapSize )
-        
-    def test_getOverlapLengthBetweenLists_list1_size_two_list2_size_two_with_overlap (self):
-        lSets1 = [ Set( 1, "set1", "seq1", 1, 6 ), Set( 2, "set2", "seq2", 2, 3 ) ]
-        lSets2 = [ Set( 3, "set1", "seq1", 1, 2 ), Set( 2, "set2", "seq3", 2, 3 ) ]
-        
-        expOverlapSize = 2
-        obsOverlapSize = SetUtils.getOverlapLengthBetweenLists( lSets1, lSets2 )
-        
-        self.assertEquals( expOverlapSize, obsOverlapSize )
-        
-    def test_areSetsOverlappingBetweenLists_list2_empty(self):
-        tuple1 = ("1","chr1","seq1", "100","110")
-        tuple2 = ("1","chr1","seq1", "200","220")
-        tuple3 = ("1","chr1","seq1", "300","330")
-        setList1 = self._makeSetListFromTupleList([tuple1, tuple2, tuple3])
-        
-        setList2 = []
-        
-        expRes = False
-        obsRes = SetUtils.areSetsOverlappingBetweenLists( setList1, setList2 )
-        
-        self.assertEquals( expRes, obsRes )
-        
-    def test_areSetsOverlappingBetweenLists_list2_size1(self):
-        tuple1 = ("1","chr1","seq1", "9","11")
-        tuple2 = ("1","chr1","seq1", "20","22")
-        tuple3 = ("1","chr1","seq1", "30","33")
-        setList1 = self._makeSetListFromTupleList( [ tuple1, tuple2, tuple3 ] )
-        
-        tuple11 = ("1","chr1", "seq1", "8","11")
-        setList2 = self._makeSetListFromTupleList( [ tuple11 ] )
-        
-        expRes = True
-        obsRes = SetUtils.areSetsOverlappingBetweenLists( setList1, setList2 )
-        
-        self.assertEquals( expRes, obsRes )
-        
-    def test_areSetsOverlappingBetweenLists_list1_greater_list2(self):
-        tuple1 = ("1","chr1","seq1","100","110")
-        tuple2 = ("1","chr1","seq1","200","220")
-        tuple3 = ("1","chr1","seq1","300","330")
-        setList1 = self._makeSetListFromTupleList( [ tuple1, tuple2, tuple3 ] )
-        
-        tuple11 = ("1","chr1","seq1", "10","11")
-        tuple22 = ("1","chr1","seq1", "20","22")
-        tuple33 = ("1","chr1","seq1", "30","33")
-        setList2 = self._makeSetListFromTupleList( [ tuple11, tuple22, tuple33 ] )
-        
-        expRes = False
-        obsRes = SetUtils.areSetsOverlappingBetweenLists( setList1, setList2 )
-        
-        self.assertEquals( expRes, obsRes )
-    
-    def test_areSetsOverlappingBetweenLists_unordered_first_item_of_list1_greater_second_item_smaller(self):
-        tuple1 = ("1","chr1","seq1","400","440")
-        tuple2 = ("1","chr1","seq1","1","11")
-        setList1 = self._makeSetListFromTupleList( [ tuple1, tuple2 ] )
-        
-        tuple11 = ("1","chr1","seq1","15","17")
-        tuple22 = ("1","chr1","seq1", "20","22")
-        tuple33 = ("1","chr1","seq1","30","33")
-        setList2 = self._makeSetListFromTupleList( [ tuple11, tuple22, tuple33 ] )
-        
-        expRes = False
-        obsRes = SetUtils.areSetsOverlappingBetweenLists( setList1, setList2 )
-        
-        self.assertEquals( expRes, obsRes )
- 
-    def test_areSetsOverlappingBetweenLists_unorderd_second_item_of_list1_overlap_first_item(self):
-        tuple1 = ("1","chr1","seq1","400","440")
-        tuple2 = ("1","chr1","seq1", "1","18")
-        setList1 = self._makeSetListFromTupleList( [ tuple1, tuple2 ] )
-        
-        tuple11 = ("1","chr1","seq1","15","17")
-        tuple22 = ("1","chr1","seq1","20","22")
-        tuple33 = ("1","chr1","seq1","30","33")
-        setList2 = self._makeSetListFromTupleList( [ tuple11, tuple22, tuple33 ] )
-        
-        expRes = True
-        obsRes = SetUtils.areSetsOverlappingBetweenLists( setList1, setList2 )
-        
-        self.assertEquals( expRes, obsRes )
-    
-    def test_areSetsOverlappingBetweenLists_last_item_list1_overlap_last_item_list2(self):
-        tuple1 = ("1","chr1","seq1","400","440")
-        tuple2 = ("1","chr1","seq1","320","340")
-        pathList1 = self._makeSetListFromTupleList( [ tuple1, tuple2 ] )
-        
-        tuple11 = ("1","chr1","seq1","100","110")
-        tuple22 = ("1","chr1","seq1","200","220")
-        tuple33 = ("1","chr1","seq1","300","330")
-        pathList2 = self._makeSetListFromTupleList( [ tuple11, tuple22, tuple33 ] )
-        
-        expRes = True
-        obsRes = SetUtils.areSetsOverlappingBetweenLists( pathList1, pathList2 )
-        
-        self.assertEquals( expRes, obsRes )
-                
-    def test_getCumulLength_empty_list(self):
-        lSets = []
-        
-        expSize = 0
-        obsSize = SetUtils.getCumulLength( lSets )
-        
-        self.assertEquals( expSize, obsSize )
-        
-    def test_getCumulLength_1_item(self):
-        lSets = [ Set( 1, "set1", "seq1", 1, 6 ) ]
-        
-        expSize = 6
-        obsSize = SetUtils.getCumulLength( lSets )
-        
-        self.assertEquals( expSize, obsSize )
-        
-    def test_getCumulLength_2_items(self):
-        lSets = [ Set( 1, "set1", "seq1", 1, 6 ), Set( 1, "set1", "seq1", 1, 2 ) ]
-        
-        expSize = 8
-        obsSize = SetUtils.getCumulLength( lSets )
-        
-        self.assertEquals( expSize, obsSize )
-        
-    def test_getCumulLength_complex(self):
-        set8 = Set(498, "(TACATA)25", "Mela_Blaster_Grouper_611_MAP_20", 17, 348)
-        set5 = Set(502, "(GGAGA)2", "Mela_Blaster_Grouper_611_MAP_20", 356, 366)
-        set6 = Set(503, "(TTTAAAGAACCC)2", "Mela_Blaster_Grouper_611_MAP_20", 433, 457)
-        set7 = Set(504, "(TATAA)2", "Mela_Blaster_Grouper_611_MAP_20", 484, 495) 
-        lSets = [ set8, set5, set6, set7 ] 
-        expSize = 380
-        obsSize = SetUtils.getCumulLength( lSets )
-        
-        self.assertEquals( expSize, obsSize )
-        
-    def test_getListBoundaries_one_set(self):
-        lSets = [ Set( 1, "set1", "seq1", 3, 8 ) ]
-        
-        expTuple = ( 3, 8 )
-        obsTuple = SetUtils.getListBoundaries( lSets )
-        
-        self.assertEquals( expTuple, obsTuple )
-        
-    def test_getListBoundaries_two_sets(self):
-        lSets = [ Set( 1, "set1", "seq1", 3, 8 ), Set( 2, "set2", "seq2", 5, 10 ) ]
-        
-        expTuple = ( 3, 10 )
-        obsTuple = SetUtils.getListBoundaries( lSets )
-        
-        self.assertEquals( expTuple, obsTuple )
- 
-    def test_writeListInFile_empty_list(self):
-        lSets = [ ]
-        expFileName = "expFileName"
-        fileHandle = open(expFileName, "w")
-        fileHandle.close()
- 
-        obsFileName = "obsFileName"
-        fileHandle = open(obsFileName, "w")
-        SetUtils.writeListInFile(lSets, obsFileName, "w")
-        fileHandle.close()
-         
-        self.assertTrue( FileUtils.are2FilesIdentical( expFileName, obsFileName ) )
-        
-        os.remove(obsFileName)
-        os.remove(expFileName)
-        
-    def test_writeListInFile_list_one_set(self):
-        lSets = [ Set( 1, "set1", "seq1", 3, 8 ) ]
-        line =  "1\tset1\tseq1\t3\t8\n"
-        expFileName = "expFileName"
- 
-        fileHandle = open(expFileName, "w")
-        fileHandle.write(line)
-        fileHandle.close()
- 
-        obsFileName = "obsFileName"
-        fileHandle = open(obsFileName, "w")
-        SetUtils.writeListInFile(lSets, obsFileName, "w")
-        fileHandle.close()
-         
-        self.assertTrue( FileUtils.are2FilesIdentical( expFileName, obsFileName ) )
-        
-        os.remove(obsFileName)
-        os.remove(expFileName)
-        
-        
-    def test_getDictOfListsWithIdAsKey_empty_list( self ):
-        lSets = []
-        expDic = {}
-        obsDic = SetUtils.getDictOfListsWithIdAsKey( lSets )
-        self.assertEquals( expDic, obsDic )
-        
-        
-    def test_getDictOfListsWithIdAsKey_one_set( self ):
-        lSets = [ Set( 2, "set2", "seq2", 3, 8 ) ]
-        expDic = { 2: [ Set( 2, "set2", "seq2", 3, 8 ) ] }
-        obsDic = SetUtils.getDictOfListsWithIdAsKey( lSets )
-        self.assertEquals( expDic, obsDic )
-        
-        
-    def test_getDictOfListsWithIdAsKey_two_sets_with_same_id( self ):
-        lSets = [ Set( 2, "set2", "seq2", 10, 50 ), Set( 2, "set2", "seq2", 3, 8 )]
-        expDic = { 2: [Set( 2, "set2", "seq2", 10, 50 ), Set( 2, "set2", "seq2", 3, 8 )] }
-        obsDic = SetUtils.getDictOfListsWithIdAsKey( lSets )
-        self.assertEquals( expDic, obsDic )
-        
-        
-    def test_getDictOfListsWithIdAsKey_sets_with_3_different_id( self ):
-        set1 = Set( 1, "set2", "seq2", 10, 50 )
-        set2 = Set( 1, "set2", "seq2", 20, 50 )
-        set3 = Set( 2, "set2", "seq2", 30, 50 )
-        set4 = Set( 2, "set2", "seq2", 40, 50 )
-        set5 = Set( 3, "set2", "seq2", 1, 2 )
-        lSets = [ set1, set2, set3, set4, set5 ]
-        expDic = { 1: [set1, set2],
-                   2: [set3, set4],
-                   3: [set5] }
-        obsDic = SetUtils.getDictOfListsWithIdAsKey( lSets )
-        self.assertEquals( expDic, obsDic )
-        
-        
-    def test_getDictOfListsWithIdAsKeyFromFile(self):
-        setFile = "dummySetFile"
-        setFileHandler = open( setFile, "w" )
-        setFileHandler.write( "1\tseq31\tchr1\t151\t250\n" )
-        setFileHandler.write( "2\tseq27\tchr2\t301\t500\n" )
-        setFileHandler.write( "2\tseq27\tchr2\t601\t650\n" )
-        setFileHandler.close()
-        
-        dExp = { 1: [ Set( 1, "seq31", "chr1", 151, 250 ) ],
-                2: [ Set( 2, "seq27", "chr2", 301, 500 ),
-                    Set( 2, "seq27", "chr2", 601, 650 ) ] }
-        dObs = SetUtils.getDictOfListsWithIdAsKeyFromFile( setFile )
-        
-        self.assertEquals( dExp, dObs )
-        
-        os.remove( setFile )
-        
-        
-    def test_getMapListFromSetList_empty_list(self):
-        lSets = []
-        
-        expLMap = []
-        obsLMap = SetUtils.getMapListFromSetList(lSets)
-        
-        self.assertEquals(expLMap, obsLMap)
-        
-    def test_getMapListFromSetList_one_set(self):
-        lSets = [ Set( 1, "set", "seq1", 1, 6 )]
-        map1 = Map("set::1","seq1",1,6)
-        
-        expLMap = [ map1 ]
-        obsLMap = SetUtils.getMapListFromSetList(lSets)
-        
-        self.assertEquals(expLMap, obsLMap)
-                    
-    def test_getMapListFromSetList_two_sets(self):
-        lSets = [ Set( 1, "set", "seq1", 1, 6 ), Set( 2, "set", "seq2", 3, 8 ) ]
-        map1 = Map("set::1","seq1",1,6)
-        map2 = Map("set::2","seq2",3,8)
-        
-        expLMap = [ map1, map2 ]
-        obsLMap = SetUtils.getMapListFromSetList(lSets)
-        
-        self.assertEquals(expLMap, obsLMap)
-        
-    def test_getSetListFromMapList_empty_list(self):
-        lMap =[]
-        expLSets = []
-        obsLSets = SetUtils.getSetListFromMapList(lMap)
-        
-        self.assertEquals(expLSets, obsLSets)
-        
-    def test_getSetListFromMapList_one_map(self):
-        map1 = Map( "map1","seq1",1,6)
-        lMap =[ map1 ]
-        expLSets = [ Set( 1, "map1", "seq1", 1, 6 ) ]
-        obsLSets = SetUtils.getSetListFromMapList(lMap)
-                            
-        self.assertEquals(expLSets, obsLSets)
-        
-    def test_getSetListFromMapList_two_maps(self):
-        map1 = Map( "map1","seq1",1,6)
-        map2 = Map( "map2","seq2",3,8)
-        lMap =[ map1,map2 ]
-        expLSets = [ Set( 1, "map1", "seq1", 1, 6 ), Set( 2, "map2", "seq2", 3, 8 ) ]
-        obsLSets = SetUtils.getSetListFromMapList(lMap)
-        
-        self.assertEquals(expLSets, obsLSets)
-        
-    def test_getSetListFromMapList_list_with_one_empty_map(self):
-        map1 = Map( "map1","seq1",1,6)
-        map2 = Map()
-        lMap =[ map1,map2 ]
-        expLSets = [ Set( 1, "map1", "seq1", 1, 6 ), Set(2, ) ]
-        obsLSets = SetUtils.getSetListFromMapList(lMap)
-        
-        self.assertEquals(expLSets, obsLSets)
-        
-    def test_mergeSetsInList(self):
-        set1 = Set( 1, "set1", "seq1", 1, 6 )
-        set2 = Set( 2, "set2", "seq1", 3, 6 )
-        set3 = Set( 3, "set3", "seq1", 3, 5 )
-        set4 = Set( 4, "set4", "seq1", 1, 2 )
-        lSets = [ set1, set2, set3, set4 ]
-        
-        obsList = SetUtils.mergeSetsInList( lSets )
-        expList = [ Set( 1, "set1", "seq1", 1, 6 ) ]
-        
-        self.assertEquals( expList, obsList )
-        
-        
-    def test_mergeSetsInList_with_reverse_only(self):
-        set1 = Set( 1, "set1", "seq1", 6, 1 )
-        set2 = Set( 2, "set2", "seq1", 6, 3 )
-        set3 = Set( 3, "set3", "seq1", 5, 3 )
-        set4 = Set( 4, "set4", "seq1", 2, 1 )
-        lSets = [ set1, set2, set3, set4 ]
-        
-        obsList = SetUtils.mergeSetsInList( lSets )
-        expList = [ Set( 1, "set1", "seq1", 6, 1 ) ]
-        
-        self.assertEquals( expList, obsList )
-        
-        
-    def test_mergeSetsInList_with_direct_and_reverse(self):
-        set1 = Set( 1, "set1", "seq1", 6, 1 )
-        set2 = Set( 2, "set2", "seq1", 6, 3 )
-        set3 = Set( 3, "set3", "seq1", 3, 5 )
-        set4 = Set( 4, "set4", "seq1", 2, 1 )
-        lSets = [ set1, set2, set3, set4 ]
-        
-        obsList = SetUtils.mergeSetsInList( lSets )
-        expList = [ set1 ]
-        
-        self.assertEquals( expList, obsList )
-        
-        
-    def test_mergeSetsInList_with_empty_set(self):
-        set1 = Set( 1, "set1", "seq1", 1, 6 )
-        set2 = Set()
-        set3 = Set( 3, "set3", "seq1", 3, 5 )
-        set4 = Set( 4, "set4", "seq1", 1, 2 )
-        lSets = [ set1, set2, set3, set4 ]
-        
-        obsList = SetUtils.mergeSetsInList( lSets )
-        expList = [ set2, set1 ]
-        
-        self.assertEquals( expList, obsList )
-        
-        
-    def test_mergeSetsInList_empty_list(self):
-        lSets = []
-        
-        obsList = SetUtils.mergeSetsInList( lSets )
-        expList = []
-         
-        self.assertEquals( expList, obsList )
-        
-        
-    def test_mergeSetsInList_one_set (self):
-        set1 = Set( 1, "set1", "seq1", 1, 6 )
-        lSets = [ set1 ]
-        
-        obsLSets = SetUtils.mergeSetsInList( lSets )
-        expLSets = [ set1 ]
-         
-        self.assertEquals( expLSets, obsLSets )
-        
-        
-    def test_mergeSetsInList_diffSeqnames_without_overlapping(self):
-        set1 = Set( 1, "set1", "seq1", 1, 6 )
-        set2 = Set( 1, "set2", "seq2", 11, 16 )
-        lSets = [ set1, set2 ]
-        
-        obsLSets = SetUtils.mergeSetsInList( lSets )
-        expLSets = [ set1, set2 ]
-        
-        self.assertEquals( expLSets, obsLSets )
-        
- 
-    def test_mergeSetsInList_diffSeqnames_overlapping(self):
-        set1 = Set( 1, "set1", "seq1", 1, 6 )
-        set2 = Set( 1, "set2", "seq2", 2, 5 )
-        lSets = [ set1, set2 ]
-        
-        obsLSets = SetUtils.mergeSetsInList( lSets )
-        expLSets = [ set1, set2 ]
-        
-        self.assertEquals( expLSets, obsLSets )
-        
- 
-    def test_mergeSetsInList_sameSeqnames_without_overlapping(self):
-        set1 = Set( 1, "set1", "seq1", 1, 6 )
-        set2 = Set( 1, "set2", "seq1", 11, 16 )
-        lSets = [ set1, set2 ]
-        
-        obsLSets = SetUtils.mergeSetsInList( lSets )
-        expLSets = [ set1, set2 ]
-        
-        self.assertEquals( expLSets, obsLSets )
-        
-    def test_mergeSetsInList_complex(self):
-        set1 = Set(498, "(ACATATAATAA)10", "Mela_Blaster_Grouper_611_MAP_20", 77, 181)
-        set2 = Set(499, "(TACATA)25", "Mela_Blaster_Grouper_611_MAP_20", 17, 166)
-        set3 = Set(500, "(ATAAAATAC)26", "Mela_Blaster_Grouper_611_MAP_20", 94, 348)
-        set4 = Set(501, "(TAA)15", "Mela_Blaster_Grouper_611_MAP_20", 257, 303)
-        set5 = Set(502, "(GGAGA)2", "Mela_Blaster_Grouper_611_MAP_20", 356, 366)
-        set6 = Set(503, "(TTTAAAGAACCC)2", "Mela_Blaster_Grouper_611_MAP_20", 433, 457)
-        set7 = Set(504, "(TATAA)2", "Mela_Blaster_Grouper_611_MAP_20", 484, 495)    
-        lSets = [ set1, set2, set3, set4, set5, set6, set7 ]  
-        obsLSets = SetUtils.mergeSetsInList( lSets )
-        
-        set8 = Set(498, "(TACATA)25", "Mela_Blaster_Grouper_611_MAP_20", 17, 348)
-        
-        expLSets = [ set8, set5, set6, set7 ]
-        
-        self.assertEquals( expLSets, obsLSets )
-        
-    def test_getSetListUnjoined_listToKeep_empty_listToUnjoin_empty (self):
-        setListToKeep = []
-        setListToUnjoin = []
- 
-        obsLSets = SetUtils.getSetListUnjoined(setListToKeep, setListToUnjoin)
-        expLSets = []
- 
-        self.assertEquals(expLSets, obsLSets)
-        
-    def test_getSetListUnjoined_listToKeep_empty (self):
-        setListToKeep = []
-        
-        setUnjoin1 = Set( 1, "set", "seq", 1, 3 )
-        setUnjoin2 = Set( 1, "set", "seq", 2, 3 )
-        setUnjoin3 = Set( 1, "set", "seq", 5, 7 )
-        setListToUnjoin = [ setUnjoin1, setUnjoin2, setUnjoin3 ]
- 
-        obsLSets = SetUtils.getSetListUnjoined(setListToKeep, setListToUnjoin)
-        expLSets = [ setListToUnjoin ]
- 
-        self.assertEquals(expLSets, obsLSets)       
-        
-    def test_getSetListUnjoined_listToKeep_empty_listToUnjoin_size1 (self):
-        setListToKeep = []
-        
-        setUnjoin = Set( 1, "set", "seq", 1, 3 )
-        setListToUnjoin = [ setUnjoin ]
- 
-        obsLSets = SetUtils.getSetListUnjoined(setListToKeep, setListToUnjoin)
-        expLSets = [ setListToUnjoin ]
- 
-        self.assertEquals(expLSets, obsLSets)     
-        
-    def test_getSetListUnjoined_listToKeep_size1_listToUnjoin_empty (self):
-        setKeep = Set( 1, "set", "seq", 1, 3 )
-        setListToKeep = [ setKeep ]
-        
-        setListToUnjoin = []
- 
-        obsLSets = SetUtils.getSetListUnjoined(setListToKeep, setListToUnjoin)
-        expLSets = []
- 
-        self.assertEquals(expLSets, obsLSets)  
-       
-    def test_getSetListUnjoined_listToKeep_size1_listToUnjoin_size1 (self):
-        setKeep = Set( 1, "set", "seq", 1, 3 )
-        setListToKeep = [ setKeep ]
-        
-        setUnjoin = Set( 1, "set", "seq", 5, 9 )
-        setListToUnjoin = [ setUnjoin ]
- 
-        obsLSets = SetUtils.getSetListUnjoined(setListToKeep, setListToUnjoin)
-        expLSets = [ setListToUnjoin ]
- 
-        self.assertEquals(expLSets, obsLSets)
- 
-    def test_getSetListUnjoined_listToKeep_size1_listToUnjoin_size2_noSplit_item_in_listToKeep_smaller_item_in_listToUnjoin (self):
-        setKeep = Set( 1, "set", "seq", 1, 3 )
-        setListToKeep = [ setKeep ]
-        
-        setUnjoin1 = Set( 1, "set", "seq", 5, 9 )
-        setUnjoin2 = Set( 1, "set", "seq", 11, 16 )
-        setListToUnjoin = [ setUnjoin1, setUnjoin2 ]
- 
-        obsLSets = SetUtils.getSetListUnjoined(setListToKeep, setListToUnjoin)
-        expLSets = [ setListToUnjoin ]
- 
-        self.assertEquals(expLSets, obsLSets)  
- 
-    def test_getSetListUnjoined_listToKeep_size1_listToUnjoin_size3_noSplit_item_in_listToKeep_smaller_item_in_listToUnjoin (self):
-        setKeep = Set( 1, "set", "seq", 1, 3 )
-        setListToKeep = [ setKeep ]
-        
-        setUnjoin1 = Set( 1, "set", "seq", 5, 9 )
-        setUnjoin2 = Set( 1, "set", "seq", 11, 16 )
-        setUnjoin3 = Set( 1, "set", "seq", 21, 26 )
-        setListToUnjoin = [ setUnjoin1, setUnjoin2, setUnjoin3 ]
- 
-        obsLSets = SetUtils.getSetListUnjoined(setListToKeep, setListToUnjoin)
-        expLSets = [ setListToUnjoin ]
- 
-        self.assertEquals(expLSets, obsLSets)  
- 
-    def test_getSetListUnjoined_listToKeep_size1_listToUnjoin_size2_noSplit_item_in_listToUnjoin_smaller_item_in_listToKeep (self):
-        setKeep = Set( 1, "set", "seq", 10, 13 )
-        setListToKeep = [ setKeep ]
-        
-        setUnjoin1 = Set( 1, "set", "seq", 5, 9 )
-        setUnjoin2 = Set( 1, "set", "seq", 1, 3 )
-        setListToUnjoin = [ setUnjoin1, setUnjoin2 ]
- 
-        obsLSets = SetUtils.getSetListUnjoined(setListToKeep, setListToUnjoin)
-        expLSets = [ SetUtils.getSetListSortedByIncreasingMinThenMax( setListToUnjoin ) ]
- 
-        self.assertEquals(expLSets, obsLSets)   
- 
-    def test_getSetListUnjoined_listToKeep_size3_listToUnjoin_size2_oneSplit_item_in_listToKeep_smaller_item_in_listToUnjoin (self):
-        setKeep1 = Set( 1, "set", "seq", 1, 1 )
-        setKeep2 = Set( 1, "set", "seq", 21, 30 )
-        setKeep3 = Set( 1, "set", "seq", 61, 70 )
-        setListToKeep = [ setKeep1, setKeep2, setKeep3 ]
-        
-        setUnjoin1 = Set( 1, "set", "seq", 41, 50 )
-        setUnjoin2 = Set( 2, "set", "seq", 81, 90 )
-        setListToUnjoin = [ setUnjoin1, setUnjoin2 ]
- 
-        expLSets = [ [ setUnjoin1 ], [ setUnjoin2 ] ]
-        
-        obsLSets = SetUtils.getSetListUnjoined(setListToKeep, setListToUnjoin)
- 
-        self.assertEquals(expLSets, obsLSets) 
-        
-    def test_getSetListUnjoined_listToKeep_size3_listToUnjoin_size3_twoSplits_item_in_listToUnjoin_smaller_item_in_listToKeep(self):
-        setKeep1 = Set( 1, "set", "seq", 21, 30 )
-        setKeep2 = Set( 1, "set", "seq", 41, 50 )
-        setKeep3 = Set( 1, "set", "seq", 81, 90 )
-        setListToKeep = [ setKeep1, setKeep2, setKeep3 ]
-        
-        setUnjoin1 = Set( 1, "set", "seq", 1, 10 )
-        setUnjoin2 = Set( 2, "set", "seq", 61, 70 )
-        setUnjoin3 = Set( 2, "set", "seq", 101, 110 )
-        setListToUnjoin = [ setUnjoin1, setUnjoin2, setUnjoin3 ]
-        
-        expLSets = [ [ setUnjoin1 ], [ setUnjoin2 ], [ setUnjoin3 ] ]
-        
-        obsLSets = SetUtils.getSetListUnjoined( setListToKeep, setListToUnjoin )
-        
-        self.assertEquals(expLSets, obsLSets) 
-        
-    def test_getSetListUnjoined_listToKeep_size1_listToUnjoin_size2_split(self):
-        setKeep1 = Set( 1, "set", "seq", 51, 80 )
-        setListToKeep = [ setKeep1 ]        
-        
-        setUnjoin1 = Set( 1, "set", "seq", 21, 40 )
-        setUnjoin2 = Set( 1, "set", "seq", 101, 150 )
-        setListToUnjoin = [ setUnjoin1, setUnjoin2 ]
-        
-        expLSets = [ [setUnjoin1] , [setUnjoin2] ]
-               
-        obsLSets = SetUtils.getSetListUnjoined( setListToKeep, setListToUnjoin )
-        
-        self.assertEquals( expLSets, obsLSets )
- 
-    def test_getSetListUnjoined_listToKeep_size2_listToUnjoin_size2_split(self):
-        setKeep1 = Set( 1, "set", "seq", 1, 15 )
-        setKeep2 = Set( 1, "set", "seq", 81, 130 )
-        setListToKeep = [ setKeep1, setKeep2 ]
-        
-        setUnjoin1 = Set( 1, "set", "seq", 21, 40 )
-        setUnjoin2 = Set( 1, "set", "seq", 201, 250 )
-        setListToUnjoin = [ setUnjoin1, setUnjoin2 ]
-        
-        expLSets = [ [setUnjoin1] , [setUnjoin2] ] 
-        
-        obsLSets = SetUtils.getSetListUnjoined( setListToKeep, setListToUnjoin )
-        
-        self.assertEquals( expLSets, obsLSets )
-        
-    def test_getSetListUnjoined_listToKeep_size1_listToUnjoin_ordered_OneSplit(self):
-        setKeep = Set( 1, "set", "seq", 120, 180 )
-        setListToKeep = [ setKeep ]
-        
-        setUnjoin1 = Set( 1, "set", "seq", 100, 110 )
-        setUnjoin2 = Set( 1, "set", "seq", 200, 210 )
-        setUnjoin3 = Set( 1, "set", "seq", 250, 280 )
-        setListToUnjoin = [ setUnjoin1, setUnjoin2, setUnjoin3 ]
- 
-        obsLSets = SetUtils.getSetListUnjoined(setListToKeep, setListToUnjoin)
-        expLSets = [ [setUnjoin1], [setUnjoin2, setUnjoin3] ]
- 
-        self.assertEquals(expLSets, obsLSets)
-        
-    def test_getSetListUnjoined_listToKeep_size1_listToUnjoin_unordered_OneSplit(self):
-        setKeep = Set( 1, "set", "seq", 120, 180 )
-        setListToKeep = [ setKeep ]
-        
-        setUnjoin1 = Set( 1, "set", "seq", 200, 210 )
-        setUnjoin2 = Set( 1, "set", "seq", 250, 280 )
-        setUnjoin3 = Set( 1, "set", "seq", 100, 110 )
-        setListToUnjoin = [ setUnjoin1, setUnjoin2, setUnjoin3 ]
- 
-        obsLSets = SetUtils.getSetListUnjoined(setListToKeep, setListToUnjoin)
-        expLSets = [ [setUnjoin3], [setUnjoin1, setUnjoin2] ]
- 
-        self.assertEquals(expLSets, obsLSets)
- 
-    def test_getSetListUnjoined_listToKeep_size2_listToUnjoin_size4_twoSplits(self):
-        setKeep1 = Set( 1, "set", "seq", 21, 30 )
-        setKeep2 = Set( 1, "set", "seq", 81, 90 )
-        setListToKeep = [ setKeep1, setKeep2 ]
-                
-        setUnjoin1 = Set( 1, "set", "seq", 1, 10 )
-        setUnjoin2 = Set( 1, "set", "seq", 41, 50 )
-        setUnjoin3 = Set( 1, "set", "seq", 61, 70 )
-        setUnjoin4 = Set( 1, "set", "seq", 101, 110 )
-        setListToUnjoin = [ setUnjoin1, setUnjoin2, setUnjoin3, setUnjoin4 ]
-        
-        expLSets = [ [setUnjoin1], [ setUnjoin2, setUnjoin3 ], [setUnjoin4] ]
-        
-        obsLSets = SetUtils.getSetListUnjoined(setListToKeep, setListToUnjoin)
-        
-        self.assertEquals( expLSets, obsLSets )
-        
-    def test_getSetListWithoutDuplicates_empty_list(self):
-        lSets = []
-        obsLSets = SetUtils.getSetListWithoutDuplicates( lSets )        
-        expLSets = []
-        self.assertEquals( expLSets, obsLSets )
-        
-    def test_getSetListWithoutDuplicates_list_size1(self):
-        set = Set( 1, "set", "seq", 100, 110 )
-        lSets = [ set ]
-        obsLSets = SetUtils.getSetListWithoutDuplicates( lSets )
-        expLSets = lSets
-        self.assertEquals( expLSets, obsLSets )
-        
-    def test_getSetListWithoutDuplicates_list_with_only_doublons(self):
-        set1 = Set( 1, "set", "seq", 100, 110 )
-        set2 = Set( 1, "set", "seq", 100, 110 )
-        set3 = Set( 1, "set", "seq", 100, 110 )
-        set4 = Set( 1, "set", "seq", 100, 110 )
-        lSets = [set1, set2, set3, set4]
-        
-        obsLSets = SetUtils.getSetListWithoutDuplicates( lSets )
-        
-        expLSets = [ set1 ]
-        
-        self.assertEquals( expLSets, obsLSets )
-        
-    def test_getSetListWithoutDuplicates_list_with_doublons_at_start_and_at_end(self):
-        set1 = Set( 1, "set", "seq", 200, 210 )
-        set2 = Set( 1, "set", "seq", 100, 110 )
-        set3 = Set( 1, "set", "seq", 300, 310 )
-        set4 = Set( 1, "set", "seq", 100, 110 )
-        lSets = [set1, set2, set3, set4]
-        
-        obsLSets = SetUtils.getSetListWithoutDuplicates( lSets )
-        
-        expLSets = [ set1, set2, set3 ]
-        expLSets = SetUtils.getSetListSortedByIncreasingMinThenMax(expLSets)
-        
-        self.assertEquals( expLSets, obsLSets )
-        
-    def test_getSetListWithoutDuplicates_list_with_contiguous_doublons(self):
-        set1 = Set( 1, "set", "seq", 200, 210 )
-        set2 = Set( 1, "set", "seq", 100, 110 )
-        set3 = Set( 1, "set", "seq", 100, 110 )
-        set4 = Set( 1, "set", "seq", 300, 310 )
-        lSets = [set1, set2, set3, set4]
-        
-        obsLSets = SetUtils.getSetListWithoutDuplicates( lSets )
-        
-        expLSets = [ set1, set2, set4 ]
-        expLSets = SetUtils.getSetListSortedByIncreasingMinThenMax(expLSets)
-        
-        self.assertEquals( expLSets, obsLSets )
-        
-    def test_getSetListWithoutDuplicates_list_with_one_doublon(self):
-        set1 = Set( 1, "set", "seq", 200, 210 )
-        set2 = Set( 1, "set", "seq", 100, 110 )
-        set3 = Set( 1, "set", "seq", 210, 250 )
-        set4 = Set( 1, "set", "seq", 100, 110 )
-        set5 = Set( 1, "set", "seq", 300, 310 )
-        lSets = [set1, set2, set3, set4, set5]
-        
-        obsLSets = SetUtils.getSetListWithoutDuplicates( lSets )
-        
-        expLSets = [ set1, set2, set3, set5 ]
-        expLSets = SetUtils.getSetListSortedByIncreasingMinThenMax(expLSets)
-        
-        self.assertEquals( expLSets, obsLSets )
-        
-    def test_getSetListWithoutDuplicates_list_with_two_doublons(self):
-        set1 = Set( 1, "set", "seq", 200, 210 )
-        set2 = Set( 1, "set", "seq", 100, 110 )
-        set3 = Set( 1, "set", "seq", 210, 250 )
-        set4 = Set( 1, "set", "seq", 230, 250 )
-        set5 = Set( 1, "set", "seq", 210, 250 )
-        set6 = Set( 1, "set", "seq", 100, 110 )
-        set7 = Set( 1, "set", "seq", 300, 310 )
-        lSets = [set1, set2, set3, set4, set5, set6, set7]
-        
-        obsLSets = SetUtils.getSetListWithoutDuplicates( lSets )
-        
-        expLSets = [ set1, set2, set3, set4, set7 ]
-        expLSets = SetUtils.getSetListSortedByIncreasingMinThenMax(expLSets)
-        
-        self.assertEquals( expLSets, obsLSets )
-       
-    def test_getSetListSortedByIncreasingMinThenMax_alreadyOrdered_diffIdentifier(self):
-        set1 = Set( 1, "set1", "seq1", 1, 10 )
-        set2 = Set( 2, "set1", "seq1", 21, 30 )
-        lSets = [ set1, set2 ]
-        
-        expList = [ set1, set2 ]
-        
-        obsList = SetUtils.getSetListSortedByIncreasingMinThenMax( lSets )
-        
-        self.assertEqual( expList, obsList )
-        
-        
-    def test_getSetListSortedByIncreasingMinThenMax_unordered_diffIdentifier(self):
-        set1 = Set( 1, "set1", "seq1", 21, 30 )
-        set2 = Set( 2, "set1", "seq1", 1, 10 )
-        lSets = [ set1, set2 ]
-        
-        expList = [ set2, set1 ]
-        
-        obsList = SetUtils.getSetListSortedByIncreasingMinThenMax( lSets )
-        
-        self.assertEqual( expList, obsList )
-        
-        
-    def test_getSetListSortedByIncreasingMinThenMax_unordered_sameIdentifier(self):
-        set1 = Set( 1, "set1", "seq1", 21, 30 )
-        set2 = Set( 1, "set1", "seq1", 1, 10 )
-        lSets = [ set1, set2 ]
-        
-        expList = [ set2, set1 ]
-        
-        obsList = SetUtils.getSetListSortedByIncreasingMinThenMax( lSets )
-        
-        self.assertEqual( expList, obsList )
-        
-        
-    def test_getSetListSortedByIncreasingMinThenMax_unordered_overlapping(self):
-        set1 = Set( 2, "set1", "seq1", 6, 15 )
-        set2 = Set( 1, "set1", "seq1", 1, 10 )
-        lSets = [ set1, set2 ]
-        
-        expList = [ set2, set1 ]
-        
-        obsList = SetUtils.getSetListSortedByIncreasingMinThenMax( lSets )
-        
-        self.assertEqual( expList, obsList )
-        
-    def test_getSetListSortedByIncreasingMinThenMax_unordered_sameMin_threeSets(self):
-        set1 = Set( 1, "set1", "seq1", 1, 15 )
-        set2 = Set( 2, "set2", "seq1", 1, 10 )
-        set3 = Set( 3, "set3", "seq1", 1, 12 )
-        lSets = [ set1, set2, set3 ]
-        
-        expList = [ set2, set3, set1 ]
-        
-        obsList = SetUtils.getSetListSortedByIncreasingMinThenMax( lSets )
-        
-        self.assertEqual( expList, obsList )
-        
-        
-    def test_getSetListSortedByIncreasingMinThenMax_unordered_included(self):
-        set1 = Set( 1, "set1", "seq1", 2, 4 )
-        set2 = Set( 2, "set2", "seq1", 1, 5 )
-        lSets = [ set1, set2 ]
-        
-        expList = [ set2, set1 ]
-        
-        obsList = SetUtils.getSetListSortedByIncreasingMinThenMax( lSets )
-        
-        self.assertEqual( expList, obsList )
-        
-        
-    def test_getSetListSortedByIncreasingMinThenInvLength_alreadyOrdered_diffIdentifier(self):
-        set1 = Set( 1, "set1", "seq1", 1, 10 )
-        set2 = Set( 2, "set1", "seq1", 21, 30 )
-        lSets = [ set1, set2 ]
-        
-        expList = [ set1, set2 ]
-        
-        obsList = SetUtils.getSetListSortedByIncreasingMinThenInvLength( lSets )
-        
-        self.assertEqual( expList, obsList )
-        
-        
-    def test_getSetListSortedByIncreasingMinThenInvLength_unordered_diffIdentifier(self):
-        set1 = Set( 1, "set1", "seq1", 21, 30 )
-        set2 = Set( 2, "set1", "seq1", 1, 10 )
-        lSets = [ set1, set2 ]
-        
-        expList = [ set2, set1 ]
-        
-        obsList = SetUtils.getSetListSortedByIncreasingMinThenInvLength( lSets )
-        
-        self.assertEqual( expList, obsList )
-        
-        
-    def test_getSetListSortedByIncreasingMinThenInvLength_unordered_sameIdentifier(self):
-        set1 = Set( 1, "set1", "seq1", 21, 30 )
-        set2 = Set( 1, "set1", "seq1", 1, 10 )
-        lSets = [ set1, set2 ]
-        
-        expList = [ set2, set1 ]
-        
-        obsList = SetUtils.getSetListSortedByIncreasingMinThenInvLength( lSets )
-        
-        self.assertEqual( expList, obsList )
-        
-        
-    def test_getSetListSortedByIncreasingMinThenInvLength_unordered_overlapping(self):
-        set1 = Set( 2, "set1", "seq1", 6, 15 )
-        set2 = Set( 1, "set1", "seq1", 1, 10 )
-        lSets = [ set1, set2 ]
-        
-        expList = [ set2, set1 ]
-        
-        obsList = SetUtils.getSetListSortedByIncreasingMinThenInvLength( lSets )
-        
-        self.assertEqual( expList, obsList )
-        
-        
-    def test_getSetListSortedByIncreasingMinThenInvLength_unordered_sameMin_threeSets(self):
-        set1 = Set( 1, "set1", "seq1", 1, 10 )
-        set2 = Set( 2, "set2", "seq1", 3, 8 )
-        set3 = Set( 3, "set3", "seq1", 3, 17 )
-        lSets = [ set1, set2, set3 ]
-        
-        expList = [ set1, set3, set2 ]
-        
-        obsList = SetUtils.getSetListSortedByIncreasingMinThenInvLength( lSets )
-        
-        self.assertEqual( expList, obsList )
-        
-    def test_getSetListSortedByIncreasingMinThenInvLength_unordered_included(self):
-        set1 = Set( 1, "set1", "seq1", 2, 4 )
-        set2 = Set( 2, "set2", "seq1", 1, 5 )
-        lSets = [ set1, set2 ]
-        
-        expList = [ set2, set1 ]
-        
-        obsList = SetUtils.getSetListSortedByIncreasingMinThenInvLength( lSets )
-        
-        self.assertEqual( expList, obsList )
-        
-    def test_getSetListSortedBySeqThenRegionThenMinThenMax_already_sorted(self):
-        set1 = Set(1, "set1", "seq1", 2, 4)
-        set2 = Set(2, "set2", "seq2", 1, 5)
-        set3 = Set(3, "set3", "seq2", 8, 10)
-        lSets = [set1, set2, set3]
-        
-        expList = [set1, set2, set3]
-        
-        obsList = SetUtils.getSetListSortedBySeqThenRegionThenMinThenMax(lSets)
-        
-        self.assertEqual(expList, obsList)
-        
-    def test_getSetListSortedBySeqThenRegionThenMinThenMax_not_sorted_by_seqname(self):
-        set1 = Set(1, "set1", "seq1", 2, 4)
-        set2 = Set(2, "set2", "seq2", 1, 5)
-        set3 = Set(3, "set3", "seq2", 8, 10)
-        lSets = [set2, set1, set3]
-        
-        expList = [set1, set2, set3]
-        
-        obsList = SetUtils.getSetListSortedBySeqThenRegionThenMinThenMax(lSets)
-        
-        self.assertEqual(expList, obsList)
-         
-    def test_getSetListSortedBySeqThenRegionThenMinThenMax_not_sorted_by_region_and_start(self):
-        set1 = Set(1, "set1", "seq1", 2, 4)
-        set2 = Set(2, "set2", "seq2", 1, 5)
-        set3 = Set(3, "set3", "seq2", 8, 10)
-        lSets = [set3, set2, set1]
-        
-        expList = [set1, set2, set3]
-        
-        obsList = SetUtils.getSetListSortedBySeqThenRegionThenMinThenMax(lSets)
-        
-        self.assertEqual(expList, obsList)
-         
-    def test_getSetListSortedBySeqThenRegionThenMinThenMax_not_sorted_with_overlap(self):
-        set1 = Set(1, "set1", "seq1", 2, 4)
-        set2 = Set(2, "set2", "seq2", 1, 5)
-        set3 = Set(3, "set2", "seq2", 8, 10)
-        set4 = Set(4, "set2", "seq3", 7, 9)
-        set5 = Set(5, "set3", "seq3", 8, 12)
-        lSets = [set3, set2, set1, set5, set4]
-        
-        expList = [set1, set2, set3, set4, set5]
-        
-        obsList = SetUtils.getSetListSortedBySeqThenRegionThenMinThenMax(lSets)
-        
-        self.assertEqual(expList, obsList)
-
-    def test_getSetListSortedBySeqThenRegionThenMinThenMax_not_sorted_with_reverse(self):
-        set1 = Set(1, "set1", "seq1", 2, 4)
-        set2 = Set(2, "set2", "seq2", 1, 5)
-        set3 = Set(3, "set2", "seq2", 8, 10)
-        set4 = Set(4, "set3", "seq3", 7, 9)
-        set5 = Set(5, "set3", "seq3", 12, 5)
-        lSets = [set3, set2, set5, set1, set4]
-        
-        expList = [set1, set2, set3, set5, set4]
-        
-        obsList = SetUtils.getSetListSortedBySeqThenRegionThenMinThenMax(lSets)
-        
-        self.assertEqual(expList, obsList)
-
-    def test_getListOfIdListOfOverlappingSets_2_item_in_reference_list_overlaps_with_one_item_in_subject_list(self):
-        set1 = Set( 1, "set1", "seq1", 10, 30 )
-        set2 = Set( 2, "set2", "seq1", 40, 60 )
-        
-        lRef = [set1, set2]
-
-        set3 = Set( 3, "set2", "seq1", 25, 45 )
-        lSubj = [set3]
-        
-        lExp = [[1,-3,2]]
-        lObs = SetUtils.getListOfIdListOfOverlappingSets(lRef, lSubj)
-        
-        self.assertEquals(lExp, lObs)
-        
-    def test_getListOfIdListOfOverlappingSets_one_item_in_reference_list_overlaps_with_2_item_in_subject_list(self):
-        set1 = Set( 1, "set2", "seq1", 25, 45 )
-        lRef = [set1]
-        
-        set2 = Set( 2, "set1", "seq1", 10, 30 )
-        set3 = Set( 3, "set2", "seq1", 40, 60 )
-        
-        lSubj = [set2, set3]
-        
-        lExp = [[1,-2,-3]]
-        lObs = SetUtils.getListOfIdListOfOverlappingSets(lRef, lSubj)
-        
-        self.assertEquals(lExp, lObs)
-        
-    def test_getListOfIdListOfOverlappingSets_all_item_in_reference_list_overlaps_with_items_in_subject_list(self):
-        set1 = Set( 1, "set1", "seq1", 10, 30 )
-        set2 = Set( 2, "set2", "seq1", 40, 60 )
-        set3 = Set( 3, "set2", "seq1", 70, 90 )
-        
-        lRef = [set1, set2, set3]
-        
-        set4 = Set( 4, "set1", "seq1", 5, 9 )
-        set5 = Set( 5, "set1", "seq1", 15, 29 )
-        set6 = Set( 6, "set2", "seq1", 45, 55 )
-        set7 = Set( 7, "set2", "seq1", 57, 68 )
-        set8 = Set( 8, "set2", "seq1", 73, 85 )
-        set9 = Set( 9, "set2", "seq1", 100, 115 )
-        
-        lSubj = [set4, set5, set6, set7, set8, set9]
-        
-        lExp = [[1,-5], [2,-6,-7], [3,-8]]
-        lObs = SetUtils.getListOfIdListOfOverlappingSets(lRef, lSubj)
-        
-        self.assertEquals(lObs, lExp)
-            
-    def test_getListOfIdListOfOverlappingSets_all_item_in_subject_list_overlaps_with_items_in_reference_list(self):
-        set1 = Set( 1, "set1", "seq1", 5, 9 )
-        set2 = Set( 2, "set1", "seq1", 15, 29 )
-        set3 = Set( 3, "set2", "seq1", 45, 55 )
-        set4 = Set( 4, "set2", "seq1", 57, 68 )
-        set5 = Set( 5, "set2", "seq1", 73, 85 )
-        set6 = Set( 6, "set2", "seq1", 100, 115 )
-        
-        lRef = [set1, set2, set3, set4, set5, set6]
-        
-        set7 = Set( 7, "set1", "seq1", 10, 30 )
-        set8 = Set( 8, "set2", "seq1", 40, 60 )
-        set9 = Set( 9, "set2", "seq1", 70, 90 )
-        
-        lSubj = [set7, set8, set9]
-              
-        lExp = [[2, -7], [3, -8, 4], [5, -9]]
-        lObs = SetUtils.getListOfIdListOfOverlappingSets(lRef, lSubj)
-        
-        self.assertEquals(lObs, lExp) 
-               
-    def test_getListOfIdListOfOverlappingSets_all_item_overlaps_one_by_one(self):
-        set1 = Set( 1, "set1", "seq1", 10, 20 )
-        set2 = Set( 2, "set1", "seq1", 30, 40 )
-        set3 = Set( 3, "set2", "seq1", 50, 60 )
-        
-        lRef = [set1, set2, set3]
-        
-        lSubj = [set1, set2, set3]
-              
-        lExp = [[1, -1], [2, -2], [3, -3]]
-        lObs = SetUtils.getListOfIdListOfOverlappingSets(lRef, lSubj)
-        
-        self.assertEquals(lObs, lExp) 
-        
-    def test_getListOfIdListOfOverlappingSets_continuus_overlap_between_item_in_reference_list_and_item_in_subject_list(self):
-        set1 = Set( 1, "set1", "seq1", 10, 20 )
-        set2 = Set( 2, "set1", "seq1", 30, 40 )
-        set3 = Set( 3, "set2", "seq1", 50, 60 )
-        set4 = Set( 4, "set2", "seq1", 70, 80 )
-        
-        lRef = [set1, set2, set3, set4]
-        
-        set5 = Set( 5, "set1", "seq1", 15, 32 )
-        set6 = Set( 6, "set2", "seq1", 35, 52 )
-        set7 = Set( 7, "set2", "seq1", 55, 75 )
-        
-        lSubj = [set5, set6, set7]
-              
-        lExp = [[ 1, -5, 2, -6, 3, -7, 4 ]]
-        lObs = SetUtils.getListOfIdListOfOverlappingSets(lRef, lSubj)
-        
-        self.assertEquals(lObs, lExp)   
-        
-        
-    def test_getListOfIdListOfOverlappingSets_first_item_in_reference_overlap_with_one_item_in_subject_list(self):
-        set1 = Set( 1, "set1", "seq1", 10, 20 )
-        set2 = Set( 2, "set1", "seq1", 30, 40 )
-        
-        lRef = [set1, set2]
-        
-        set3 = Set( 3, "set1", "seq1", 5, 9 )
-        set4 = Set( 4, "set2", "seq1", 12, 25 )
-        set5 = Set( 5, "set2", "seq1", 55, 75 )
-        
-        lSubj = [set3, set4, set5]
-              
-        lExp = [[1, -4]]
-        lObs = SetUtils.getListOfIdListOfOverlappingSets(lRef, lSubj)
-        
-        self.assertEquals(lObs, lExp)
-        
-    def test_getListOfIdListOfOverlappingSets_last_item_in_reference_overlap_with_one_item_in_subject_list(self):
-        set1 = Set( 1, "set1", "seq1", 10, 20 )
-        set2 = Set( 2, "set1", "seq1", 30, 40 )
-        
-        lRef = [set1, set2]
-        
-        set3 = Set( 3, "set1", "seq1", 5, 9 )
-        set4 = Set( 4, "set2", "seq1", 32, 45 )
-        set5 = Set( 5, "set2", "seq1", 55, 75 )
-        
-        lSubj = [set3, set4, set5]
-              
-        lExp = [[2, -4]]
-        lObs = SetUtils.getListOfIdListOfOverlappingSets(lRef, lSubj)
-        
-        self.assertEquals(lObs, lExp)       
-                
-    def test_getListOfIdListOfOverlappingSets_one_item_in_reference_in_the_middle_overlap_with_one_item_in_subject_list(self):
-        set1 = Set( 1, "set1", "seq1", 10, 20 )
-        set2 = Set( 2, "set1", "seq1", 30, 40 )
-        set3 = Set( 3, "set1", "seq1", 50, 60 )
-        set4 = Set( 4, "set1", "seq1", 70, 80 )
-        
-        lRef = [set1, set2, set3, set4]
-        
-        set5 = Set( 5, "set1", "seq1", 2, 9 )
-        set6 = Set( 6, "set2", "seq1", 55, 65 )
-        set7 = Set( 7, "set2", "seq1", 90, 100 )
-        
-        lSubj = [set5, set6, set7]
-              
-        lExp = [[3, -6]]
-        lObs = SetUtils.getListOfIdListOfOverlappingSets(lRef, lSubj)
-        
-        self.assertEquals(lObs, lExp)
-        
-    def test_getListOfIdListOfOverlappingSets_first_item_in_subject_overlap_with_one_item_in_reference_list(self):
-        set1 = Set( 1, "set1", "seq1", 10, 20 )
-        set2 = Set( 2, "set1", "seq1", 30, 40 )
-        
-        lRef = [set1, set2]
-        
-        set3 = Set( 3, "set1", "seq1", 15, 25 )
-        set4 = Set( 4, "set2", "seq1", 45, 50 )
-        set5 = Set( 5, "set2", "seq1", 55, 75 )
-        
-        lSubj = [set3, set4, set5]
-              
-        lExp = [[1, -3]]
-        lObs = SetUtils.getListOfIdListOfOverlappingSets(lRef, lSubj)
-        
-        self.assertEquals(lObs, lExp)
-                
-    def test_getListOfIdListOfOverlappingSets_last_item_in_subject_overlap_with_one_item_in_reference_list(self):
-        set1 = Set( 1, "set1", "seq1", 10, 20 )
-        set2 = Set( 2, "set1", "seq1", 30, 40 )
-        
-        lRef = [set1, set2]
-        
-        set3 = Set( 3, "set1", "seq1", 1, 9 )
-        set4 = Set( 4, "set2", "seq1", 21, 29 )
-        set5 = Set( 5, "set2", "seq1", 35, 50 )
-        
-        lSubj = [set3, set4, set5]
-              
-        lExp = [[2, -5]]
-        lObs = SetUtils.getListOfIdListOfOverlappingSets(lRef, lSubj)
-        
-        self.assertEquals(lObs, lExp) 
-        
-    def test_getListOfIdListOfOverlappingSets_one_item_in_subject_in_the_middle_overlap_with_one_item_in_reference_list(self):
-        set1 = Set( 1, "set1", "seq1", 10, 20 )
-        set2 = Set( 2, "set1", "seq1", 30, 40 )
-        
-        lRef = [set1, set2]
-        
-        set3 = Set( 3, "set1", "seq1", 1, 9 )
-        set4 = Set( 4, "set2", "seq1", 21, 29 )
-        set5 = Set( 5, "set2", "seq1", 35, 50 )
-        set6 = Set( 6, "set2", "seq1", 60, 70 )
-        
-        lSubj = [set3, set4, set5, set6]
-              
-        lExp = [[2, -5]]
-        lObs = SetUtils.getListOfIdListOfOverlappingSets(lRef, lSubj)
-        
-        self.assertEquals(lObs, lExp)
-        
-    def test_getListOfMergedSetsAndNextId_each_item_in_reference_list_overlap_with_one_different_item_in_subject_list(self):
-        setRef1 = Set( 1, "set1", "seq1", 10, 20 )
-        setRef2 = Set( 2, "set1", "seq1", 30, 40 )
-        setRef3 = Set( 3, "set1", "seq1", 50, 60 )
-        
-        lRef = [setRef1, setRef2, setRef3]
-        
-        setSubj1 = Set( 1, "set1", "seq1", 12, 25 )
-        setSubj2 = Set( 2, "set1", "seq1", 31, 45 )
-        setSubj3 = Set( 3, "set1", "seq1", 55, 80 )
-        
-        lSubj = [setSubj1, setSubj2, setSubj3]
-        
-        setRef1merged = Set( 1, "set1", "seq1", 10, 25 )
-        setRef2merged = Set( 2, "set1", "seq1", 30, 45 )
-        setRef3merged = Set( 3, "set1", "seq1", 50, 80 )
-        
-        nextId = 4
-        
-        lExp = ([setRef1merged, setRef2merged, setRef3merged], nextId)
-        lObs = SetUtils.getListOfMergedSetsAndNextId(lRef, lSubj)
-        
-        self.assertEquals(lObs, lExp)
-        
-    def test_getListOfMergedSetsAndNextId_all_items_in_reference_list_overlap_with_the_same_item_in_subject_list(self):
-        setRef1 = Set( 1, "set1", "seq1", 10, 20 )
-        setRef2 = Set( 2, "set1", "seq1", 15, 25 )
-        setRef3 = Set( 3, "set1", "seq1", 20, 30 )
-        
-        lRef = [setRef1, setRef2, setRef3]
-        
-        setSubj1 = Set( 1, "set1", "seq1", 12, 35 )
-        setSubj2 = Set( 2, "set1", "seq1", 40, 45 )
-        setSubj3 = Set( 3, "set1", "seq1", 55, 80 )
-        
-        lSubj = [setSubj1, setSubj2, setSubj3]
-        
-        setRef1merged = Set( 1, "set1", "seq1", 10, 35 )
-        setSubj2Exp = Set( 4, "set1", "seq1", 40, 45 )
-        setSubj3Exp = Set( 5, "set1", "seq1", 55, 80 )
-        
-        nextId = 6
-        
-        lExp = ([setRef1merged, setSubj2Exp, setSubj3Exp], nextId)
-        lObs = SetUtils.getListOfMergedSetsAndNextId(lRef, lSubj)
-        
-        self.assertEquals(lObs, lExp)
-                
-    def test_getListOfMergedSetsAndNextId_two_last_ref_items_overlap_with_last_subject_item(self):
-        setRef1 = Set( 1, "set1", "seq1", 10, 20 )
-        setRef2 = Set( 2, "set1", "seq1", 30, 40 )
-        setRef3 = Set( 3, "set1", "seq1", 50, 60 )
-        
-        lRef = [setRef1, setRef2, setRef3]
-        
-        setSubj1 = Set( 1, "set1", "seq1", 1, 5 )
-        setSubj2 = Set( 2, "set1", "seq1", 6, 9 )
-        setSubj3 = Set( 3, "set1", "seq1", 35, 55 )
-        
-        lSubj = [setSubj1, setSubj2, setSubj3]
-        
-        setRef1Exp = Set( 1, "set1", "seq1", 10, 20 )
-        setRef2merged = Set( 2, "set1", "seq1", 30, 60 )
-        setSubj1Exp = Set( 4, "set1", "seq1", 1, 5 )
-        setSubj2Exp = Set( 5, "set1", "seq1", 6, 9 )
-        
-        nextId = 6
-        
-        lExp = ([setRef2merged, setRef1Exp, setSubj1Exp, setSubj2Exp], nextId)
-        lObs = SetUtils.getListOfMergedSetsAndNextId(lRef, lSubj)
-        
-        self.assertEquals(lObs, lExp)
-        
-    def test_getListOfMergedSetsAndNextId_all_items_in_reference_list_overlap_with_all_items_in_subject_list(self):
-        setRef1 = Set( 1, "set1", "seq1", 10, 20 )
-        setRef2 = Set( 2, "set1", "seq1", 30, 40 )
-        
-        lRef = [setRef1, setRef2]
-        
-        setSubj1 = Set( 1, "set1", "seq1", 10, 20 )
-        setSubj2 = Set( 2, "set1", "seq1", 30, 40 )
-        
-        lSubj = [setSubj1, setSubj2]
-        
-        setRef1merged = Set( 1, "set1", "seq1", 10, 20 )
-        setRef2merged = Set( 2, "set1", "seq1", 30, 40 )
-        
-        nextId = 3
-        
-        lExp = ([setRef1merged, setRef2merged], nextId)
-        lObs = SetUtils.getListOfMergedSetsAndNextId(lRef, lSubj)
-        
-        self.assertEquals(lObs, lExp)
-        
-    def test_getListOfMergedSetsAndNextId_one_item_in_reference_list_overlap_with_all_items_in_subject_list(self):
-        setRef1 = Set( 1, "set1", "seq1", 10, 20 )
-        setRef2 = Set( 2, "set1", "seq1", 30, 40 )
-        setRef3 = Set( 3, "set1", "seq1", 50, 60 )
-        
-        lRef = [setRef1, setRef2, setRef3]
-        
-        setSubj1 = Set( 1, "set1", "seq1", 11, 13 )
-        setSubj2 = Set( 2, "set1", "seq1", 14, 16 )
-        setSubj3 = Set( 3, "set1", "seq1", 17, 25 )
-        
-        lSubj = [setSubj1, setSubj2, setSubj3]
-        
-        setRef1merged = Set( 1, "set1", "seq1", 10, 25 )
-        setRef2Exp = Set( 2, "set1", "seq1", 30, 40 )
-        setRef3Exp = Set( 3, "set1", "seq1", 50, 60 )
-        
-        nextId = 4
-        
-        lExp = ([setRef1merged, setRef2Exp, setRef3Exp], nextId)
-        lObs = SetUtils.getListOfMergedSetsAndNextId(lRef, lSubj)
-        
-        self.assertEquals(lObs, lExp)
-        
-    def test_getListOfMergedSetsAndNextId_one_item_in_reference_list_overlap_with_one_item_in_subject_list(self):
-        setRef1 = Set( 1, "set1", "seq1", 10, 20 )
-        setRef2 = Set( 2, "set1", "seq1", 30, 40 )
-        setRef3 = Set( 3, "set1", "seq1", 50, 60 )
-        
-        lRef = [setRef1, setRef2, setRef3]
-        
-        setSubj1 = Set( 1, "set1", "seq1", 1, 9 )
-        setSubj2 = Set( 2, "set1", "seq1", 31, 45 )
-        setSubj3 = Set( 3, "set1", "seq1", 70, 80 )
-        
-        lSubj = [setSubj1, setSubj2, setSubj3]
-        
-        setRef1Exp = Set( 1, "set1", "seq1", 10, 20 )
-        setRef2merged = Set( 2, "set1", "seq1", 30, 45 )
-        setRef3Exp = Set( 3, "set1", "seq1", 50, 60 )
-        setSubj1Exp = Set( 4, "set1", "seq1", 1, 9 )
-        setSubj3Exp = Set( 5, "set1", "seq1", 70, 80 )
-        
-        nextId = 6
-        
-        lExp = ([setRef2merged, setRef1Exp, setRef3Exp, setSubj1Exp, setSubj3Exp], nextId)
-        
-        lObs = SetUtils.getListOfMergedSetsAndNextId(lRef, lSubj)
-        
-        self.assertEquals(lObs, lExp)
-        
-    def test_getListOfMergedSetsAndNextId_one_item_in_reference_list_overlap_with_one_item_in_subject_list_with_strange_output_order(self):
-        setRef1 = Set( 5, "set1", "seq1", 10, 20 )
-        setRef2 = Set( 6, "set1", "seq1", 30, 40 )
-        setRef3 = Set( 7, "set1", "seq1", 50, 60 )
-        setRef4 = Set( 8, "set1", "seq1", 90, 92 )
-        
-        lRef = [setRef1, setRef2, setRef3, setRef4]
-        
-        setSubj1 = Set( 1, "set1", "seq1", 1, 9 )
-        setSubj2 = Set( 2, "set1", "seq1", 35, 45 )
-        setSubj3 = Set( 3, "set1", "seq1", 70, 80 )
-        setSubj4 = Set( 4, "set1", "seq1", 130, 140 )
-        
-        lSubj = [setSubj1, setSubj2, setSubj3, setSubj4]
-        
-        setRef1Exp = Set( 5, "set1", "seq1", 10, 20 )
-        setRef2merged = Set( 6, "set1", "seq1", 30, 45 )
-        setRef3Exp = Set( 7, "set1", "seq1", 50, 60 )
-        setRef4Exp = Set( 8, "set1", "seq1", 90, 92 )
-        setSubj1Exp = Set( 9, "set1", "seq1", 1, 9 )
-        setSubj3Exp = Set( 10, "set1", "seq1", 70, 80 )
-        setSubj4Exp = Set( 11, "set1", "seq1", 130, 140 )
-        
-        nextId = 12
-        
-        lExp = ([setRef2merged, setRef4Exp, setRef1Exp, setRef3Exp, setSubj1Exp, setSubj3Exp, setSubj4Exp], nextId)
-        
-        lObs = SetUtils.getListOfMergedSetsAndNextId(lRef, lSubj)
-        
-        self.assertEquals(lObs, lExp)
-        
-    def test_getListOfMergedSetsAndNextId_all_items_overlap_between_lists_with_same_length(self):
-        setRef1 = Set( 1, "set1", "seq1", 10, 20 )
-        setRef2 = Set( 2, "set1", "seq1", 30, 40 )
-        setRef3 = Set( 3 , "set1", "seq1", 50, 60 )
-        
-        lRef = [setRef1, setRef2, setRef3]
-        
-        setSubj1 = Set( 1, "set1", "seq1", 15, 35 )
-        setSubj2 = Set( 2, "set1", "seq1", 36, 55 )
-        setSubj3 = Set( 3, "set1", "seq1", 56, 65 )
-        
-        lSubj = [setSubj1, setSubj2, setSubj3]
-        
-        setRef1merged = Set( 1, "set1", "seq1", 10, 65 )
-        
-        nextId = 4
-        
-        lExp = ([setRef1merged], nextId)
-        lObs = SetUtils.getListOfMergedSetsAndNextId(lRef, lSubj)
-        
-        self.assertEquals(lObs, lExp)
-        
-    def test_getListOfMergedSetsAndNextId_all_items_overlap_between_lists_with_different_length(self):
-        setRef1 = Set( 1, "set1", "seq1", 10, 20 )
-        setRef2 = Set( 2, "set1", "seq1", 30, 40 )
-        setRef3 = Set( 3 , "set1", "seq1", 50, 60 )
-        
-        lRef = [setRef1, setRef2, setRef3]
-        
-        setSubj1 = Set( 1, "set1", "seq1", 15, 35 )
-        setSubj2 = Set( 2, "set1", "seq1", 36, 55 )
-        
-        lSubj = [setSubj1, setSubj2]
-        
-        setRef1merged = Set( 1, "set1", "seq1", 10, 60 )
-        
-        nextId = 4
-        
-        lExp = ([setRef1merged], nextId)
-        lObs = SetUtils.getListOfMergedSetsAndNextId(lRef, lSubj)
-        
-        self.assertEquals(lObs, lExp)
-        
-    def test_getListOfSetWithoutOverlappingBetweenTwoListOfSet(self):
-        set1 = Set( 1, "set1", "seq1", 10, 20 )
-        set2 = Set( 2, "set1", "seq1", 30, 40 )
-        set3 = Set( 3, "set1", "seq1", 50, 60 )
-        
-        lSet1 = [set1, set2, set3]
-        
-        set4 = Set( 1, "set1", "seq1", 15, 35 )
-        set5 = Set( 2, "set1", "seq1", 36, 55 )
-        set6 = Set( 3, "set1", "seq1", 66, 95 )
-        
-        lSet2 = [set4, set5, set6]
-        
-        expLSet = [set6]
-        obsLSet = SetUtils.getListOfSetWithoutOverlappingBetweenTwoListOfSet(lSet1, lSet2)
-        
-        self.assertEquals(expLSet, obsLSet)
-        
-    def test_getListOfSetWithoutOverlappingBetweenTwoListOfSet_Empty_Result(self):
-        set1 = Set( 1, "set1", "seq1", 10, 20 )
-        set2 = Set( 2, "set1", "seq1", 30, 40 )
-        set3 = Set( 3, "set1", "seq1", 50, 60 )
-        
-        lSet1 = [set1, set2, set3]
-        
-        set4 = Set( 1, "set1", "seq1", 15, 35 )
-        set5 = Set( 2, "set1", "seq1", 36, 55 )
-        
-        lSet2 = [set4, set5]
-        
-        expLSet = []
-        obsLSet = SetUtils.getListOfSetWithoutOverlappingBetweenTwoListOfSet(lSet1, lSet2)
-        
-        self.assertEquals(expLSet, obsLSet)
-        
-    def test_getListOfSetWithoutOverlappingBetweenTwoListOfSet_Empty_Result_Length_Condition(self):
-        set1 = Set( 1, "set1", "seq1", 10, 20 )
-        set2 = Set( 2, "set1", "seq1", 30, 40 )
-        set3 = Set( 3, "set1", "seq1", 50, 60 )
-        
-        lSet1 = [set1, set2, set3]
-        
-        set4 = Set( 1, "set1", "seq1", 15, 35 )
-        set5 = Set( 2, "set1", "seq1", 36, 55 )
-        set6 = Set( 3, "set1", "seq1", 66, 68 )
-        
-        lSet2 = [set4, set5, set6]
-        
-        expLSet = []
-        obsLSet = SetUtils.getListOfSetWithoutOverlappingBetweenTwoListOfSet(lSet1, lSet2)
-        
-        self.assertEquals(expLSet, obsLSet)
-        
-        
-    def test_getSetListFromFile(self):
-        file = "dummyFile_%s_%s" % ( time.strftime("%Y%m%d%H%M%S"), os.getpid() )
-        fileHandler = open( file, "w" )
-        fileHandler.write( "1\tseq1\tchr1\t151\t250\n" )
-        fileHandler.write( "2\tseq2\tchr2\t301\t500\n" )
-        fileHandler.close()
-        s1 = Set()
-        s1.setFromTuple( ( "1", "seq1", "chr1", "151", "250" ) )
-        s2 = Set()
-        s2.setFromTuple( ( "2", "seq2", "chr2", "301", "500" ) )
-        expLSet = [ s1, s2 ]
-        obsLSet = SetUtils.getSetListFromFile(file)
-        os.remove(file)
-        self.assertEqual( expLSet, obsLSet )
-        
-        
-    def test_convertSetFileIntoMapFile( self ):
-        setFile = "dummySetFile"
-        setFileHandler = open( setFile, "w" )
-        setFileHandler.write( "1\tseq31\tchr1\t151\t250\n" )
-        setFileHandler.write( "2\tseq27\tchr2\t301\t500\n" )
-        setFileHandler.close()
-        
-        expFile = "dummyExpFile"
-        expFileHandler = open( expFile, "w" )
-        expFileHandler.write( "seq31\tchr1\t151\t250\n" )
-        expFileHandler.write( "seq27\tchr2\t301\t500\n" )
-        expFileHandler.close()
-        
-        obsFile = "dummyObsFile"
-        
-        SetUtils.convertSetFileIntoMapFile( setFile, obsFile )
-        
-        self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
-        
-        for f in [ setFile, expFile, obsFile ]:
-            os.remove( f )
-            
-            
-    def test_getDictOfListsWithSeqnameAsKey_empty( self ):
-        lSets = []
-        dExp = {}
-        dObs = SetUtils.getDictOfListsWithSeqnameAsKey( lSets )
-        self.assertEquals( dExp, dObs )
-            
-            
-    def test_getDictOfListsWithSeqnameAsKey( self ):
-        lSets = [ Set( 1, "TE3", "chr2", 10, 50 ),
-                 Set( 2, "gene74", "chr1", 31, 800 ),
-                 Set( 3, "TE1", "chr1", 1, 30 ) ]
-        dExp = { "chr1": [ Set( 2, "gene74", "chr1", 31, 800 ),
-                          Set( 3, "TE1", "chr1", 1, 30 ) ],
-                "chr2": [ Set( 1, "TE3", "chr2", 10, 50 ) ] }
-        dObs = SetUtils.getDictOfListsWithSeqnameAsKey( lSets )
-        self.assertEquals( dExp, dObs )
-        
-        
-    def test_filterOnLength( self ):
-        lSets = [ Set( 1, "TE3", "chr2", 10, 50 ),
-                 Set( 2, "gene74", "chr1", 31, 800 ),
-                 Set( 3, "TE1", "chr1", 1, 30 ) ]
-        lExp = [ Set( 2, "gene74", "chr1", 31, 800 ) ]
-        lObs = SetUtils.filterOnLength( lSets, 100 )
-        self.assertEqual( lExp, lObs )
-        
-        
-    def test_getListOfNames( self ):
-        setFile = "dummySetFile"
-        setFileHandler = open( setFile, "w" )
-        setFileHandler.write( "1\tseq31\tchr1\t151\t250\n" )
-        setFileHandler.write( "2\tseq27\tchr2\t301\t500\n" )
-        setFileHandler.close()
-        
-        lExp = [ "seq31", "seq27" ]
-        lObs = SetUtils.getListOfNames( setFile )
-        
-        self.assertEquals( lExp, lObs )
-        
-        os.remove( setFile )
-        
-        
-    def test_getDictOfDictsWithNamesThenIdAsKeyFromFile( self ):
-        setFile = "dummySetFile"
-        setFileHandler = open( setFile, "w" )
-        setFileHandler.write( "1\tseq31\tchr1\t151\t250\n" )
-        setFileHandler.write( "3\tseq27\tchr3\t1\t100\n" )
-        setFileHandler.write( "2\tseq27\tchr2\t301\t500\n" )
-        setFileHandler.write( "2\tseq27\tchr2\t601\t650\n" )
-        setFileHandler.close()
-        
-        dExp = { "seq31": { 1: [ Set( 1, "seq31", "chr1", 151, 250 ) ] },
-                "seq27": { 2: [ Set( 2, "seq27", "chr2", 301, 500 ),
-                               Set( 2, "seq27", "chr2", 601, 650 ) ],
-                               3: [ Set( 3, "seq27", "chr3", 1, 100 ) ]
-                               }
-                }
-        dObs = SetUtils.getDictOfDictsWithNamesThenIdAsKeyFromFile( setFile )
-        
-        self.assertEquals( dExp, dObs )
-        
-        os.remove( setFile )
-        
-        
-    def _makeSetListFromTupleList (self, tupleList):
-        setList = []
-        for tuple in tupleList:
-            set = Set()
-            set.setFromTuple(tuple)
-            setList.append(set)
-        return setList
-        
-        
-test_suite = unittest.TestSuite()
-test_suite.addTest( unittest.makeSuite( Test_SetUtils ) )
-if __name__ == "__main__":
-    unittest.TextTestRunner(verbosity=2).run( test_suite )
--- a/commons/core/coord/test/Test_SlidingWindow.py	Mon Apr 29 03:26:07 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-import unittest
-from commons.core.coord.SlidingWindow import SlidingWindow
-from commons.core.coord.SlidingWindow import SlidingWindowToCountMatchingBases
-from commons.core.coord.Set import Set
-
-class Test_SlidingWindow( unittest.TestCase ):
-        
-    def test_slideWindowOnce( self ):
-        expStart = 91 
-        expEnd = 190
-        self.sw = SlidingWindow(100, 10)
-        self.sw.slideWindowOnce()
-        obsStart = self.sw._start
-        obsEnd = self.sw._end
-        
-        self.assertEqual(expStart, obsStart)
-        self.assertEqual(expEnd, obsEnd)
-        
-    def test_slideWindowOnceFourTime( self ):
-        expStart = 201 
-        expEnd = 300
-        self.sw = SlidingWindow(100, 50)
-        i = 0
-        for i in range(4):
-            self.sw.slideWindowOnce()
-            i += 1
-        obsStart = self.sw._start
-        obsEnd = self.sw._end
-        
-        self.assertEqual(expStart, obsStart)
-        self.assertEqual(expEnd, obsEnd)
-    
-        
-class Test_SlidingWindowToCountMatchingBases(unittest.TestCase):
-        
-    def test_getSetLengthOnWindow_featureIncluded( self ):
-        self.sw = SlidingWindowToCountMatchingBases(100, 1)
-        iSet = Set( 1, "TE3", "chr1", 21, 30 )
-        exp = 10
-        obs = self.sw.getSetLengthOnWindow( iSet)
-        self.assertEqual( exp, obs )
-        
-    def test_getSetLengthOnWindow_windowIncluded( self ):
-        self.sw = SlidingWindowToCountMatchingBases(100, 10)
-        self.sw.slideWindowOnce()
-        iSet = Set( 1, "TE3", "chr1", 21, 530 )
-        exp = 100
-        obs = self.sw.getSetLengthOnWindow( iSet)
-        self.assertEqual( exp, obs )
-        
-    def test_getSetLengthOnWindow_featureOverlapLeft( self ):
-        self.sw = SlidingWindowToCountMatchingBases(100, 10)
-        self.sw.slideWindowOnce()
-        iSet = Set( 1, "TE3", "chr1", 21, 130 )
-        exp = 40
-        obs = self.sw.getSetLengthOnWindow( iSet)
-        self.assertEqual( exp, obs )
-        
-    def test_getSetLengthOnWindow_featureOverlapRight( self ):
-        self.sw = SlidingWindowToCountMatchingBases(100, 10)
-        self.sw.slideWindowOnce()
-        iSet = Set( 1, "TE3", "chr1", 121, 230 )
-        exp = 70
-        obs = self.sw.getSetLengthOnWindow( iSet)
-        self.assertEqual( exp, obs )
-        
-    def test_getCoordSetOnWindow_featureIncluded( self ):
-        self.sw = SlidingWindowToCountMatchingBases(100, 1)
-        iSet = Set( 1, "TE3", "chr1", 21, 30 )
-        expStart = 21
-        expEnd = 30
-        obsStart,obsEnd = self.sw.getCoordSetOnWindow( iSet)
-        self.assertEqual( expStart, obsStart )
-        self.assertEqual( expEnd, obsEnd )
-        
-    def test_getCoordSetOnWindow_windowIncluded( self ):
-        self.sw = SlidingWindowToCountMatchingBases(100, 10)
-        self.sw.slideWindowOnce()
-        iSet = Set( 1, "TE3", "chr1", 21, 530 )
-        expStart = 91
-        expEnd = 190
-        obsStart,obsEnd = self.sw.getCoordSetOnWindow( iSet)
-        self.assertEqual( expStart, obsStart )
-        self.assertEqual( expEnd, obsEnd )
-        
-    def test_getCoordSetOnWindow_featureOverlapLeft( self ):
-        self.sw = SlidingWindowToCountMatchingBases(100, 10)
-        self.sw.slideWindowOnce()
-        iSet = Set( 1, "TE3", "chr1", 21, 130 )
-        expStart = 91
-        expEnd = 130
-        obsStart,obsEnd = self.sw.getCoordSetOnWindow( iSet)
-        self.assertEqual( expStart, obsStart )
-        self.assertEqual( expEnd, obsEnd )
-        
-    def test_getCoordSetOnWindow_featureOverlapRight( self ):
-        self.sw = SlidingWindowToCountMatchingBases(100, 10)
-        self.sw.slideWindowOnce()
-        iSet = Set( 1, "TE3", "chr1", 121, 230 )
-        expStart = 121
-        expEnd = 190
-        obsStart,obsEnd = self.sw.getCoordSetOnWindow( iSet)
-        self.assertEqual( expStart, obsStart )
-        self.assertEqual( expEnd, obsEnd )
-
-test_suite = unittest.TestSuite()
-test_suite.addTest( unittest.makeSuite( Test_SlidingWindow ) )
-if __name__ == "__main__":
-    unittest.TextTestRunner(verbosity=2).run( test_suite )
\ No newline at end of file
--- a/commons/core/parsing/test/Test_BedParser.py	Mon Apr 29 03:26:07 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-import unittest, os
-from commons.core.parsing.BedParser import BedParser
-
-
-class Test_BedParser(unittest.TestCase):
-    
-    def test_Parser(self):
-        parser = BedParser("data/testBedParser1.bed")
-
-        self.assertEqual(parser.getNbTranscripts(), 1)
-
-        for transcript in parser.getIterator():
-            self.assertEqual(transcript.getChromosome(), "arm_X")
-            self.assertEqual(transcript.getName(), "test1.1")
-            self.assertEqual(transcript.getStart(), 1000)
-            self.assertEqual(transcript.getEnd(), 2999)
-            self.assertEqual(transcript.getDirection(), 1)
-            self.assertEqual(transcript.getNbExons(), 2)
-            exons = transcript.getExons()
-            self.assertEqual(exons[0].getChromosome(), "arm_X")
-            self.assertEqual(exons[0].getStart(), 1000)
-            self.assertEqual(exons[0].getEnd(), 1099)
-            self.assertEqual(exons[0].getDirection(), 1)
-            self.assertEqual(exons[1].getChromosome(), "arm_X")
-            self.assertEqual(exons[1].getStart(), 2000)
-            self.assertEqual(exons[1].getEnd(), 2999)
-            self.assertEqual(exons[1].getDirection(), 1)
-
-    def test_Parser_short(self):
-        tmpFileName = "tmpFile.bed"
-        tmpHandle   = open(tmpFileName, "w")
-        tmpHandle.write("""X\t554748\t554904\texon
-X\t554748\t554904\tCDS
-X\t554748\t554750\tstart_codon
-""")
-        tmpHandle.close()
-        parser = BedParser(tmpFileName)
-        self.assertEqual(parser.getNbTranscripts(), 3)
-        for cpt, transcript in enumerate(parser.getIterator()):
-            self.assertEqual(transcript.getNbExons(), 1)
-            self.assertEqual(transcript.getChromosome(), "X")
-            self.assertEqual(transcript.getStart(), 554748)
-            if cpt == 0:
-                self.assertEqual(transcript.getEnd(), 554903)
-                self.assertEqual(transcript.getName(), "exon")
-            elif cpt == 1:
-                self.assertEqual(transcript.getEnd(), 554903)
-                self.assertEqual(transcript.getName(), "CDS")
-            elif cpt == 2:
-                self.assertEqual(transcript.getEnd(), 554749)
-                self.assertEqual(transcript.getName(), "start_codon")
-        os.remove(tmpFileName)
-
-
-
-if __name__ == '__main__':
-        unittest.main()
-
--- a/commons/core/parsing/test/Test_BlatFileParser.py	Mon Apr 29 03:26:07 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-import unittest
-from commons.core.parsing.BlatFileParser import BlatFileParser
-
-
-class Test_BlatFileParser(unittest.TestCase):
-
-
-    def test_parseBlatFile(self):
-        fileName = "dummayBlat.psl"
-        self._writeBlatInputFile(fileName)
-        blatFileParser = BlatFileParser(fileName)
-        blatFileParser.parseBlatFile()
-        obsNbHits = len(blatFileParser.getListsOfHits())
-        self.assertTrue(obsNbHits == 10)
-        obsQueries = blatFileParser.getDictOfQueries()
-        expQueries = {'5:574_1:574_539_5:1:G/C': 1, '3:574_1:574_539_5:1:G/C': 1, '5:574_2:574_433_5:1:G/C': 1,"3:574_2:574_433_5:1:G/C":1, "5:574_5:574_607_5:1:G/C": 1, "3:574_5:574_607_5:1:G/C": 1}
-        self.assertEquals(expQueries, obsQueries)
-        
-    def test_parseBlatFileByQueries(self):
-        fileName = "dummayBlat.psl"
-        self._writeBlatInputFile(fileName)
-        blatFileParser = BlatFileParser(fileName)
-        blatFileParser.parseBlatFileByQueries()
-        obsDict = blatFileParser.getDictOfBlatHitsByQueries()
-        obs1 = len(obsDict["5:574_1:574_539_5:1:G/C"])
-        obs2 = len(obsDict["3:574_1:574_539_5:1:G/C"])
-        obs3 = len(obsDict["5:574_2:574_433_5:1:G/C"])
-        obs4 = len(obsDict["3:574_2:574_433_5:1:G/C"])
-        obs5 = len(obsDict["5:574_5:574_607_5:1:G/C"])
-        obs6 = len(obsDict["3:574_5:574_607_5:1:G/C"])
-        self.assertTrue(obs1 == 1)
-        self.assertTrue(obs2 == 1)
-        self.assertTrue(obs3 == 1)
-        self.assertTrue(obs4 == 5)
-        self.assertTrue(obs5 == 1)
-        self.assertTrue(obs6 == 1)
-        obsQueries = blatFileParser.getDictOfQueries()
-        expQueries = {'5:574_1:574_539_5:1:G/C': 1, '3:574_1:574_539_5:1:G/C': 1, '5:574_2:574_433_5:1:G/C': 1,"3:574_2:574_433_5:1:G/C":1, "5:574_5:574_607_5:1:G/C": 1, "3:574_5:574_607_5:1:G/C": 1}
-        self.assertEquals(expQueries, obsQueries)
-        
-    def _writeBlatInputFile(self, fileName):
-        file = open(fileName, "w")
-        file.write("psLayout version 3\n")
-        file.write("\n")
-        file.write("match\tmis- \trep. \tN's\tQ gap\tQ gap\tT gap\tT gap\tstrand\tQ        \tQ   \tQ    \tQ  \tT        \tT   \tT    \tT  \tblock\tblockSizes \tqStarts\t tStarts\n")
-        file.write("     \tmatch\tmatch\t   \tcount\tbases\tcount\tbases\t      \tname     \tsize\tstart\tend\tname     \tsize\tstart\tend\tcount\n")
-        file.write("---------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
-        file.write("246\t0\t0\t4\t0\t0\t0\t0\t-\t5:574_1:574_539_5:1:G/C\t250\t0\t250\ttaecs3B_RPH7\t3109948\t1065213\t1065463\t1\t250,\t0,\t1065213,\n")
-        file.write("247\t0\t0\t2\t0\t0\t0\t0\t-\t3:574_1:574_539_5:1:G/C\t250\t1\t250\ttaecs3B_RPH7\t3109948\t1064962\t1065211\t1\t249,\t0,\t1064962,\n")
-        file.write("249\t0\t0\t1\t0\t0\t0\t0\t-\t5:574_2:574_433_5:1:G/C\t250\t0\t250\ttaecs3B_RPH7\t3109948\t1065319\t1065569\t1\t250,\t0,\t1065319,\n")
-        file.write("245\t0\t0\t5\t0\t0\t0\t0\t-\t3:574_2:574_433_5:1:G/C\t250\t0\t250\ttaecs3B_RPH8\t3109948\t1065068\t1065318\t1\t250,\t0,\t1065068,\n")
-        file.write("247\t0\t0\t3\t0\t0\t0\t0\t-\t3:574_2:574_433_5:1:G/C\t250\t0\t250\ttaecs3B_RPH8\t3109948\t1065310\t1065560\t1\t250,\t0,\t1065310,\n")
-        file.write("247\t0\t0\t3\t0\t0\t0\t0\t-\t3:574_2:574_433_5:1:G/C\t250\t0\t250\ttaecs3B_RPH9\t3109948\t1065059\t1065309\t1\t250,\t0,\t1065059,\n")
-        file.write("247\t0\t0\t3\t0\t0\t0\t0\t-\t3:574_2:574_433_5:1:G/C\t250\t0\t250\ttaecs3B_RPH9\t3109948\t1064805\t1065055\t1\t250,\t0,\t1064805,\n")
-        file.write("68\t0\t0\t1\t0\t0\t0\t0\t-\t3:574_2:574_433_5:1:G/C\t69\t0\t69\ttaecs3B_RPH9\t3109948\t1064733\t1064802\t1\t69,\t0,\t1064733,\n")
-        file.write("245\t0\t0\t5\t0\t0\t0\t0\t-\t5:574_5:574_607_5:1:G/C\t250\t0\t250\ttaecs3B_RPH9\t3109948\t1065145\t1065395\t1\t250,\t0,\t1065145,\n")
-        file.write("247\t0\t0\t3\t0\t0\t0\t0\t-\t3:574_5:574_607_5:1:G/C\t250\t0\t250\ttaecs3B_RPH9\t3109948\t1064894\t1065144\t1\t250,\t0,\t1064894,\n")
-        file.close()
-
-if __name__ == "__main__":
-    unittest.main()
\ No newline at end of file
--- a/commons/core/parsing/test/Test_BlatParser.py	Mon Apr 29 03:26:07 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,445 +0,0 @@
-from commons.core.parsing.BlatParser import BlatParser
-import unittest
-
-
-class Test_BlatParser(unittest.TestCase):
-
-
-    def test_setAttributesFromString(self):
-        blatLine = "315\t20\t0\t0\t3\t10\t2\t9\t+\tMRRE1H001H13FM1\t378\t0\t345\tchr16\t22053297\t21686950\t21687294\t4\t76,185,7,67,\t0,77,263,278,\t21686950,21687026,21687213,21687227,"
-        
-        iBlatParser = BlatParser()
-        iBlatParser.setAttributesFromString(blatLine)
-        
-        obsmatch = iBlatParser.getMatch()
-        obsmismatch = iBlatParser.getMismatch()
-        obsrepMatch = iBlatParser.getRepMatch()
-        obsN = iBlatParser.getN()
-        obsQGapCount = iBlatParser.getQGapCount()
-        obsQGapBases = iBlatParser.getQGapBases()
-        obsTGapCount = iBlatParser.getTGapCount()
-        obsTGapBases = iBlatParser.getTGapBases()
-        obsstrand = iBlatParser.getStrand()
-        obsQName = iBlatParser.getQName()
-        obsQSize = iBlatParser.getQSize()
-        obsQStart = iBlatParser.getQStart()
-        obsQEnd = iBlatParser.getQEnd()
-        obsTName = iBlatParser.getTName()
-        obsTSize = iBlatParser.getTSize()
-        obsTStart = iBlatParser.getTStart()
-        obsTEnd = iBlatParser.getTEnd()
-        obsblockCount = iBlatParser.getBlockCount()
-        obsblockSizes = iBlatParser.getBlockSizes()
-        obsqStarts = iBlatParser.getQStarts()
-        obstStarts = iBlatParser.getTStarts()
-        
-        expmatch = "315"
-        expmismatch = "20"
-        exprepMatch = "0"
-        expN = "0"
-        expQGapCount = "3"
-        expQGapBases = "10"
-        expTGapCount = "2"
-        expTGapBases = "9"
-        expstrand = "+"
-        expQName = "MRRE1H001H13FM1"
-        expQSize = "378"
-        expQStart = "0"
-        expQEnd = "345"
-        expTName = "chr16"
-        expTSize = "22053297"
-        expTStart = "21686950"
-        expTEnd = "21687294"
-        expblockCount = "4"
-        expblockSizes = "76,185,7,67,"
-        expqStarts = "0,77,263,278,"
-        exptStarts = "21686950,21687026,21687213,21687227,"
-        
-        self.assertEquals(expmatch, obsmatch)
-        self.assertEquals(expmismatch, obsmismatch)
-        self.assertEquals(exprepMatch, obsrepMatch)
-        self.assertEquals(expN, obsN)
-        self.assertEquals(expQGapCount, obsQGapCount)
-        self.assertEquals(expQGapBases, obsQGapBases)
-        self.assertEquals(expTGapCount, obsTGapCount)
-        self.assertEquals(expTGapBases, obsTGapBases)
-        self.assertEquals(expstrand, obsstrand)
-        self.assertEquals(expQName, obsQName)
-        self.assertEquals(expQSize, obsQSize)
-        self.assertEquals(expQStart, obsQStart)
-        self.assertEquals(expQEnd, obsQEnd)
-        self.assertEquals(expTName, obsTName)
-        self.assertEquals(expTSize, obsTSize)
-        self.assertEquals(expTStart, obsTStart)
-        self.assertEquals(expTEnd, obsTEnd)
-        self.assertEquals(expblockCount, obsblockCount)
-        self.assertEquals(expblockSizes, obsblockSizes)
-        self.assertEquals(expqStarts, obsqStarts)
-        self.assertEquals(exptStarts, obstStarts)
-        
-    def test_setAttributesFromString_empty_QName(self):
-        blatLine = "315\t20\t0\t0\t3\t10\t2\t9\t+\t\t378\t0\t345\tchr16\t22053297\t21686950\t21687294\t4\t76,185,7,67,\t0,77,263,278,\t21686950,21687026,21687213,21687227,"
-        
-        iBlatParser = BlatParser()
-        iBlatParser.setAttributesFromString(blatLine)
-        
-        obsmatch = iBlatParser.getMatch()
-        obsmismatch = iBlatParser.getMismatch()
-        obsrepMatch = iBlatParser.getRepMatch()
-        obsN = iBlatParser.getN()
-        obsQGapCount = iBlatParser.getQGapCount()
-        obsQGapBases = iBlatParser.getQGapBases()
-        obsTGapCount = iBlatParser.getTGapCount()
-        obsTGapBases = iBlatParser.getTGapBases()
-        obsstrand = iBlatParser.getStrand()
-        obsQName = iBlatParser.getQName()
-        obsQSize = iBlatParser.getQSize()
-        obsQStart = iBlatParser.getQStart()
-        obsQEnd = iBlatParser.getQEnd()
-        obsTName = iBlatParser.getTName()
-        obsTSize = iBlatParser.getTSize()
-        obsTStart = iBlatParser.getTStart()
-        obsTEnd = iBlatParser.getTEnd()
-        obsblockCount = iBlatParser.getBlockCount()
-        obsblockSizes = iBlatParser.getBlockSizes()
-        obsqStarts = iBlatParser.getQStarts()
-        obstStarts = iBlatParser.getTStarts()
-        
-        expmatch = ""
-        expmismatch = ""
-        exprepMatch = ""
-        expN = ""
-        expQGapCount = ""
-        expQGapBases = ""
-        expTGapCount = ""
-        expTGapBases = ""
-        expstrand = ""
-        expQName = ""
-        expQSize = ""
-        expQStart = ""
-        expQEnd = ""
-        expTName = ""
-        expTSize = ""
-        expTStart = ""
-        expTEnd = ""
-        expblockCount = ""
-        expblockSizes = ""
-        expqStarts = ""
-        exptStarts = ""
-        
-        self.assertEquals(expmatch, obsmatch)
-        self.assertEquals(expmismatch, obsmismatch)
-        self.assertEquals(exprepMatch, obsrepMatch)
-        self.assertEquals(expN, obsN)
-        self.assertEquals(expQGapCount, obsQGapCount)
-        self.assertEquals(expQGapBases, obsQGapBases)
-        self.assertEquals(expTGapCount, obsTGapCount)
-        self.assertEquals(expTGapBases, obsTGapBases)
-        self.assertEquals(expstrand, obsstrand)
-        self.assertEquals(expQName, obsQName)
-        self.assertEquals(expQSize, obsQSize)
-        self.assertEquals(expQStart, obsQStart)
-        self.assertEquals(expQEnd, obsQEnd)
-        self.assertEquals(expTName, obsTName)
-        self.assertEquals(expTSize, obsTSize)
-        self.assertEquals(expTStart, obsTStart)
-        self.assertEquals(expTEnd, obsTEnd)
-        self.assertEquals(expblockCount, obsblockCount)
-        self.assertEquals(expblockSizes, obsblockSizes)
-        self.assertEquals(expqStarts, obsqStarts)
-        self.assertEquals(exptStarts, obstStarts)
-
-    def test_setAttributesFromString_less_than_21_fields(self):
-        blatLine = "315\t20\t0\t0\t3\t10\t2\t9\t378\t0\t345\tchr16\t22053297\t21686950\t21687294\t4\t76,185,7,67,\t0,77,263,278,\t21686950,21687026,21687213,21687227,"
-        
-        iBlatParser = BlatParser()
-        iBlatParser.setAttributesFromString(blatLine)
-        
-        obsmatch = iBlatParser.getMatch()
-        obsmismatch = iBlatParser.getMismatch()
-        obsrepMatch = iBlatParser.getRepMatch()
-        obsN = iBlatParser.getN()
-        obsQGapCount = iBlatParser.getQGapCount()
-        obsQGapBases = iBlatParser.getQGapBases()
-        obsTGapCount = iBlatParser.getTGapCount()
-        obsTGapBases = iBlatParser.getTGapBases()
-        obsstrand = iBlatParser.getStrand()
-        obsQName = iBlatParser.getQName()
-        obsQSize = iBlatParser.getQSize()
-        obsQStart = iBlatParser.getQStart()
-        obsQEnd = iBlatParser.getQEnd()
-        obsTName = iBlatParser.getTName()
-        obsTSize = iBlatParser.getTSize()
-        obsTStart = iBlatParser.getTStart()
-        obsTEnd = iBlatParser.getTEnd()
-        obsblockCount = iBlatParser.getBlockCount()
-        obsblockSizes = iBlatParser.getBlockSizes()
-        obsqStarts = iBlatParser.getQStarts()
-        obstStarts = iBlatParser.getTStarts()
-        
-        expmatch = ""
-        expmismatch = ""
-        exprepMatch = ""
-        expN = ""
-        expQGapCount = ""
-        expQGapBases = ""
-        expTGapCount = ""
-        expTGapBases = ""
-        expstrand = ""
-        expQName = ""
-        expQSize = ""
-        expQStart = ""
-        expQEnd = ""
-        expTName = ""
-        expTSize = ""
-        expTStart = ""
-        expTEnd = ""
-        expblockCount = ""
-        expblockSizes = ""
-        expqStarts = ""
-        exptStarts = ""
-        
-        self.assertEquals(expmatch, obsmatch)
-        self.assertEquals(expmismatch, obsmismatch)
-        self.assertEquals(exprepMatch, obsrepMatch)
-        self.assertEquals(expN, obsN)
-        self.assertEquals(expQGapCount, obsQGapCount)
-        self.assertEquals(expQGapBases, obsQGapBases)
-        self.assertEquals(expTGapCount, obsTGapCount)
-        self.assertEquals(expTGapBases, obsTGapBases)
-        self.assertEquals(expstrand, obsstrand)
-        self.assertEquals(expQName, obsQName)
-        self.assertEquals(expQSize, obsQSize)
-        self.assertEquals(expQStart, obsQStart)
-        self.assertEquals(expQEnd, obsQEnd)
-        self.assertEquals(expTName, obsTName)
-        self.assertEquals(expTSize, obsTSize)
-        self.assertEquals(expTStart, obsTStart)
-        self.assertEquals(expTEnd, obsTEnd)
-        self.assertEquals(expblockCount, obsblockCount)
-        self.assertEquals(expblockSizes, obsblockSizes)
-        self.assertEquals(expqStarts, obsqStarts)
-        self.assertEquals(exptStarts, obstStarts)
-        
-    def test_setAttributes(self):
-        lResults = ['315','20','0','0','3','10','2','9','+','MRRE1H001H13FM1','378','0','345','chr16','22053297','21686950','21687294','4','76,185,7,67,','0,77,263,278,','21686950,21687026,21687213,21687227,']
-        lineNumber = 1
-        
-        iBlatParser = BlatParser()
-        iBlatParser.setAttributes(lResults, lineNumber)
-        
-        obsmatch = iBlatParser.getMatch()
-        obsmismatch = iBlatParser.getMismatch()
-        obsrepMatch = iBlatParser.getRepMatch()
-        obsN = iBlatParser.getN()
-        obsQGapCount = iBlatParser.getQGapCount()
-        obsQGapBases = iBlatParser.getQGapBases()
-        obsTGapCount = iBlatParser.getTGapCount()
-        obsTGapBases = iBlatParser.getTGapBases()
-        obsstrand = iBlatParser.getStrand()
-        obsQName = iBlatParser.getQName()
-        obsQSize = iBlatParser.getQSize()
-        obsQStart = iBlatParser.getQStart()
-        obsQEnd = iBlatParser.getQEnd()
-        obsTName = iBlatParser.getTName()
-        obsTSize = iBlatParser.getTSize()
-        obsTStart = iBlatParser.getTStart()
-        obsTEnd = iBlatParser.getTEnd()
-        obsblockCount = iBlatParser.getBlockCount()
-        obsblockSizes = iBlatParser.getBlockSizes()
-        obsqStarts = iBlatParser.getQStarts()
-        obstStarts = iBlatParser.getTStarts()
-        
-        expmatch = "315"
-        expmismatch = "20"
-        exprepMatch = "0"
-        expN = "0"
-        expQGapCount = "3"
-        expQGapBases = "10"
-        expTGapCount = "2"
-        expTGapBases = "9"
-        expstrand = "+"
-        expQName = "MRRE1H001H13FM1"
-        expQSize = "378"
-        expQStart = "0"
-        expQEnd = "345"
-        expTName = "chr16"
-        expTSize = "22053297"
-        expTStart = "21686950"
-        expTEnd = "21687294"
-        expblockCount = "4"
-        expblockSizes = "76,185,7,67,"
-        expqStarts = "0,77,263,278,"
-        exptStarts = "21686950,21687026,21687213,21687227,"
-        
-        self.assertEquals(expmatch, obsmatch)
-        self.assertEquals(expmismatch, obsmismatch)
-        self.assertEquals(exprepMatch, obsrepMatch)
-        self.assertEquals(expN, obsN)
-        self.assertEquals(expQGapCount, obsQGapCount)
-        self.assertEquals(expQGapBases, obsQGapBases)
-        self.assertEquals(expTGapCount, obsTGapCount)
-        self.assertEquals(expTGapBases, obsTGapBases)
-        self.assertEquals(expstrand, obsstrand)
-        self.assertEquals(expQName, obsQName)
-        self.assertEquals(expQSize, obsQSize)
-        self.assertEquals(expQStart, obsQStart)
-        self.assertEquals(expQEnd, obsQEnd)
-        self.assertEquals(expTName, obsTName)
-        self.assertEquals(expTSize, obsTSize)
-        self.assertEquals(expTStart, obsTStart)
-        self.assertEquals(expTEnd, obsTEnd)
-        self.assertEquals(expblockCount, obsblockCount)
-        self.assertEquals(expblockSizes, obsblockSizes)
-        self.assertEquals(expqStarts, obsqStarts)
-        self.assertEquals(exptStarts, obstStarts)
-        
-    def test_eq_Equals_case1(self):
-        BlatParser1 = BlatParser()
-        BlatParser1.setMatch("315")
-        BlatParser1.setMismatch("20")
-        BlatParser1.setRepMatch("0")
-        BlatParser1.setN("0")
-        BlatParser1.setQGapCount("3")
-        BlatParser1.setQGapBases("10")
-        BlatParser1.setTGapCount("2")
-        BlatParser1.setTGapBases("9")
-        BlatParser1.setStrand("+")
-        BlatParser1.setQName("MRRE1H001H13FM1")
-        BlatParser1.setQSize("378")
-        BlatParser1.setQStart("0")
-        BlatParser1.setQEnd("345")
-        BlatParser1.setTName("chr16")
-        BlatParser1.setTSize("22053297")
-        BlatParser1.setTStart("21686950")
-        BlatParser1.setTEnd("21687294")
-        BlatParser1.setBlockCount("4")
-        BlatParser1.setBlockSizes("76,185,7,67,")
-        BlatParser1.setQStarts("0,77,263,278,")
-        BlatParser1.setTStarts("21686950,21687026,21687213,21687227,")
-        
-        BlatParser2 = BlatParser()
-        BlatParser2.setMatch("315")
-        BlatParser2.setMismatch("20")
-        BlatParser2.setRepMatch("0")
-        BlatParser2.setN("0")
-        BlatParser2.setQGapCount("3")
-        BlatParser2.setQGapBases("10")
-        BlatParser2.setTGapCount("2")
-        BlatParser2.setTGapBases("9")
-        BlatParser2.setStrand("+")
-        BlatParser2.setQName("MRRE1H001H13FM1")
-        BlatParser2.setQSize("378")
-        BlatParser2.setQStart("0")
-        BlatParser2.setQEnd("345")
-        BlatParser2.setTName("chr16")
-        BlatParser2.setTSize("22053297")
-        BlatParser2.setTStart("21686950")
-        BlatParser2.setTEnd("21687294")
-        BlatParser2.setBlockCount("4")
-        BlatParser2.setBlockSizes("76,185,7,67,")
-        BlatParser2.setQStarts("0,77,263,278,")
-        BlatParser2.setTStarts("21686950,21687026,21687213,21687227,")
-        
-        self.assertTrue(BlatParser1 == BlatParser2) 
-        
-    def test_eq_Equals_case2(self):
-        BlatParser1 = BlatParser()
-        BlatParser1.setMatch("315")
-        BlatParser1.setMismatch("20")
-        BlatParser1.setRepMatch("0")
-        BlatParser1.setN("0")
-        BlatParser1.setQGapCount("3")
-        BlatParser1.setQGapBases("10")
-        BlatParser1.setTGapCount("2")
-        BlatParser1.setTGapBases("9")
-        BlatParser1.setStrand("+")
-        BlatParser1.setQName("MRRE1H001H13FM1")
-        BlatParser1.setQSize("378")
-        BlatParser1.setQStart("0")
-        BlatParser1.setQEnd("345")
-        BlatParser1.setTName("chr16")
-        BlatParser1.setTSize("22053297")
-        BlatParser1.setTStart("21686950")
-        BlatParser1.setTEnd("21687294")
-        BlatParser1.setBlockCount("4")
-        BlatParser1.setBlockSizes("76,185,7,67,")
-        BlatParser1.setQStarts("0,77,263,278,")
-        BlatParser1.setTStarts("21686950,21687026,21687213,21687227,")
-        
-        BlatParser2 = BlatParser()
-        BlatParser2.setMatch("315")
-        BlatParser2.setMismatch("20")
-        BlatParser2.setRepMatch("0")
-        BlatParser2.setN("0")
-        BlatParser2.setQGapCount("3")
-        BlatParser2.setQGapBases("10")
-        BlatParser2.setTGapCount("2")
-        BlatParser2.setTGapBases("9")
-        BlatParser2.setStrand("+")
-        BlatParser2.setQName("TotoFM2")
-        BlatParser2.setQSize("378")
-        BlatParser2.setQStart("0")
-        BlatParser2.setQEnd("345")
-        BlatParser2.setTName("chr16")
-        BlatParser2.setTSize("22053297")
-        BlatParser2.setTStart("21686950")
-        BlatParser2.setTEnd("21687294")
-        BlatParser2.setBlockCount("4")
-        BlatParser2.setBlockSizes("76,185,7,67,")
-        BlatParser2.setQStarts("0,77,263,278,")
-        BlatParser2.setTStarts("21686950,21687026,21687213,21687227,")
-        
-        self.assertTrue(BlatParser1 == BlatParser2) 
-        
-    def test_eq_notEquals(self):
-        BlatParser1 = BlatParser()
-        BlatParser1.setMatch("315")
-        BlatParser1.setMismatch("20")
-        BlatParser1.setRepMatch("0")
-        BlatParser1.setN("0")
-        BlatParser1.setQGapCount("3")
-        BlatParser1.setQGapBases("10")
-        BlatParser1.setTGapCount("2")
-        BlatParser1.setTGapBases("9")
-        BlatParser1.setStrand("+")
-        BlatParser1.setQName("MRRE1H001H13FM1")
-        BlatParser1.setQSize("378")
-        BlatParser1.setQStart("0")
-        BlatParser1.setQEnd("345")
-        BlatParser1.setTName("chr16")
-        BlatParser1.setTSize("22053297")
-        BlatParser1.setTStart("21686950")
-        BlatParser1.setTEnd("21687294")
-        BlatParser1.setBlockCount("4")
-        BlatParser1.setBlockSizes("76,185,7,67,")
-        BlatParser1.setQStarts("0,77,263,278,")
-        BlatParser1.setTStarts("21686950,21687026,21687213,21687227,")
-        
-        BlatParser2 = BlatParser()
-        BlatParser2.setMatch("315")
-        BlatParser2.setMismatch("20")
-        BlatParser2.setRepMatch("0")
-        BlatParser2.setN("0")
-        BlatParser2.setQGapCount("3")
-        BlatParser2.setQGapBases("10")
-        BlatParser2.setTGapCount("2")
-        BlatParser2.setTGapBases("9")
-        BlatParser2.setStrand("+")
-        BlatParser2.setQName("TotoFM2")
-        BlatParser2.setQSize("378")
-        BlatParser2.setQStart("0")
-        BlatParser2.setQEnd("345")
-        BlatParser2.setTName("chr8")
-        BlatParser2.setTSize("2205")
-        BlatParser2.setTStart("2124")
-        BlatParser2.setTEnd("2168")
-        BlatParser2.setBlockCount("4")
-        BlatParser2.setBlockSizes("76,185,7,67,")
-        BlatParser2.setQStarts("0,77,263,278,")
-        BlatParser2.setTStarts("21686950,21687026,21687213,21687227,")
-        
-        self.assertFalse(BlatParser1 == BlatParser2) 
-
-if __name__ == "__main__":
-    unittest.main()
\ No newline at end of file
--- a/commons/core/parsing/test/Test_BlatToGff.py	Mon Apr 29 03:26:07 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-from commons.core.parsing.BlatToGff import BlatToGff
-import unittest
-
-
-class Test_BlatToGff(unittest.TestCase):
-
-
-    def test_convertBlatObjectToGffLine(self):
-        blatLine = '315\t20\t0\t0\t3\t10\t2\t9\t+\tMRRE1H001H13FM1\t378\t0\t345\tchr16\t22053297\t21686950\t21687294\t4\t76,185,7,67,\t0,77,263,278,\t21686950,21687026,21687213,21687227,\n'
-        nbLine = 15
-        iBlatToGff = BlatToGff()
-        BlatToGff._methodName = ''
-        obsGffLine = iBlatToGff.convertBlatObjectToGffLine(blatLine, nbLine)
-        expGffLine = 'chr16\tBlatToGff\tBES\t21686950\t21687294\t.\t+\t.\tID=MRRE1H001H13FM1;Name=MRRE1H001H13FM1;bes_start=21686950;bes_end=21687294;bes_size=22053297\n'
-        self.assertEquals(expGffLine, obsGffLine)
-
-    def test_convertBlatObjectToGffLine_with_methodName(self):
-        blatLine = '315\t20\t0\t0\t3\t10\t2\t9\t+\tMRRE1H001H13FM1\t378\t0\t345\tchr16\t22053297\t21686950\t21687294\t4\t76,185,7,67,\t0,77,263,278,\t21686950,21687026,21687213,21687227,\n'
-        nbLine = 15
-        iBlatToGff = BlatToGff()
-        BlatToGff._methodName = 'Test'
-        obsGffLine = iBlatToGff.convertBlatObjectToGffLine(blatLine, nbLine)
-        expGffLine = 'chr16\tBlatToGff\tTest:BES\t21686950\t21687294\t.\t+\t.\tID=MRRE1H001H13FM1;Name=MRRE1H001H13FM1;bes_start=21686950;bes_end=21687294;bes_size=22053297\n'
-        self.assertEquals(expGffLine, obsGffLine)
-
-
-if __name__ == "__main__":
-    unittest.main()
\ No newline at end of file
--- a/commons/core/parsing/test/Test_BlatToGffForBesPaired.py	Mon Apr 29 03:26:07 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,292 +0,0 @@
-import unittest, os
-from commons.core.parsing.BlatToGffForBesPaired import BlatToGffForBesPaired
-
-
-class Test_BlatToGffForBesPaired(unittest.TestCase):
-
-
-    def test_convertBlatObjectToGffLine(self):
-        blatLine = '315\t20\t0\t0\t3\t10\t2\t9\t+\tMRRE1H001H13FM1\t378\t0\t345\tchr16\t22053297\t21686950\t21687294\t4\t76,185,7,67,\t0,77,263,278,\t21686950,21687026,21687213,21687227,\n'
-        nbLine = 15
-        besFastaFileName = '%s/commons/core/parsing/test/besSequences.fasta' % os.environ['REPET_PATH']
-        self._writeBesSequences(besFastaFileName)
-        iBlatToGffForBesPaired = BlatToGffForBesPaired()
-        iBlatToGffForBesPaired._methodName = ''
-        iBlatToGffForBesPaired._inputFileFasta = besFastaFileName
-        obsGffLine, obsBesName, obsBesSeq, obsBesType = iBlatToGffForBesPaired.convertBlatObjectToGffLine(blatLine, nbLine)
-        expGffLine = 'chr16\tBlatToGffForBesPaired\tBES\t21686950\t21687294\t.\t+\t.\tID=MRRE1H001H13FM1;Name=MRRE1H001H13FM1;bes_start=21686950;bes_end=21687294;bes_size=22053297;muscadine_seq=AGACCTACTACGACGTACGATCGATCGACTGCTAGCTAGCTAGGCCTAGCTAGCTAGCTAGCTAGCTAGC\n'
-        expBesName = 'MRRE1H001H13FM1'
-        expBesSeq = 'AGACCTACTACGACGTACGATCGATCGACTGCTAGCTAGCTAGGCCTAGCTAGCTAGCTAGCTAGCTAGC'
-        expBesType = 'FM'
-        self.assertEquals(expGffLine, obsGffLine)
-        self.assertEquals(expBesName, obsBesName)
-        self.assertEquals(expBesSeq, obsBesSeq)
-        self.assertEquals(expBesType, obsBesType)
-        os.remove(besFastaFileName)
-
-    def test_convertBlatObjectToGffLine_with_methodName(self):
-        blatLine = '315\t20\t0\t0\t3\t10\t2\t9\t+\tMRRE1H001H13FM1\t378\t0\t345\tchr16\t22053297\t21686950\t21687294\t4\t76,185,7,67,\t0,77,263,278,\t21686950,21687026,21687213,21687227,\n'
-        nbLine = 15
-        besFastaFileName = '%s/commons/core/parsing/test/besSequences.fasta' % os.environ['REPET_PATH']
-        self._writeBesSequences(besFastaFileName)
-        iBlatToGffForBesPaired = BlatToGffForBesPaired()
-        iBlatToGffForBesPaired._methodName = 'Test'
-        iBlatToGffForBesPaired._inputFileFasta = besFastaFileName
-        obsGffLine, obsBesName, obsBesSeq, obsBesType = iBlatToGffForBesPaired.convertBlatObjectToGffLine(blatLine, nbLine)
-        expGffLine = 'chr16\tBlatToGffForBesPaired\tTest:BES\t21686950\t21687294\t.\t+\t.\tID=MRRE1H001H13FM1;Name=MRRE1H001H13FM1;bes_start=21686950;bes_end=21687294;bes_size=22053297;muscadine_seq=AGACCTACTACGACGTACGATCGATCGACTGCTAGCTAGCTAGGCCTAGCTAGCTAGCTAGCTAGCTAGC\n'
-        expBesName = 'MRRE1H001H13FM1'
-        expBesSeq = 'AGACCTACTACGACGTACGATCGATCGACTGCTAGCTAGCTAGGCCTAGCTAGCTAGCTAGCTAGCTAGC'
-        expBesType = 'FM'
-        self.assertEquals(expGffLine, obsGffLine)
-        self.assertEquals(expBesName, obsBesName)
-        self.assertEquals(expBesSeq, obsBesSeq)
-        self.assertEquals(expBesType, obsBesType)
-        os.remove(besFastaFileName)
-    
-    def test_getBesName(self):
-        col9 = 'ID=machin1;Name=machin1;bes_start=21736364;bes_end=21737069;bes_size=22053297\n'
-        iBlatToGffForBesPaired = BlatToGffForBesPaired()
-        obsBesName = iBlatToGffForBesPaired.getBesName(col9)
-        expBesName = 'machin1'
-        self.assertEquals(expBesName, obsBesName)
-                
-    def test_checkBesNames_OK(self):
-        besName1 = 'MRRE1H001H13FM8'
-        besName2 = 'MRRE1H001H13RM2'
-        line = 10
-        iBlatToGffForBesPaired = BlatToGffForBesPaired()
-        self.assertTrue(iBlatToGffForBesPaired.checkBesNames(besName1, besName2, line))
-        
-    def test_checkBesNames_NOK(self):
-        besName1 = 'MRRE1H001H13FM1'
-        besName2 = 'TOTORM2'
-        line = 10
-        iBlatToGffForBesPaired = BlatToGffForBesPaired()
-        self.assertFalse(iBlatToGffForBesPaired.checkBesNames(besName1, besName2, line))
-        
-    def test_checkBesPositions_OK1(self):
-        tBes1 = ('chr16', 25, 150)
-        tBes2 = ('chr16', 300, 350)
-        iBlatToGffForBesPaired = BlatToGffForBesPaired()
-        self.assertTrue(iBlatToGffForBesPaired.checkBesPositions(tBes1, tBes2))
-        
-    def test_checkBesPositions_OK2(self):
-        tBes1 = ('chr16', 300, 350)
-        tBes2 = ('chr16', 3, 50)
-        iBlatToGffForBesPaired = BlatToGffForBesPaired()
-        self.assertTrue(iBlatToGffForBesPaired.checkBesPositions(tBes1, tBes2))
-    
-    def test_checkBesPositions_NOK1(self):
-        tBes1 = ('chr16', 25, 150)
-        tBes2 = ('chr14', 300, 350)
-        iBlatToGffForBesPaired = BlatToGffForBesPaired()
-        self.assertFalse(iBlatToGffForBesPaired.checkBesPositions(tBes1, tBes2))
-    
-    def test_checkBesPositions_NOK2(self):
-        tBes1 = ('chr16', 25, 300)
-        tBes2 = ('chr16', 150, 350)
-        iBlatToGffForBesPaired = BlatToGffForBesPaired()
-        self.assertFalse(iBlatToGffForBesPaired.checkBesPositions(tBes1, tBes2))
-    
-    def test_checkBesPositions_NOK3(self):
-        tBes1 = ('chr16', 25, 300)
-        tBes2 = ('chr16', 1, 50)
-        iBlatToGffForBesPaired = BlatToGffForBesPaired()
-        self.assertFalse(iBlatToGffForBesPaired.checkBesPositions(tBes1, tBes2))
-        
-    def test_getBacName(self):
-        besName = 'MRRE1H001H13FM1'
-        iBlatToGffForBesPaired = BlatToGffForBesPaired()
-        obsBacName = iBlatToGffForBesPaired.getBacName(besName)
-        expBacName = 'MRRE1H001H13'
-        self.assertEquals(expBacName, obsBacName)
-        
-    def test_getBacPositions_case1(self):
-        tBes1 = ('chr16', 25, 300)
-        tBes2 = ('chr16', 1, 50)
-        iBlatToGffForBesPaired = BlatToGffForBesPaired()
-        obsStart, obsEnd = iBlatToGffForBesPaired.getBacPositions(tBes1, tBes2)
-        expStart = 1
-        expEnd = 300
-        self.assertEquals(expStart, obsStart)
-        self.assertEquals(expEnd, obsEnd)
-        
-    def test_getBacPositions_case2(self):
-        tBes1 = ('chr16', 1, 300)
-        tBes2 = ('chr16', 1000, 50000)
-        iBlatToGffForBesPaired = BlatToGffForBesPaired()
-        obsStart, obsEnd = iBlatToGffForBesPaired.getBacPositions(tBes1, tBes2)
-        expStart = 1
-        expEnd = 50000
-        self.assertEquals(expStart, obsStart)
-        self.assertEquals(expEnd, obsEnd)
-        
-    def test_getBacPositions_case3(self):
-        tBes1 = ('chr16', 300, 25)
-        tBes2 = ('chr16', 1, 50)
-        iBlatToGffForBesPaired = BlatToGffForBesPaired()
-        obsStart, obsEnd = iBlatToGffForBesPaired.getBacPositions(tBes1, tBes2)
-        expStart = 1
-        expEnd = 300
-        self.assertEquals(expStart, obsStart)
-        self.assertEquals(expEnd, obsEnd)
-        
-    def test_createGffLineForBac(self):
-        gffLine1 = 'chr16\tBlatToGffForBesPaired\tBES\t10\t1000\t.\t+\t.\tID=MRRE1H001H13FM1;Name=MRRE1H001H13FM1;bes_start=10;bes_end=1000;bes_size=991;muscadine_seq=ATCGATCGATCGATCGTACGACTGACTCGATCAGCTAGCTAGCTAGCACATCG\n'
-        nameBes1 = 'MRRE1H001H13FM1'
-        seqBes1 = 'ATCGATCGATCGATCGTACGACTGACTCGATCAGCTAGCTAGCTAGCACATCG'
-        typeBes1 = 'FM'
-        gffLine2 = 'chr16\tBlatToGffForBesPaired\tBES\t2000\t3000\t.\t+\t.\tID=MRRE1H001H13RM2;Name=MRRE1H001H13RM2;bes_start=2000;bes_end=3000;bes_size=1001;muscadine_seq=CAGCTAGCTACGTACGTACGTACGTAGCATCGATCGAT\n'
-        nameBes2 = 'MRRE1H001H13RM2'
-        seqBes2 = 'CAGCTAGCTACGTACGTACGTACGTAGCATCGATCGAT'
-        typeBes2 = 'RM'
-        line = 2
-        iBlatToGffForBesPaired = BlatToGffForBesPaired()
-        iBlatToGffForBesPaired._methodName = ''
-        obsGffBac = iBlatToGffForBesPaired.createGffLineForBac(gffLine1, nameBes1, seqBes1, typeBes1, gffLine2, nameBes2, seqBes2, typeBes2, line)
-        expGffBac = 'chr16\tBlatToGffForBesPaired\tBAC\t10\t3000\t.\t.\t.\tID=MRRE1H001H13;Name=MRRE1H001H13;bac_start=10;bac_end=3000;bac_size=2991;besFM_name=MRRE1H001H13FM1;muscadine_besFM_seq=ATCGATCGATCGATCGTACGACTGACTCGATCAGCTAGCTAGCTAGCACATCG;besRM_name=MRRE1H001H13RM2;muscadine_besRM_seq=CAGCTAGCTACGTACGTACGTACGTAGCATCGATCGAT\n'
-        self.assertEquals(expGffBac, obsGffBac)
-        
-    def test_createGffLineForBac_with_methodName(self):
-        gffLine1 = 'chr16\tBlatToGffForBesPaired\tBES\t10\t1000\t.\t+\t.\tID=MRRE1H001H13FM1;Name=MRRE1H001H13FM1;bes_start=10;bes_end=1000;bes_size=991;muscadine_seq=ATCGATCGATCGATCGTACGACTGACTCGATCAGCTAGCTAGCTAGCACATCG\n'
-        nameBes1 = 'MRRE1H001H13FM1'
-        seqBes1 = 'ATCGATCGATCGATCGTACGACTGACTCGATCAGCTAGCTAGCTAGCACATCG'
-        typeBes1 = 'FM'
-        gffLine2 = 'chr16\tBlatToGffForBesPaired\tBES\t2000\t3000\t.\t+\t.\tID=MRRE1H001H13RM2;Name=MRRE1H001H1