Esempio n. 1
0
 def test_gmapCreateDB_case1(self):
     """Test _gmapCreateDB(refFile, isWithinRepository, tempRootDir).
     Condition: the reference is not within a reference repository.
     """
     # Case 1: the reference is not within a reference repository
     files = PBAlignFiles()
     parser = argparse.ArgumentParser()
     argumentList = [self.queryFofn, self.refFa, self.outSam,
                     '--algorithm', 'gmap']
     parser, options, _info = parseOptions(argumentList=argumentList,
                                           parser=parser)
     service = GMAPService(options, files)
     dbRoot, dbName = service._gmapCreateDB(self.refFa, False, self.outDir)
     self.assertTrue(path.exists(dbRoot))
     self.assertTrue(path.exists(path.join(dbRoot, dbName)))
Esempio n. 2
0
 def test_gmapCreateDB_case1(self):
     """Test _gmapCreateDB(refFile, isWithinRepository, tempRootDir).
     Condition: the reference is not within a reference repository.
     """
     # Case 1: the reference is not within a reference repository
     files = PBAlignFiles()
     parser = argparse.ArgumentParser()
     argumentList = [
         self.queryFofn, self.refFa, self.outSam, '--algorithm', 'gmap'
     ]
     parser, options, _info = parseOptions(argumentList=argumentList,
                                           parser=parser)
     service = GMAPService(options, files)
     dbRoot, dbName = service._gmapCreateDB(self.refFa, False, self.outDir)
     self.assertTrue(path.exists(dbRoot))
     self.assertTrue(path.exists(path.join(dbRoot, dbName)))
Esempio n. 3
0
 def test_gmapCreateDB_case2(self):
     """Test _gmapCreateDB(refFile, isWithinRepository, tempRootDir).
     Condition: the reference is within a reference repository.
     """
     # Case 2: the reference is within a reference repository
     files = PBAlignFiles()
     parser = argparse.ArgumentParser()
     argumentList = [self.queryFofn, self.repoPath, self.outSam,
                     '--algorithm', 'gmap']
     parser, options, _info = parseOptions(argumentList=argumentList,
                                           parser=parser)
     service = GMAPService(options, files)
     dbRoot, dbName = service._gmapCreateDB(files.targetFileName, True,
                                            self.outDir)
     self.assertEqual(path.abspath(dbRoot), path.abspath(self.repoPath))
     self.assertEqual(dbName, "gmap_db")
Esempio n. 4
0
 def test_gmapCreateDB_case2(self):
     """Test _gmapCreateDB(refFile, isWithinRepository, tempRootDir).
     Condition: the reference is within a reference repository.
     """
     # Case 2: the reference is within a reference repository
     files = PBAlignFiles()
     parser = argparse.ArgumentParser()
     argumentList = [
         self.queryFofn, self.repoPath, self.outSam, '--algorithm', 'gmap'
     ]
     parser, options, _info = parseOptions(argumentList=argumentList,
                                           parser=parser)
     service = GMAPService(options, files)
     dbRoot, dbName = service._gmapCreateDB(files.targetFileName, True,
                                            self.outDir)
     self.assertEqual(path.abspath(dbRoot), path.abspath(self.repoPath))
     self.assertEqual(dbName, "gmap_db")
Esempio n. 5
0
    def __init__(self, argumentList):
        """Initialize a PBAlignRunner object.
           argumentList is a list of arguments, such as:
           ['--debug', '--maxHits', '10', 'in.fasta', 'ref.fasta', 'out.sam']
        """
        desc = "Utilities for aligning PacBio reads to reference sequences."
        super(PBAlignRunner, self).__init__(desc)
        self._argumentList = argumentList
        self._alnService = None
        self._filterService = None
        self.fileNames = PBAlignFiles()
        self._tempFileManager = TempFileManager()

        self.parser, self.args, _infoMsg = parseOptions(
            argumentList=self._argumentList, parser=self.parser)
        # args.verbosity is computed by counting # of 'v's in '-vv...'.
        # However in parseOptions, arguments are parsed twice to import config
        # options and then overwrite them with argumentList (e.g. command-line)
        # options.
        self.args.verbosity = 0 if (self.args.verbosity is None) else \
            int(self.args.verbosity) / 2