pgenlibr0.5.4 package

PLINK 2 Binary (.pgen) Reader

AlleleCodeBuf

Returns an empty two-row numeric matrix that ReadAlleles() can load to...

BoolBuf

Returns a bool buffer that ReadAlleles() can load phasing information ...

Buf

Returns a numeric buffer that Read() or ReadHardcalls() can load to.

ClosePgen

Closes a pgen object, releasing resources.

ClosePvar

Closes a pvar object, releasing memory.

GetAlleleCode

Look up an allele code.

GetAlleleCt

Returns the effective number of alleles for a variant. Note that if no...

GetMaxAlleleCt

Returns the maximum GetAlleleCt() value across all variants in the fil...

GetRawSampleCt

Returns the number of samples in the file.

GetVariantChrom

Retrieve chromosome ID for given variant index.

GetVariantCt

Returns the number of variants in the file.

GetVariantId

Convert variant index to variant ID string.

GetVariantPos

Retrieve POS (base-pair coordinate on a chromosome) for given variant ...

GetVariantsById

Convert variant ID string to variant index(es).

HardcallPhasePresent

Returns whether explicitly phased hardcalls are present.

HasSparse

Returns whether dosages for the variant_numth variant and given allele...

HasSparseHardcalls

Returns whether hardcalls for the variant_numth variant and given alle...

IntAlleleCodeBuf

Returns an empty two-row integer matrix that ReadAlleles() can load to...

IntBuf

Returns an integer buffer that ReadHardcalls() can load to.

NewPgen

Opens a .pgen or PLINK 1 .bed file.

NewPvar

Loads variant positions, IDs, and allele codes from a .pvar or .bim fi...

pgenlibr-package

PLINK 2 Binary (.pgen) Reader

Read

Loads the variant_numth variant, and then fills buf with numeric dosag...

ReadAlleles

Loads the variant_numth variant, and then fills acbuf with integer all...

ReadHardcalls

Loads the variant_numth variant, and then fills buf with {0, 1, 2, NA}...

ReadIntList

Load hardcalls for multiple variants as an integer matrix.

ReadList

Load dosages for multiple variants as a numeric matrix.

ReadSparse

If HasSparse() is true, returns a sparse representation for the (varia...

ReadSparseHardcalls

If HasSparseHardcalls() is true, returns a sparse representation for t...

VariantScores

Compute variant scores.

A thin wrapper over PLINK 2's core libraries which provides an R interface for reading .pgen files. A minimal .pvar loader is also included. Chang et al. (2015) \doi{10.1186/s13742-015-0047-8}.

  • Maintainer: Christopher Chang
  • License: LGPL (>= 3)
  • Last published: 2026-01-17