| 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.1 |
| Built: | 2026-11-16 07:30:44 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
browse and launch the learnr tutorials bundled with PlinkMatrix
PlinkMatrix_tutorials(name)PlinkMatrix_tutorials(name)
name |
character(1) name of a tutorial to launch directly (the
tutorial's directory name under |
Lists the learnr tutorials shipped with this package –
covering matrix foundations, the Singular Value Decomposition, Principal
Components Analysis, and ancestry discrimination using the package's
example genotype data. With name supplied, that tutorial is
launched directly. With name missing in an interactive session, a
menu is shown with a checkbox beside each tutorial already marked done;
the menu keeps returning after each tutorial finishes (offering to mark
it done) until you choose 0 to quit. Progress is kept in a small file in
your own R user data directory (see R_user_dir), so
it survives restarting R; it is self-reported and is not sent anywhere.
Each tutorial has its own "Exit tutorial" button that cleanly stops the
tutorial's web server and returns control to the R console, so there is
no need to interrupt with Ctrl-C. Requires the learnr package.
invisible(NULL) if name is supplied; otherwise, invisibly,
a named logical vector recording which tutorials are marked done. As a
side effect, launches one or more learnr tutorials, typically in
the default web browser, via learnr::run_tutorial.
if (interactive()) PlinkMatrix_tutorials()if (interactive()) PlinkMatrix_tutorials()
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