示例#1
0
 def test_ebov_refine2(self):
     inDir = util.file.get_test_input_path(self)
     inFasta = os.path.join(inDir, 'expected.ebov.refine1.fasta')
     refine1Fasta = util.file.mkstempfname('.refine1.fasta')
     refine2Fasta = util.file.mkstempfname('.refine2.fasta')
     shutil.copy(inFasta, refine1Fasta)
     tools.picard.CreateSequenceDictionaryTool().execute(refine1Fasta, overwrite=True)
     tools.novoalign.NovoalignTool().index_fasta(refine1Fasta)
     assembly.refine_assembly(
         refine1Fasta,
         os.path.join(util.file.get_test_input_path(), 'G5012.3.mini.bam'),
         refine2Fasta,
         # normally -r Random, but for unit tests, we want deterministic behavior
         novo_params='-r None -l 40 -x 20 -t 100',
         min_coverage=3)
     actual = str(Bio.SeqIO.read(refine2Fasta, 'fasta').seq)
     expected = str(Bio.SeqIO.read(os.path.join(inDir, 'expected.ebov.refine2.fasta'), 'fasta').seq)
     self.assertEqual(actual, expected)
 def test_ebov_refine2(self):
     inDir = util.file.get_test_input_path(self)
     inFasta = os.path.join(inDir, 'expected.ebov.refine1.fasta')
     refine1Fasta = util.file.mkstempfname('.refine1.fasta')
     refine2Fasta = util.file.mkstempfname('.refine2.fasta')
     shutil.copy(inFasta, refine1Fasta)
     tools.picard.CreateSequenceDictionaryTool().execute(refine1Fasta,
                                                         overwrite=True)
     tools.novoalign.NovoalignTool().index_fasta(refine1Fasta)
     assembly.refine_assembly(
         refine1Fasta,
         os.path.join(util.file.get_test_input_path(), 'G5012.3.mini.bam'),
         refine2Fasta,
         # normally -r Random, but for unit tests, we want deterministic behavior
         novo_params='-r None -l 40 -x 20 -t 100',
         min_coverage=3)
     actual = str(Bio.SeqIO.read(refine2Fasta, 'fasta').seq)
     expected = str(
         Bio.SeqIO.read(os.path.join(inDir, 'expected.ebov.refine2.fasta'),
                        'fasta').seq)
     self.assertEqual(actual, expected)