Construct a GenotypeHandle from one of several input
forms. Exactly one of the following must be specified:
pathA single file path with a recognized extension:
.vcf,.vcf.gz,.vcf.bgz,.bcf, or.gds. Format is auto-detected from the extension.plink1PrefixA path prefix; the constructor appends
.bed,.bim, and.famto locate the triplet.plink2PrefixA path prefix; the constructor appends
.pgen,.pvar(or.pvar.zst), and.psamto locate the triplet.bed+bim+famExplicit PLINK1 triplet. The three files must share a stem; if they don't, use
plink1Prefixor arrange symlinks at a common stem.pgen+pvar+psamExplicit PLINK2 triplet. Same shared-stem requirement.
genoMetaOne genotype file per chromosome. Either a path to a whitespace/TSV meta file whose first column is the chromosome (
#chr) and second column the per-chromosome payload (a.bed/.pgen/.vcf[.gz]/.bcf/.gdsfile or a PLINK prefix; relative paths resolve against the meta file's directory), or a named character vector mapping chromosome to payload. All shards must share one format and identical sample IDs in the same order. Extraction is routed to the correct file by the requested region's chromosome.
The constructor opens the file for metadata only (sample IDs and SNP
info); dosage extraction is deferred until extractBlockGenotypes()
is called.
Usage
GenotypeHandle(
path = NULL,
plink1Prefix = NULL,
plink2Prefix = NULL,
bed = NULL,
bim = NULL,
fam = NULL,
pgen = NULL,
pvar = NULL,
psam = NULL,
ldMeta = NULL,
region = NULL,
genoMeta = NULL,
...
)Arguments
- path
Single file path (.vcf/.vcf.gz/.vcf.bgz/.bcf/.gds), or
NULL.- plink1Prefix
Path prefix for a PLINK1 triplet, or
NULL.- plink2Prefix
Path prefix for a PLINK2 triplet, or
NULL.- bed, bim, fam
Explicit paths to the PLINK1 triplet, or all
NULL.- pgen, pvar, psam
Explicit paths to the PLINK2 triplet, or all
NULL.- ldMeta
Path to an LD-meta TSV file (columns
chrom,start,end,path; thepathcolumn may be comma-separated asld_file,bim_file). Requiresregion. The constructor resolves the row coveringregion, then delegates to the appropriate file-based handler. When the resolved row points at PLINK1 / PLINK2 / VCF / GDS files, the corresponding reader is used;.cor.xz(pre-computed LD-matrix) rows are not supported here — useloadLdMatrixfor that case.- region
Region specification for
ldMetalookup:"chr:start-end"string or a one-row data.frame withchrom,start,end.- genoMeta
One-file-per-chromosome specification: a path to a
#chr,pathmeta file or a named character vector (names = chromosomes, values = payload paths/prefixes). Optionally passformatvia...to force a single backend for every shard.- ...
Additional arguments forwarded to the format-specific reader.