ragtag_utilities/ContigAlignment.py
def _get_location_confidence(self):
        """ Calculate the location confidence score. """
        best_ref_alns = self._get_best_ref_alns()

        # Get all the alignment reference intervals for alignments to the best reference sequence
        aln_intervals = []
        all_positions = []
        for i in best_ref_alns:
            aln_intervals.append((self._ref_starts[i], self._ref_ends[i]))
            all_positions.append(self._ref_starts[i])
            all_positions.append(self._ref_ends[i])

        # The denominator is the max - min alignment positions
        denom = max(all_positions) - min(all_positions)

        # The numerator is the coverage
        num = 0
        sorted_intervals = sorted(aln_intervals, key=lambda tup: tup[0])
        max_end = -1
        for j in sorted_intervals:
            start_new_terr = max(j[0], max_end)
            num += max(0, j[1] - start_new_terr)
            max_end = max(max_end, j[1])

        self.location_confidence = num/denom
 Calculate the location confidence score. 
Calculate the location confidence score.
Calculate the location confidence score .
def _get_location_confidence(self):
        best_ref_alns = self._get_best_ref_alns()
        aln_intervals = []
        all_positions = []
        for i in best_ref_alns:
            aln_intervals.append((self._ref_starts[i], self._ref_ends[i]))
            all_positions.append(self._ref_starts[i])
            all_positions.append(self._ref_ends[i])
        denom = max(all_positions) - min(all_positions)
        num = 0
        sorted_intervals = sorted(aln_intervals, key=lambda tup: tup[0])
        max_end = -1
        for j in sorted_intervals:
            start_new_terr = max(j[0], max_end)
            num += max(0, j[1] - start_new_terr)
            max_end = max(max_end, j[1])
        self.location_confidence = num/denom
def _get_location_confidence ( self ) : best_ref_alns = self . _get_best_ref_alns ( ) aln_intervals = [ ] all_positions = [ ] for i in best_ref_alns : aln_intervals . append ( ( self . _ref_starts [ i ] , self . _ref_ends [ i ] ) ) all_positions . append ( self . _ref_starts [ i ] ) all_positions . append ( self . _ref_ends [ i ] ) denom = max ( all_positions ) - min ( all_positions ) num = 0 sorted_intervals = sorted ( aln_intervals , key = lambda tup : tup [ 0 ] ) max_end = - 1 for j in sorted_intervals : start_new_terr = max ( j [ 0 ] , max_end ) num += max ( 0 , j [ 1 ] - start_new_terr ) max_end = max ( max_end , j [ 1 ] ) self . location_confidence = num / denom
Calculate the location confidence score.
Calculate the location confidence score .
""" Calculate the location confidence score. """ # Get all the alignment reference intervals for alignments to the best reference sequence # The denominator is the max - min alignment positions # The numerator is the coverage
self