Used for searching, this function masks the complexity behind retrieving a specific character at a specific index
        in our compressed BWT.
        @param index - the index to retrieve the character from
        @param return - return the character in our BWT that's at a particular index (integer format)

def getCharAtIndex(self, index):
        '''
        Used for searching, this function masks the complexity behind retrieving a specific character at a specific index
        in our compressed BWT.
        @param index - the index to retrieve the character from
        @param return - return the character in our BWT that's at a particular index (integer format)
        '''
        #get the bin we should start from
        binID = index >> self.bitPower
        bwtIndex = self.refFM[binID]
        
        #these are the values that indicate how far in we really are
        trueIndex = np.sum(self.partialFM[binID])-self.offsetSum
        dist = index-trueIndex
        
        #calculate how big of a region we actually need to 'decompress'
        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
        
        #extract the symbols and counts associated with each byte
        letters = np.bitwise_and(self.bwt[bwtIndex:endRange], self.mask)
        counts = np.right_shift(self.bwt[bwtIndex:endRange], self.letterBits, dtype='<u8')
        
        #numpy methods for find the powers
        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:])
        
        #these are the true counts after raising to the appropriate power
        cs = np.cumsum(counts)
        x = np.searchsorted(cs, dist, 'right')
        return letters[x]