| Title: | Format Conversion from PLINK2 PGEN to GDS |
|---|---|
| Description: | Provides functions for the format conversion from PLINK2 pgen files to SeqArray GDS files. |
| Authors: | Xiuwen Zheng [aut, cre] (ORCID: <https://orcid.org/0000-0002-1390-0708>) |
| Maintainer: | Xiuwen Zheng <[email protected]> |
| License: | GPL-3 |
| Version: | 0.99.2 |
| Built: | 2026-06-06 10:06:47 UTC |
| Source: | https://github.com/BiocStaging/pgen2gds |
Reformats PLINK2 pgen files to GDS format.
seqPGEN2GDS(pgen.fn, pvar.fn=NULL, psam.fn=NULL, out.gdsfn, compress.geno="LZMA_RA", compress.annot="LZMA_RA", variant.sel=NULL, sample.sel=NULL, start=1L, count=NA_integer_, ignore.chr.prefix=c("chr", "0"), reference=NULL, optimize=TRUE, digest=TRUE, parallel=FALSE, balancing=TRUE, verbose=TRUE)seqPGEN2GDS(pgen.fn, pvar.fn=NULL, psam.fn=NULL, out.gdsfn, compress.geno="LZMA_RA", compress.annot="LZMA_RA", variant.sel=NULL, sample.sel=NULL, start=1L, count=NA_integer_, ignore.chr.prefix=c("chr", "0"), reference=NULL, optimize=TRUE, digest=TRUE, parallel=FALSE, balancing=TRUE, verbose=TRUE)
pgen.fn |
a file name for the pgen file |
pvar.fn |
a file name for the pvar file, or |
psam.fn |
a file name for the psam file, or |
out.gdsfn |
the file name of output GDS file |
compress.geno |
the compression method for "genotype"; optional
values are defined in the function |
compress.annot |
the compression method for the GDS variables,
except "genotype"; optional values are defined in the function
|
variant.sel |
|
sample.sel |
|
start |
the starting variant if importing part of the pgen file |
count |
the maximum count of variant if importing part of the pgen
file, |
ignore.chr.prefix |
a vector of character, indicating the prefix of
chromosome which should be ignored, e.g., |
reference |
genome reference, like "GRCh37", "GRCh38"; it is not
specified if |
optimize |
if |
digest |
a logical value (TRUE/FALSE) or a character (e.g., "md5"); add hash codes to the GDS file if TRUE or a digest algorithm is specified |
parallel |
|
balancing |
whether to perform workload balancing or not, only
applicable when multiple cores are used; if |
verbose |
if |
Return the file name of SeqArray GDS file with an absolute path.
Xiuwen Zheng
https://www.cog-genomics.org/plink/2.0/
pgen_fn <- system.file("extdata", "plink2_gen.pgen", package="pgen2gds") seqPGEN2GDS(pgen_fn, out.gdsfn="test.gds") # delete the temporary file unlink("test.gds", force=TRUE)pgen_fn <- system.file("extdata", "plink2_gen.pgen", package="pgen2gds") seqPGEN2GDS(pgen_fn, out.gdsfn="test.gds") # delete the temporary file unlink("test.gds", force=TRUE)
Read PLINK2 pvar file for variants
seqReadPVAR(pvar, sel=NULL)seqReadPVAR(pvar, sel=NULL)
pvar |
a file name of a pvar file (from NewPvar), or a pvar object, which can be queried for variant IDs and allele codes |
sel |
|
Return a data frame with the columns chrom, pos,
allele and rsid.
Xiuwen Zheng
https://www.cog-genomics.org/plink/2.0/
pvar_fn <- system.file("extdata", "plink2_gen.pvar", package="pgen2gds") head(seqReadPVAR(pvar_fn))pvar_fn <- system.file("extdata", "plink2_gen.pvar", package="pgen2gds") head(seqReadPVAR(pvar_fn))