alleleTools.tests.test_allele module
- class alleleTools.tests.test_allele.TestHlaAllele[source]
Bases:
object- parser = <alleleTools.allele.AlleleParser object>
- alleleTools.tests.test_allele.build_allele_tree(gene: str, alleles: List[Allele]) FieldTree[source]
Build a FieldTree representing the structure of allele fields for a given gene.
- Parameters:
gene (str) – The gene name to use as the root of the tree.
alleles (List[Allele]) – List of Allele objects to add to the tree.
- Returns:
The root of the constructed field tree.
- Return type:
Example
>>> build_allele_tree('A', [Allele('A*01:01'), Allele('A*01:02')]) Field(A:0)[Field(01:2)[Field(01:1), Field(02:1)]]