| Title: | DelayedArray interface for plink bed files |
|---|---|
| Description: | This package provides a DelayedArray interface for plink bed files. There is support for interfacing to plink genotype data via RangedSummarizedExperiment. Example data from the GEUVADIS project (internationalgenome.org) are used for demonstration. |
| Authors: | Vince Carey [aut, cre] (ORCID: <https://orcid.org/0000-0003-4046-0063>), NHGRI U24HG004059 [fnd] |
| Maintainer: | Vince Carey <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.1.0 |
| Built: | 2026-05-30 09:35:27 UTC |
| Source: | https://github.com/bioc/PlinkMatrix |
Method: dim for delayed plink
## S4 method for signature 'PlinkSeed' dim(x)## S4 method for signature 'PlinkSeed' dim(x)
x |
PlinkSeed instance |
2-vector
methods(class="PlinkSeed")methods(class="PlinkSeed")
Method: dimnames for delayed plink
## S4 method for signature 'PlinkSeed' dimnames(x)## S4 method for signature 'PlinkSeed' dimnames(x)
x |
PlinkSeed instance |
list of dimnames
sample GRanges coordinated with example_PlinkMatrix
data("example_GRanges", package="PlinkMatrix")data("example_GRanges", package="PlinkMatrix")
GRanges
data("example_GRanges", package="PlinkMatrix") head(example_GRanges)data("example_GRanges", package="PlinkMatrix") head(example_GRanges)
produce PlinkMatrix from example data
example_PlinkMatrix(folder = tempdir(), as_RSE = FALSE)example_PlinkMatrix(folder = tempdir(), as_RSE = FALSE)
folder |
a path where unzipped example data will be managed |
as_RSE |
logical(1) if TRUE (default is FALSE) a RangedSummarizedExperiment is returned |
a SummarizedExperiment or RangedSummarizedExperiment with rowRanges calculated from SNP ids
example_PlinkMatrix()example_PlinkMatrix()
sample characteristics of 445 GEUVADIS samples
data("g445samples", package="PlinkMatrix")data("g445samples", package="PlinkMatrix")
data.frame
Example data are those provided with tensorqtl, see https://github.com/broadinstitute/tensorqtl/tree/0c4db65a0cdc47f3b824ae530b89d270ef5e0096/example/data.
data("g445samples", package="PlinkMatrix") g445samples[seq_len(4), seq_len(4)]data("g445samples", package="PlinkMatrix") g445samples[seq_len(4), seq_len(4)]
operate with BiocFileCache to retrieve zip file of plink example data
get_plink_example_path(ca = BiocFileCache::BiocFileCache())get_plink_example_path(ca = BiocFileCache::BiocFileCache())
ca |
BiocFileCache instance |
character string with path to example in cache
get_plink_example_path()get_plink_example_path()
Get sample metadata
getSampleData(x)getSampleData(x)
x |
DelayedArray instance |
data.frame
tst <- example_PlinkMatrix() head(getSampleData(tst))tst <- example_PlinkMatrix() head(getSampleData(tst))
Get variant metadata
getVariantData(x)getVariantData(x)
x |
DelayedArray instance |
data.frame
tst <- example_PlinkMatrix() dim(getVariantData(tst))tst <- example_PlinkMatrix() dim(getVariantData(tst))
produce GRanges from variant notation for plink example from geuvadis
plid2gr(x, sepused = "_")plid2gr(x, sepused = "_")
x |
character vector of variant names |
sepused |
single character, defaults to "_" |
GRanges instance
plid2gr("chr18_80259028_AG_A_b38")plid2gr("chr18_80259028_AG_A_b38")
Constructor for DelayedArray
PlinkMatrix(filepath)PlinkMatrix(filepath)
filepath |
path to plink bed, bim, fam resources without suffixes |
An instance of PlinkMatrix
PlinkMatrixPlinkMatrix
This package includes C++ code to interface to Plink files. Large-scale genotype calls can be managed in a RangedSummarized Experiment instance.
side effects
read subset for use in delayed matrix approach
read_bed_subset(prefix, snp_indices, sample_indices, n_total_samples = NULL)read_bed_subset(prefix, snp_indices, sample_indices, n_total_samples = NULL)
prefix |
character path to bed resources and file prefix |
snp_indices |
integer vector of snp indices |
sample_indices |
integer vector of sample indices |
n_total_samples |
optional |
matrix
read_bed_subsetread_bed_subset
present seed concisely
## S4 method for signature 'PlinkSeed' show(object)## S4 method for signature 'PlinkSeed' show(object)
object |
instance of PlinkSeed |
side effect of cat
ex <- example_PlinkMatrix() exex <- example_PlinkMatrix() ex