stcrpy.tcr_processing.utils package
Submodules
stcrpy.tcr_processing.utils.common module
- stcrpy.tcr_processing.utils.common.fastcross(v, w)[source]
Cross-vector of two Vector objects which is faster than NumPy’s version
- stcrpy.tcr_processing.utils.common.identity(seq1, seq2, positions=[])[source]
Find the matched sequence identity between two aligned sequences. Can accept lists/strings, but this assumes that the two sequences are of the same length. :param seq1: Dictionary with key as the position and value as the single letter amino acid code. or an aligned list or string :param seq2: Dictionary with key as the position and value as the single letter amino acid code. or an aligned list or string
stcrpy.tcr_processing.utils.constants module
constants.py @author: leem @date: 9 May 2017
Constant values that are useful. Based off of rotlib.constants.
- stcrpy.tcr_processing.utils.constants.tuplefy(x)[source]
Interpretation for converting numbering (in string) into a tuple. :param x: A string for the identifier of a numbered position. e.g “H100A”.
- Returns:
A tuple of the chain tupe followed by a tuple of residue id and insertion code. eg. ( H, (100, “A”) )
stcrpy.tcr_processing.utils.region_definitions module
A module to deal with region annotations for IMGT scheme.
- class stcrpy.tcr_processing.utils.region_definitions.Accept(NOT=False)[source]
Bases:
objectA class to select which positions should be compared.
- stcrpy.tcr_processing.utils.region_definitions.annotate_regions(numbered_sequence, chain)[source]
Given a numbered sequence (list) annotate which region each residue belongs to. Currently, only the IMGT numbering and definition are implemented. If possible, use the corresponding numbering scheme and definition.
This function automates the heuristics recognise different definitions in each scheme. However, some of the conversions are non-trivial.
- stcrpy.tcr_processing.utils.region_definitions.get_region(position, chain)[source]
Get the region in which the position belongs given the chain, numbering scheme and definition.
Note this function does not know about insertions on the sequence. Therefore, it will get the region annotation wrong when using non-equivalent scheme-definitions.
To get around this please use the annotate_regions function which implements heuristics to get the definition correct in the scheme.