tidytcells.tr#
Functions to manage TR gene data.
Functions
- tidytcells.tr.query(species=None, precision=None, functionality=None, contains_pattern=None)[source]#
Query the list of all known TR genes / alleles.
- Parameters:
species (str) – Species to query (see above for supported species). Defaults to
"homosapiens".precision (str) – The level of precision to query.
allelewill query from the set of all possible alleles.genewill query from the set of all possible genes. Defaults toallele.functionality (str) – Gene/allele functionality to subset by.
"any"queries from all possible genes/alleles."F"queries from functional genes/alleles."NF"queries from psuedogenes and ORFs."P"queries from pseudogenes."ORF"queries from ORFs. An allele is considered queriable if its functionality label matches the description. A gene is considered queriable if at least one of its alleles’ functionality label matches the description. Defaults to"any".contains_pattern (str) – An optional regular expression string which will be used to filter the query result. If supplied, only genes/alleles which contain the regular expression will be returned. Defaults to
None.
- Returns:
The set of all genes / alleles that satisfy the given constraints.
- Return type:
FrozenSet[str]
- tidytcells.tr.standardise(*args, **kwargs)[source]#
Alias for
tidytcells.tr.standardize().- Return type:
- tidytcells.tr.standardize(symbol=None, species=None, enforce_functional=None, allow_subgroup=None, log_failures=None, gene=None, suppress_warnings=None)[source]#
Attempt to standardize a TR gene / allele symbol to be IMGT-compliant.
- Parameters:
symbol (str) – Potentially non-standardized TR gene / allele symbol.
species (str) –
Can be specified to standardize to a TR symbol that is known to be valid for that species (see above for supported species). If set to
"any", then first attempts standardization for Homo sapiens, then Mus musculus. Defaults to"homosapiens".Note
From version 3, the default behaviour will change to
"any".enforce_functional (bool) – If
True, disallows TR genes / alleles that are recognised by IMGT but are marked as non-functional (ORF or pseudogene). Defaults toFalse.allow_subgroup (bool) – If
True, allows valid subgroups (as well as more specific gene/allele symbos) to pass standardization. IfFalse, the supplied symbol must point to at least a specific gene. Defaults toFalse.log_failures (bool) – Report standardization failures through logging (at level
WARNING). Defaults toTrue.gene (str) – Alias for the parameter symbol.
suppress_warnings (bool) – Disable warnings that are usually logged when standardization fails. Deprecated in favour of log_failures.
- Returns:
A standardized receptor gene wrapped in a
ReceptorGeneobject. For details on how to use this output, please refer to the class documentation.- Return type: