oxbow.read_bcf

Contents

oxbow.read_bcf#

oxbow.read_bcf(src, region=None, index=None, fields=None, info_fields=None, genotype_fields=None, samples=None, genotype_by=None, compressed=True)#

Return Arrow IPC format from a BCF file.

Parameters:
  • src (str or file-like) – The path to the BCF file or a file-like object.

  • region (str, optional) – Genomic region in the format “chr:start-end”.

  • index (path or file-like, optional) – The index file to use for querying the region.

  • fields (list[str], optional) – Names of the fixed fields to project.

  • info_fields (list[str], optional) – Names of the INFO fields to project.

  • genotype_fields (list[str], optional) – Names of the sample-specific genotype fields to project.

  • samples (list[str], optional) – Names of the samples to include in the genotype fields.

  • genotype_by (Literal["sample", "field"], optional [default: "sample"]) – How to project the genotype fields. If “sample”, the columns correspond to the samples. If “field”, the columns correspond to the genotype fields.

  • compressed (bool, optional [default: True]) – Whether the source is BGZF-compressed.

Returns:

Arrow IPC

Return type:

bytes