alleleTools.tests.test_allele module

class alleleTools.tests.test_allele.TestAlleleParser[source]

Bases: object

test_default_parser()[source]
test_delimited_parsing()[source]
test_hla_hisat_parsing()[source]
test_hla_parsing()[source]
test_wrong_parser()[source]
class alleleTools.tests.test_allele.TestFieldTree[source]

Bases: object

parse_alleles(alleles: list) list[source]
test_1allele_1field()[source]
test_1allele_2fields()[source]
test_1allele_3fields()[source]
test_1allele_4fields()[source]
test_allele_counting_fist_level()[source]
test_allele_counting_second_level()[source]
test_allele_counting_second_level_minor_allele()[source]
test_allele_support_homozygous()[source]
test_one_allele()[source]
class alleleTools.tests.test_allele.TestHlaAllele[source]

Bases: object

parser = <alleleTools.allele.AlleleParser object>
test_allele_parsing()[source]
test_comparison_results()[source]
class alleleTools.tests.test_allele.TestKirAllele[source]

Bases: object

test_allele_parsing(allele_str)[source]
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:

FieldTree

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)]]