alleleTools.format.allele_resolution module
Allele Resolution Normalization CLI Wrapper
This module provides a command-line interface for normalizing allele resolutions. All alleles in the input file will be normalized to the specified resolution. Resolutions are given in fields (e.g., ‘one’, ‘two’, ‘three’).
Example
- input_file:
HLA-A*01:01:01:01 HLA-B*01:01:01:01 HLA-A*02:01:01:02 HLA-B*01:01:01:02
- command:
altools allele_resolution two input_file output_file
- output_file:
HLA-A*01:01 HLA-B*01:01 HLA-A*02:01 HLA-B*01:01
Author: Nicolás Mendoza Mejía (2025)
- class alleleTools.format.allele_resolution.AlleleParsedTable(alleles: ~pandas.core.frame.DataFrame = Empty DataFrame Columns: [] Index: [], phenotype: ~pandas.core.series.Series = Series([], dtype: object), covariates: ~pandas.core.frame.DataFrame = Empty DataFrame Columns: [] Index: [])[source]
Bases:
AlleleTable- convert_to_altable() AlleleTable[source]
- normalize_resolution(resolution: int) AlleleParsedTable[source]
- classmethod open(filename: str, sep: str = '\t') AlleleParsedTable[source]
Load allele data from a CSV file into the AlleleTable.
- Parameters:
filename (str) – The path to the input CSV file.
- parse_alleles(allele_parser) AlleleParsedTable[source]
- to_csv(filename: str, header: bool = True, population: str = '')[source]
Export the allele table to a CSV file.
- Parameters:
filename (str) – The name of the output CSV file.
header (bool) – Flag to store the file with column names or not
population (str) – Adds an extra column in the position left to phenotype with a population name. Currently, only one population per allele table is supported.