Example #1
0
def get_not_annotation_indexes(_annotation, _excluded_annotations):
    """
    method returns indexes of not annotation's values in _annotation parameter,
    annotation values are defined in _excluded_annotations parameter
    """
    if len(_annotation) == 0:
        return EMPTY_ARRAY
    elif _excluded_annotations == ALL_ANNOTATIONS:
        return pl.array(pl.find(_annotation == 0))
    else:
        #find indexes of an annotation array which are NOT included
        #in _excluded_annotations list
        return pl.array(pl.where(pl.logical_not(
                pl.in1d(_annotation, _excluded_annotations)))[0], dtype=int)
Example #2
0
def get_annotation_indexes(_annotation, _excluded_annotations):
    """
    method returns indexes of annotation's values in _annotation parameter
    according to annotations defined by _excluded_annotations parameter
    """
    if len(_annotation) == 0:
        return EMPTY_ARRAY
    elif _excluded_annotations == ALL_ANNOTATIONS:
        return pl.array(pl.find(_annotation != 0))
    else:
        #find indexes of annotation array where values are in
        #_excluded_annotations list
        return pl.array(pl.where(
                    pl.in1d(_annotation, _excluded_annotations))[0], dtype=int)