immuneML.dsl package

Subpackages

Submodules

immuneML.dsl.DefaultParamsLoader module

class immuneML.dsl.DefaultParamsLoader.DefaultParamsLoader[source]

Bases: object

static convert_to_snake_case(name)[source]
static load(path, class_name, log_if_missing=True)[source]

immuneML.dsl.ImmuneMLParser module

class immuneML.dsl.ImmuneMLParser.ImmuneMLParser[source]

Bases: object

Simple DSL parser from python dictionary or equivalent YAML for configuring repertoire / receptor_sequence classification in the (simulated) settings

DSL example with hyper-parameter optimization:

definitions:
    datasets:
        d1:
            format: MiXCR
            params:
                result_path: loaded_dataset/
                region_type: IMGT_CDR3
                path: path_to_files/
                metadata_file: metadata.csv
    encodings:
        e1:
            KmerFrequency
                k: 3
        e2:
            Word2Vec:
                vector_size: 16
                context: sequence
    ml_methods:
        log_reg1:
            LogisticRegression:
                C: 0.001
    reports:
        r1:
            SequenceLengthDistribution
    preprocessing_sequences:
        seq1:
            - filter_chain_B:
                ChainRepertoireFilter:
                    keep_chain: A
            - filter_clonotype:
                ClonesPerRepertoireFilter:
                    lower_limit: 1000
        seq2:
            - filter_clonotype:
                ClonesPerRepertoireFilter:
                    lower_limit: 500
            - filter_chain_A:
                ChainRepertoireFilter:
                    keep_chain: B
instructions:
    inst1:
        type: TrainMLModel
        settings:
            -   preprocessing: seq1
                encoding: e1
                ml_method: log_reg1
            -   preprocessing: seq2
                encoding: e2
                ml_method: log_reg1
        assessment:
            split_strategy: random
            split_count: 1
            training_percentage: 70
            reports:
                data: []
                data_splits: []
                encoding: []
                models: []
        selection:
            split_strategy: k-fold
            split_count: 5
            reports:
                data: []
                data_splits: [r1]
                encoding: []
                models: []
        labels:
            - CD
        dataset: d1
        strategy: GridSearch
        metrics: [accuracy, f1_micro]
        optimization_metric: balanced_accuracy
        reports: []
output: # this section can also be omitted, in that case output will be automatically HTML
    format: HTML # or None
static check_keys(specs: dict)[source]
static parse(workflow_specification: dict, file_path, result_path)[source]
static parse_yaml_file(file_path: Path, result_path: Path = None, parse_func=None)[source]

immuneML.dsl.InstructionParser module

class immuneML.dsl.InstructionParser.InstructionParser[source]

Bases: object

static generate_docs(path: Path)[source]
keyword = 'instructions'
static make_docs(instruction, name, path: Path)[source]
static make_trainmlmodel_docs(path)[source]
static parse(definition_output: DefinitionParserOutput, path)[source]
static parse_instruction(*args, **kwargs)

immuneML.dsl.ObjectParser module

class immuneML.dsl.ObjectParser.ObjectParser[source]

Bases: object

static get_all_params(specs, class_path, short_class_name, key: str = None)[source]
static get_class(specs, valid_class_names, class_name_ending, class_path, location, key)[source]
static get_class_name(specs, valid_class_names, class_name_ending, location, key)[source]
static get_params(specs, class_name)[source]
static parse_object(specs, valid_class_names: list, class_name_ending: str, class_path: str, location: str, key: str, builder: bool = False, return_params_dict: bool = False)[source]

immuneML.dsl.OutputParser module

class immuneML.dsl.OutputParser.OutputParser[source]

Bases: object

static generate_docs(path: Path)[source]
static parse(specs: dict, symbol_table: SymbolTable) dict[source]

immuneML.dsl.Parser module

class immuneML.dsl.Parser.Parser[source]

Bases: object

abstract parse(workflow_specification: dict)[source]

Module contents