def test_append_accession_and_version(self): temp_gb2 = os.path.join(self.scan_ref_dir, "temp_acessioned.gb") append_accession_and_version(accession="BA000007.2", ingb=self.no_accession_gb, finalgb=temp_gb2) self.assertEqual(md5(temp_gb2), md5(self.with_accession_gb)) self.to_be_removed.append(temp_gb2)
def test_merge_outfiles(self): """ """ merged_tab = merge_outfiles( filelist=[self.test_combine, self.test_combine], outfile=os.path.join(self.score_ref_dir, "temp_combined.tab")) self.assertEqual( md5(os.path.join(self.score_ref_dir, "test_combined.tab")), md5(merged_tab)) self.to_be_removed.append(merged_tab)
def test_append_replacement_contigs(self): outfile = os.path.join(self.test_dir, "contigs_minus_NODE_3.fasta") remove_bad_contig( infile=self.bad_fasta, # outfile=self.good_fasta, outfile=outfile, # bad_name="NODE_3_length_222_cov_5.70526", bad_name="NODE_3_", logger=logger) append_replacement_contigs(infile=self.good_fasta, outfile=outfile, name_list="NODE_4_:NODE_5_".split(":"), logger=logger) self.assertEqual( md5(outfile), md5(os.path.join(self.ref_dir, "ref_swapped_contigs.fasta"))) self.to_be_removed.append(outfile)
def test_combine_gbs(self): temp_gb = os.path.join(self.scan_ref_dir, "temp_combined.gb") combine_gbs(finalgb=temp_gb, gb_list=[self.no_locus_gff, self.with_locus_gff]) self.assertEqual(md5(temp_gb), md5(self.combined_file))
def test_add_locus_tags_to_gff(self): """check with executable""" add_locus_tags_to_gff(gff=self.no_locus_gff, acc="BA000007.2") new_gff = str(os.path.splitext(self.no_locus_gff)[0] + "_tagged.gff") self.assertEqual(md5(new_gff), md5(self.with_locus_gff)) self.to_be_removed.append(new_gff)