def near_to_position(self, position, max_distance):
        '''Returns true iff the record is within max_distance of the given position.
        Note: chromosome name not checked, so that's up to you to do first.'''
        end = self.ref_end_pos()
        return self.POS <= position <= end or abs(position - self.POS) <= max_distance or abs(position - end) <= max_distance