py_hla_match.parser

class py_hla_match.parser.HLADataSource(source_path, col_idx_start=None, col_idx_stop=None, row_idx_start=1)[source]

Bases: object

Data source for HLA data. Parses HLA data from an excel or csv file.

Parameters:
  • source_path (str)

  • col_idx_start (int)

  • col_idx_stop (int)

  • row_idx_start (int)

parse(stream=False, chunk_size=10000)[source]

Parse HLA data from an excel or csv file.

Parameters:
  • stream (bool) – If True, return an iterable of individuals (default: False)

  • chunk_size (int) – Size of the chunks to read from the file (if streaming)

Returns:

List of Individuals or an iterable of Individuals

Raises:

ValueError – If the file format is not supported

Return type:

list[Individual] | Iterable[Individual]

Classes

HLADataSource(source_path[, col_idx_start, ...])

Data source for HLA data.