immuneML.analysis.criteria_matches package

Submodules

immuneML.analysis.criteria_matches.BooleanType module

class immuneML.analysis.criteria_matches.BooleanType.BooleanType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

AND = 0
OR = 1

immuneML.analysis.criteria_matches.CriteriaMatcher module

class immuneML.analysis.criteria_matches.CriteriaMatcher.CriteriaMatcher[source]

Bases: object

Takes a data frame (for example, repertoire or feature annotations) and criteria and allowed values as input and returns a list of boolean values indicating a match or not for each row

static evaluate_and(booleans: list)[source]
static evaluate_column(data: pandas.Series, name: str) pandas.Series[source]
static evaluate_greater_than(data: pandas.Series, criteria: dict)[source]
static evaluate_in(data: pandas.Series, criteria: dict)[source]
static evaluate_less_than(data: pandas.Series, criteria: dict)[source]
static evaluate_not_in(data: pandas.Series, criteria: dict)[source]
static evaluate_not_na(data: pandas.Series, criteria: dict)[source]
static evaluate_or(booleans: list)[source]
static evaluate_random_n(data: pandas.Series, criteria: dict)[source]
static evaluate_top_n(data: pandas.Series, criteria: dict)[source]
match(criteria, data)[source]
filter_params = {

“type”: BooleanType.OR, “operands”: [

{

“type”: BooleanType.AND, “operands”: [

{

“type”: OperationType.IN, “allowed_values”: [“GAD”, “PPI”], “value”: {

“type”: DataType.COLUMN, “name”: “matching_specificity”

}

}, {

“type”: OperationType.LESS_THAN, “threshold”: 0.001, “value”: {

“type”: DataType.COLUMN, “name”: “p_val”

}

},

]

}, {

“type”: BooleanType.AND, “operands”: [

{

“type”: OperationType.IN, “allowed_values”: [“yes”], “value”: {

“type”: DataType.COLUMN, “name”: “a”

}

}, {

“type”: OperationType.GREATER_THAN, “threshold”: 0.5, “value”: {

“type”: DataType.COLUMN, “name”: “odds_ratio”

}

},

]

},

]

}

The order of matching is done from the innermost list to the outermost list. Each column has criteria specified with a dictionary with keys “column”, “type”, and “value”. “column” must be present within the data being matched to. Allowed “type”s are “in”, “less_than”, and “greater_than”. Between each column criteria, an operator must be specified to specify how the criteria are to be combined. To force an order of operations, it can be nested within a list. Innermost lists are done first, and recursively simplified until it reaches the outermost list to match criteria.

Parameters:

data

Returns:

static parse_criteria(criteria, data)[source]

immuneML.analysis.criteria_matches.CriteriaTypeInstantiator module

class immuneML.analysis.criteria_matches.CriteriaTypeInstantiator.CriteriaTypeInstantiator[source]

Bases: object

static instantiate(criteria)[source]

immuneML.analysis.criteria_matches.DataType module

class immuneML.analysis.criteria_matches.DataType.DataType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

COLUMN = 0

immuneML.analysis.criteria_matches.OperationType module

class immuneML.analysis.criteria_matches.OperationType.OperationType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

GREATER_THAN = 3
IN = 0
LESS_THAN = 4
NOT_IN = 1
NOT_NA = 2
RANDOM_N = 6
TOP_N = 5

Module contents