Example #1
0
 def _fwdStrand():
     fwd_hamming_distances = seqstr.rollingHammingDistance(primer_str,
                                                           genome_rc_str)
     fwd_hd_thresh = np.percentile(fwd_hamming_distances, hamming_percentile)
     fwd_primer_footprint = (-(primer_idx+primer_length), (-primer_idx))
     fwd_hamming_distances[fwd_primer_footprint[0]: \
                           fwd_primer_footprint[1]] = primer_length
     fwd_hotspots, = np.where((fwd_hamming_distances < fwd_hd_thresh))
     highest_tm_idx = None
     highest_tm = -100
     for idx in fwd_hotspots:
         tm = primer3.calcHeterodimerTm(
             primer_str, genome_str[-(idx+primer_length):-idx],
             **params['thermo_params'])
         if tm > highest_tm:
             highest_tm_idx = idx
             highest_tm = tm
     strand_results.put((highest_tm, highest_tm_idx, 1))
Example #2
0
    def _revStrand():
        rev_hamming_distances = seqstr.rollingHammingDistance(primer_str,
                                                              genome_str)
        rev_hd_thresh = np.percentile(rev_hamming_distances, hamming_percentile)
        rev_primer_footprint = ((primer_idx), (primer_idx+primer_length))
        rev_hamming_distances[rev_primer_footprint[0]: \
                              rev_primer_footprint[1]] = primer_length
        rev_hotspots, = np.where((rev_hamming_distances < rev_hd_thresh))

        highest_tm_idx = None
        highest_tm = -100
        for idx in rev_hotspots:
            tm = primer3.calcHeterodimerTm(
                primer_str, genome_rc_str[idx:idx+primer_length],
                **params['thermo_params'])
            if tm > highest_tm:
                highest_tm_idx = idx
                highest_tm = tm
        strand_results.put((highest_tm, highest_tm_idx, 0))
Example #3
0
    def _revStrand():
        rev_hamming_distances = seqstr.rollingHammingDistance(primer_str[12:],
                                                              genome_str)
        rev_hd_thresh = np.percentile(rev_hamming_distances, hamming_percentile)
        rev_primer_footprint = ((primer_idx), (primer_idx+primer_length))
        rev_hamming_distances[rev_primer_footprint[0]: \
                              rev_primer_footprint[1]] = primer_length
        rev_hotspots, = np.where((rev_hamming_distances < rev_hd_thresh))

        highest_dg_idx = None
        highest_dg = -100

        for idx in rev_hotspots:
            dg = primer3.calcEndStability(
                primer_str, genome_rc_str[idx:idx+primer_length],
                **params['thermo_params']).dg
            if dg > highest_dg:
                highest_dg_idx = idx
                highest_dg = dg

        strand_results.put((highest_dg, highest_dg_idx, 0))
Example #4
0
    def _fwdStrand():
        fwd_hamming_distances = seqstr.rollingHammingDistance(primer_str[12:],
                                                              genome_rc_str)
        fwd_hd_thresh = np.percentile(fwd_hamming_distances, hamming_percentile)
        fwd_primer_footprint = (-(primer_idx+primer_length), (-primer_idx))
        fwd_hamming_distances[fwd_primer_footprint[0]: \
                              fwd_primer_footprint[1]] = primer_length
        fwd_hotspots, = np.where((fwd_hamming_distances < fwd_hd_thresh))
        highest_dg_idx = None
        highest_dg = -100

        for idx in fwd_hotspots:
            dg = primer3.calcEndStability(
                primer_str, genome_str[-(idx+primer_length):-idx],
                **params['thermo_params']).dg
            if dg > highest_dg:
                highest_dg_idx = idx
                highest_dg = dg

        sys.stdout.flush()

        strand_results.put((highest_dg, highest_dg_idx, 1))