def getFullFMAtIndex(self, index):
        '''
        This function creates a complete FM-index for a specific position in the BWT.  Example using the above example:
        BWT    Full FM-index
                 $ A C G T
        C        0 1 2 4 4
        $        0 1 3 4 4
        C        1 1 3 4 4
        A        1 1 4 4 4
                 1 2 4 4 4
        @return - the above information in the form of an array that already incorporates the offset value into the counts
        '''
        if index == self.totalSize:
            return np.cumsum(self.totalCounts)
        
        #get the bin we start from
        binID = index >> self.bitPower
        bwtIndex = self.refFM[binID]
        
        #figure out how far in we really are
        ret = np.copy(self.partialFM[binID])
        trueIndex = np.sum(ret)-self.offsetSum
        dist = index-trueIndex
        if dist == 0:
            return ret
        
        #find the end of the region of interest
        if binID == self.refFM.shape[0]-1:
            endRange = self.bwt.shape[0]
        else:
            endRange = self.refFM[binID+1]+1
            while endRange < self.bwt.shape[0] and (self.bwt[endRange] & self.mask) == (self.bwt[endRange-1] & self.mask):
                endRange += 1
        
        #split the letters and numbers in the compressed bwt
        letters = np.bitwise_and(self.bwt[bwtIndex:endRange], self.mask)
        counts = np.right_shift(self.bwt[bwtIndex:endRange], self.letterBits, dtype='<u8')
        
        i = 1
        same = (letters[0:-1] == letters[1:])
        while np.count_nonzero(same) > 0:
            (counts[i:])[same] *= self.numPower
            i += 1
            same = np.bitwise_and(same[0:-1], same[1:])
        
        cs = np.subtract(np.cumsum(counts), counts)
        x = np.searchsorted(cs, dist, 'left')
        if x > 1:
            ret += np.bincount(letters[0:x-1], counts[0:x-1], minlength=self.vcLen)
        ret[letters[x-1]] += dist-cs[x-1]
        
        return ret
def getFullFMAtIndex ( self , index ) : if index == self . totalSize : return np . cumsum ( self . totalCounts ) binID = index >> self . bitPower bwtIndex = self . refFM [ binID ] ret = np . copy ( self . partialFM [ binID ] ) trueIndex = np . sum ( ret ) - self . offsetSum dist = index - trueIndex if dist == 0 : return ret if binID == self . refFM . shape [ 0 ] - 1 : endRange = self . bwt . shape [ 0 ] else : endRange = self . refFM [ binID + 1 ] + 1 while endRange < self . bwt . shape [ 0 ] and ( self . bwt [ endRange ] & self . mask ) == ( self . bwt [ endRange - 1 ] & self . mask ) : endRange += 1 letters = np . bitwise_and ( self . bwt [ bwtIndex : endRange ] , self . mask ) counts = np . right_shift ( self . bwt [ bwtIndex : endRange ] , self . letterBits , dtype = '<u8' ) i = 1 same = ( letters [ 0 : - 1 ] == letters [ 1 : ] ) while np . count_nonzero ( same ) > 0 : ( counts [ i : ] ) [ same ] *= self . numPower i += 1 same = np . bitwise_and ( same [ 0 : - 1 ] , same [ 1 : ] ) cs = np . subtract ( np . cumsum ( counts ) , counts ) x = np . searchsorted ( cs , dist , 'left' ) if x > 1 : ret += np . bincount ( letters [ 0 : x - 1 ] , counts [ 0 : x - 1 ] , minlength = self . vcLen ) ret [ letters [ x - 1 ] ] += dist - cs [ x - 1 ] return ret
This function creates a complete FM-index for a specific position in the BWT.  Example using the above example:
        BWT    Full FM-index
                 $ A C G T
        C        0 1 2 4 4
        $        0 1 3 4 4
        C        1 1 3 4 4
        A        1 1 4 4 4
                 1 2 4 4 4
        @return - the above information in the form of an array that already incorporates the offset value into the counts