def test_tuple_row(self): row = ( "species-3", "locus-mt", "0.25", "4.0", "5", "4", "11.423634", "587", "0.227487", "0.222071", "0.259081", "../sequences/species-3-locus-mt.fasta", ) ac = AlignmentConfig(row) self.assertEqual(ac.taxon_name, "species-3") self.assertEqual(ac.locus_name, "locus-mt") self.assertEqual(ac.ploidy_multiplier, 0.25) self.assertEqual(ac.mutation_rate_multiplier, 4.0) self.assertEqual(ac.number_of_gene_copies, (5, 4)) self.assertEqual(ac.kappa, 11.423634) self.assertEqual(ac.length, 587) self.assertEqual(ac.base_frequencies, (0.227487, 0.222071, 0.259081)) self.assertEqual(ac.path, "../sequences/species-3-locus-mt.fasta") self.assertEqual([str(x) for x in ac.get_sample_table_row_elements()], list(row)) self.assertEqual(str(ac), "\t".join(row))
def test_equality(self): row1 = ( "species-3", "locus-mt", "0.25", "4.0", "5", "4", "11.423634", "587", "0.227487", "0.222071", "0.259081", "../sequences/species-3-locus-mt.fasta", ) ac1 = AlignmentConfig(row1) ac2 = AlignmentConfig(row1) self.assertFalse(ac1 == ac2) self.assertTrue(ac1.equals(ac2)) row2 = ( "species-3", "locus-mt", "0.25", "4.0", "5", "4", "11.423633", "587", "0.227487", "0.222071", "0.259082", "../sequences/species-3-locus-mt.fasta", ) ac3 = AlignmentConfig(row2) self.assertFalse(ac1.equals(ac3))
def test_tuple_row(self): row = ("species-3", "locus-mt", "0.25", "4.0", "5", "4", "11.423634", "587", "0.227487", "0.222071", "0.259081", "../sequences/species-3-locus-mt.fasta") ac = AlignmentConfig(row) self.assertEqual(ac.taxon_name, "species-3") self.assertEqual(ac.locus_name, "locus-mt") self.assertEqual(ac.ploidy_multiplier, 0.25) self.assertEqual(ac.mutation_rate_multiplier, 4.0) self.assertEqual(ac.number_of_gene_copies, (5, 4)) self.assertEqual(ac.kappa, 11.423634) self.assertEqual(ac.length, 587) self.assertEqual(ac.base_frequencies, (0.227487, 0.222071, 0.259081)) self.assertEqual(ac.path, "../sequences/species-3-locus-mt.fasta") self.assertEqual([str(x) for x in ac.get_sample_table_row_elements()], list(row)) self.assertEqual(str(ac), '\t'.join(row))
def test_string_row(self): row = ("species-3\tlocus-mt\t0.25\t4.0\t5\t4\t11.423634\t587\t0.227487" "\t0.222071\t0.259081\t../sequences/species-3-locus-mt.fasta") ac = AlignmentConfig(row) self.assertEqual(ac.taxon_name, "species-3") self.assertEqual(ac.locus_name, "locus-mt") self.assertEqual(ac.ploidy_multiplier, 0.25) self.assertEqual(ac.mutation_rate_multiplier, 4.0) self.assertEqual(ac.number_of_gene_copies, (5, 4)) self.assertEqual(ac.kappa, 11.423634) self.assertEqual(ac.length, 587) self.assertEqual(ac.base_frequencies, (0.227487, 0.222071, 0.259081)) self.assertEqual(ac.path, "../sequences/species-3-locus-mt.fasta") self.assertEqual(str(ac), row)
def test_equality(self): row1 = ("species-3", "locus-mt", "0.25", "4.0", "5", "4", "11.423634", "587", "0.227487", "0.222071", "0.259081", "../sequences/species-3-locus-mt.fasta") ac1 = AlignmentConfig(row1) ac2 = AlignmentConfig(row1) self.assertFalse(ac1 == ac2) self.assertTrue(ac1.equals(ac2)) row2 = ("species-3", "locus-mt", "0.25", "4.0", "5", "4", "11.423633", "587", "0.227487", "0.222071", "0.259082", "../sequences/species-3-locus-mt.fasta") ac3 = AlignmentConfig(row2) self.assertFalse(ac1.equals(ac3))