def test_trim_stop_codons(self): """trims stop codons using the specified genetic code""" trimmer = sample.trim_stop_codons(gc=1) # standard code seqs = make_unaligned_seqs(data={ "seq1": "AAATTTCCC", "seq2": "AAATTTTAA" }, moltype="dna") got = trimmer(seqs) expect = {"seq1": "AAATTTCCC", "seq2": "AAATTT"} self.assertEqual(got.to_dict(), expect) trimmer = sample.trim_stop_codons(gc=1) # standard code aln = make_aligned_seqs(data={ "seq1": "AAATTTCCC", "seq2": "AAATTTTAA" }, moltype="dna") got = trimmer(aln) expect = {"seq1": "AAATTTCCC", "seq2": "AAATTT---"} self.assertEqual(got.to_dict(), expect) # different genetic code trimmer = sample.trim_stop_codons(gc=2) # mt code seqs = make_unaligned_seqs(data={ "seq1": "AAATTTCCC", "seq2": "AAATTTAGA" }, moltype="dna") got = trimmer(seqs) expect = {"seq1": "AAATTTCCC", "seq2": "AAATTT"} self.assertEqual(got.to_dict(), expect)
def _get_all_composables(tmp_dir_name): test_model1 = evo.model("HKY85") test_model2 = evo.model("GN") test_hyp = evo.hypothesis(test_model1, test_model2) test_num_reps = 100 applications = [ align.align_to_ref(), align.progressive_align(model="GY94"), evo.ancestral_states(), evo.bootstrap(hyp=test_hyp, num_reps=test_num_reps), evo.hypothesis(test_model1, test_model2), evo.model("GN"), evo.tabulate_stats(), sample.fixed_length(100), sample.min_length(100), io.write_db(tmp_dir_name, create=True), io.write_json(tmp_dir_name, create=True), io.write_seqs(tmp_dir_name, create=True), sample.omit_bad_seqs(), sample.omit_degenerates(), sample.omit_duplicated(), sample.take_codon_positions(1), sample.take_named_seqs(), sample.trim_stop_codons(gc=1), translate.select_translatable(), tree.quick_tree(), tree.scale_branches(), tree.uniformize_tree(), ] return applications
def _get_all_composable_apps(): applications = [ align.align_to_ref(), align.progressive_align(model="GY94"), sample.fixed_length(100), sample.min_length(100), io.write_seqs(os.getcwd()), sample.omit_bad_seqs(), sample.omit_degenerates(), sample.take_codon_positions(1), sample.take_named_seqs(), sample.trim_stop_codons(gc=1), ] return applications