Ejemplo n.º 1
0
 def testNonFind(self):
     """ mafPositionFinder should not report any lines when blocks do not match.
     """
     global g_header
     mtt.makeTempDirParent()
     for i in xrange(0, len(g_nonOverlappingBlocks)):
         tmpDir = os.path.abspath(mtt.makeTempDir('nonFind'))
         testMafPath, g_header = mtt.testFile(
             os.path.abspath(os.path.join(tmpDir, 'test.maf')),
             ''.join(g_nonOverlappingBlocks[i][0]), g_headers)
         parent = os.path.dirname(os.path.dirname(
             os.path.abspath(__file__)))
         cmd = [
             os.path.abspath(
                 os.path.join(parent, 'test', 'mafPositionFinder'))
         ]
         cmd += [
             '--maf', testMafPath, '--seq', g_targetSeq, '--pos',
             '%d' % g_nonOverlappingBlocks[i][1]
         ]
         outpipes = [os.path.abspath(os.path.join(tmpDir, 'found.txt'))]
         mtt.recordCommands([cmd], tmpDir, outPipes=outpipes)
         mtt.runCommandsS([cmd], tmpDir, outPipes=outpipes)
         self.assertTrue(mtt.fileIsEmpty(os.path.join(tmpDir, 'found.txt')))
         mtt.removeDir(tmpDir)
Ejemplo n.º 2
0
 def testNonFind(self):
     """ mafPositionFinder should not report any lines when blocks do not match.
     """
     global g_header
     mtt.makeTempDirParent()
     for i in xrange(0, len(g_nonOverlappingBlocks)):
         tmpDir = os.path.abspath(mtt.makeTempDir('nonFind'))
         testMafPath, g_header = mtt.testFile(os.path.abspath(os.path.join(tmpDir, 'test.maf')),
                                              ''.join(g_nonOverlappingBlocks[i][0]), g_headers)
         parent = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
         cmd = [os.path.abspath(os.path.join(parent, 'test', 'mafPositionFinder'))]
         cmd += ['--maf', testMafPath, '--seq', g_targetSeq, '--pos', '%d' % g_nonOverlappingBlocks[i][1]]
         outpipes = [os.path.abspath(os.path.join(tmpDir, 'found.txt'))]
         mtt.recordCommands([cmd], tmpDir, outPipes=outpipes)
         mtt.runCommandsS([cmd], tmpDir, outPipes=outpipes)
         self.assertTrue(mtt.fileIsEmpty(os.path.join(tmpDir, 'found.txt')))
         mtt.removeDir(tmpDir)
Ejemplo n.º 3
0
 def testNonExtraction(self):
     """ mafBlockExtractor should not extract blocks when they do not match.
     """
     for i in xrange(0, 10):
         tmpDir = os.path.abspath(mtt.makeTempDir())
         random.shuffle(g_nonOverlappingBlocks)
         testMaf = mtt.testFile(os.path.abspath(os.path.join(os.curdir, 'tempTestDir', 'test.maf')),
                                ''.join(g_nonOverlappingBlocks), g_headers)
         parent = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
         cmd = [os.path.abspath(os.path.join(parent, 'test', 'mafBlockExtractor'))]
         cmd += ['--maf', os.path.abspath(os.path.join(os.curdir, 'tempTestDir', 'test.maf')),
                 '--seq', g_targetSeq, '--start', '%d' % g_targetRange[0], 
                 '--stop', '%d' % g_targetRange[1]]
         outpipes = [os.path.abspath(os.path.join(tmpDir, 'extracted.maf'))]
         mtt.runCommandsS([cmd], tmpDir, outPipes=outpipes)
         self.assertTrue(mtt.fileIsEmpty(os.path.join(tmpDir, 'extracted.maf')))
         mtt.removeTempDir()
Ejemplo n.º 4
0
 def dtestNonFind(self):
     """ mafBlockFinder should not report any lines when blocks do not match.
     """
     global g_header
     for i in xrange(0, len(g_nonOverlappingBlocks)):
         tmpDir = os.path.abspath(mtt.makeTempDir())
         testMafPath, g_header = mtt.testFile(
             os.path.abspath(os.path.join(os.curdir, "tempTestDir", "test.maf")),
             "".join(g_nonOverlappingBlocks[i][0]),
             g_headers,
         )
         parent = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
         cmd = [os.path.abspath(os.path.join(parent, "test", "mafBlockFinder"))]
         cmd += ["--maf", testMafPath, "--seq", g_targetSeq, "--pos", "%d" % g_nonOverlappingBlocks[i][1]]
         outpipes = [os.path.abspath(os.path.join(tmpDir, "found.txt"))]
         mtt.runCommandsS([cmd], tmpDir, outPipes=outpipes)
         self.assertTrue(mtt.fileIsEmpty(os.path.join(tmpDir, "found.txt")))
         mtt.removeTempDir()