tidytcells.tcr
Functions to clean and standardise TCR gene data.
Functions
- tidytcells.tcr.query(species: str = 'homosapiens', precision: str = 'allele', functionality: str = 'any', contains: str | None = None) FrozenSet[str][source]
Query the list of all known TCR 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 (
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 toNone.
- Returns:
The set of all genes/alleles that satisfy the given constraints.
- Return type:
FrozenSet[str]
- tidytcells.tcr.standardise(gene: str | None = None, species: str = 'homosapiens', enforce_functional: bool = False, precision: str = 'allele', suppress_warnings: bool = False, gene_name: str | None = None) str[source]
Attempt to standardise a TCR gene name to be IMGT-compliant.
- Parameters:
gene (
str) – Potentially non-standardised TCR gene name.species (
str) – Species to which the TCR gene belongs (see above for supported species). Defaults to'homosapiens'.enforce_functional (
bool) – IfTrue, disallows TCR genes that are recognised by IMGT but are marked as non-functional (ORF or pseudogene). Defaults toFalse.precision (
str) – The maximum level of precision to standardise to.'allele'standardises to the maximum precision possible.'gene'standardises only to the level of the gene. Defaults to'allele'.suppress_warnings (
bool) – Disable warnings that are usually emitted when standardisation fails. Defaults toFalse.gene_name (
str) – Alias for the parametergene.
- Returns:
If the specified
speciesis supported, andgenecould be standardised, then return the standardised gene name. Ifspeciesis unsupported, then the function does not attempt to standardise , and returns the unalteredgenestring. Else returnsNone.- Return type:
strorNone
- tidytcells.tcr.standardize(*args, **kwargs)[source]
Alias for
tidytcells.tcr.standardise().