def test_grow_primers(self):
        temp_calculator = TemperatureConfig().create_calculator()
        prefix = "TTTTTTTTTTAAAAAC"
        overlap = "CGCC"
        suffix = "AAAAACTTTTTTTTTT"

        temp_thresh_fw = 25.0
        temp_thresh_rv = 25.0
        overlaps = [SSMPrimerSpec(len(prefix), len(overlap), len(overlap), 0)]

        mutations = [AminoMutation(len(prefix), "", "", "", 0)]

        sequence = prefix + overlap + suffix
        print(sequence)

        fw_computed, rv_computed = grow_primers(min(len(prefix),
                                                    len(suffix)), 0, sequence,
                                                mutations, overlaps,
                                                temp_thresh_fw, temp_thresh_rv,
                                                temp_calculator)

        expected_fw = SSMPrimerSpec(offset=len(prefix),
                                    length=13,
                                    three_end_size=10,
                                    three_end_temp=29.0)
        expected_rv = SSMPrimerSpec(offset=5,
                                    length=15,
                                    three_end_size=11,
                                    three_end_temp=28.0)

        self.assertEqual(expected_fw, fw_computed[0])
        self.assertEqual(expected_rv, rv_computed[0])
    def test_grow_reverse_primer(self):
        temp_calculator = TemperatureConfig().create_calculator()

        max_primer_size = 12
        sequence = "AAACCCGGGTTTAAAGGGCCC"
        mutation = AminoMutation(10, "", "", "", 0)
        overlap = SSMPrimerSpec(10, 3, 0, 0)

        primer = grow_reverse_primer(max_primer_size, 0, sequence, mutation,
                                     overlap, 10, temp_calculator)

        self.assertEqual(primer.three_end_temp, temp_calculator("CCGGGT"))
        self.assertEqual(primer.three_end_size, 6)
        self.assertEqual(primer.offset, 4)
    def test_grow_reverse_offset(self):
        temp_calculator = TemperatureConfig().create_calculator()
        prefix = "TTTTTTTTTTAAAAAC"
        overlap = "CGCC"

        sequence = prefix + overlap
        print(sequence)

        rv_computed = grow_reverse_primer(
            30, 0, sequence, AminoMutation(len(prefix), "", "", "", 0),
            SSMPrimerSpec(len(prefix), len(overlap), 0, 0), 25.0,
            temp_calculator)

        expected_rv = SSMPrimerSpec(offset=5,
                                    length=15,
                                    three_end_size=11,
                                    three_end_temp=28.0)

        self.assertEqual(expected_rv, rv_computed)
Beispiel #4
0
def step_impl(context, mutation_start):
    context.mutation = AminoMutation(mutation_start, "A", "F")
Beispiel #5
0
def step_impl(context, mutation_start):
    context.five_end_size = context.primer.get_five_end_size_from_mutation(
        AminoMutation(mutation_start, "A", "F"))