Пример #1
0
    def generate_primers(self):
        forward_homology = self.forward_homology_arm(self.fwd_ha_len)
        reverse_homology = self.reverse_homology_arm(self.rev_ha_len)

        forward_primer, reverse_primer = Primer.from_sequence(
            self.sequence,
            forward_overhang=forward_homology + self.degeneracy,
            reverse_overhang=reverse_homology.reverse_complement()
        )

        return forward_primer, reverse_primer
Пример #2
0
def find_primers(target_dna, user_parameters, search_range):
    primers = []
    if target_dna.len < 500:
        ideal_len = (16, 18)
    elif target_dna.len > 2500:
        ideal_len = (20, 24)
    else:
        ideal_len = (17, 22)
    search_start = max(0, target_dna.start-search_range)
    
    for i in range(search_start, target_dna.start+1):
        for j in range(ideal_len[0], ideal_len[1]+1):
            primer = Primer(target_dna, i, i+j)
            parameters = primer.parameters()
            
            if user_parameters[0][0] <= parameters[0] <= user_parameters[0][1] and\
               user_parameters[1][0] <= parameters[1] <= user_parameters[1][1] and\
               not parameters[3] and not parameters[4] and parameters[5]:
                if user_parameters[2] == None:
                    primers.append(primer)
                else:
                    if user_parameters[2] == parameters[2]:
                        primers.append(primer)                   
    return primers