immuneML.analysis package

Subpackages

Submodules

immuneML.analysis.AxisType module

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

Bases: Enum

FEATURES = 1
REPERTOIRES = 0

immuneML.analysis.SequenceMatcher module

class immuneML.analysis.SequenceMatcher.SequenceMatcher[source]

Bases: object

Matches the sequences across the given list of reference sequences (a list of ReceptorSequence objects) and returns the following information: {

“repertoires”:[{
“sequences”: [{

“sequence”: “AAA”, “matching_sequences”: [“AAA”, “AAC”], “v_gene”: “V12”, “j_gene”: “J3”, “chain”: “A”

}], # list of sequences for the repertoire with matched sequences for each original sequence “repertoire”: “fdjshfk321231”, # repertoire identifier “repertoire_index”: 2, # the index of the repertoire in the dataset, “sequences_matched”: 4, # number of sequences from the repertoire which are a match for at least one reference sequence “percentage_of_sequences_matched”: 0.75, # percentage of sequences from the repertoire that have at least one match in the reference sequences “metadata”: {“CD”: True}, # dict with parameters that can be used for analysis on repertoire level and that serve as a starting point for label configurations “chains”: [“A”,”B”] # list of chains in the repertoire

}, …]

}

CORES = 4
match(dataset: RepertoireDataset, reference_sequences: list, max_distance: int, summary_type: SequenceMatchingSummaryType) dict[source]
match_repertoire(repertoire: Repertoire, index: int, reference_sequences: list, max_distance: int, summary_type: SequenceMatchingSummaryType) dict[source]
match_sequence(sequence: ReceptorSequence, reference_sequences: list, max_distance: int) dict[source]
matches_gene(gene1, gene2)[source]
matches_sequence(original_sequence: ReceptorSequence, reference_sequence: ReceptorSequence, max_distance)[source]
Parameters:
  • original_sequence – ReceptorSequence

  • reference_sequence – ReceptorSequence

  • max_distance – max allowed Levenshtein distance between two sequences to be considered a match

Returns:

True if chain, v_gene and j_gene are the same and sequences are within given Levenshtein distance

Module contents