Package 'PlinkMatrix'

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

Help Index


Method: dim for delayed plink

Description

Method: dim for delayed plink

Usage

## S4 method for signature 'PlinkSeed'
dim(x)

Arguments

x

PlinkSeed instance

Value

2-vector

Examples

methods(class="PlinkSeed")

Method: dimnames for delayed plink

Description

Method: dimnames for delayed plink

Usage

## S4 method for signature 'PlinkSeed'
dimnames(x)

Arguments

x

PlinkSeed instance

Value

list of dimnames


sample GRanges coordinated with example_PlinkMatrix

Description

sample GRanges coordinated with example_PlinkMatrix

Usage

data("example_GRanges", package="PlinkMatrix")

Format

GRanges

Examples

data("example_GRanges", package="PlinkMatrix")
head(example_GRanges)

produce PlinkMatrix from example data

Description

produce PlinkMatrix from example data

Usage

example_PlinkMatrix(folder = tempdir(), as_RSE = FALSE)

Arguments

folder

a path where unzipped example data will be managed

as_RSE

logical(1) if TRUE (default is FALSE) a RangedSummarizedExperiment is returned

Value

a SummarizedExperiment or RangedSummarizedExperiment with rowRanges calculated from SNP ids

Examples

example_PlinkMatrix()

sample characteristics of 445 GEUVADIS samples

Description

sample characteristics of 445 GEUVADIS samples

Usage

data("g445samples", package="PlinkMatrix")

Format

data.frame

Note

Example data are those provided with tensorqtl, see https://github.com/broadinstitute/tensorqtl/tree/0c4db65a0cdc47f3b824ae530b89d270ef5e0096/example/data.

Examples

data("g445samples", package="PlinkMatrix")
g445samples[seq_len(4), seq_len(4)]

Get sample metadata

Description

Get sample metadata

Usage

getSampleData(x)

Arguments

x

DelayedArray instance

Value

data.frame

Examples

tst <- example_PlinkMatrix()
head(getSampleData(tst))

Get variant metadata

Description

Get variant metadata

Usage

getVariantData(x)

Arguments

x

DelayedArray instance

Value

data.frame

Examples

tst <- example_PlinkMatrix()
dim(getVariantData(tst))

produce GRanges from variant notation for plink example from geuvadis

Description

produce GRanges from variant notation for plink example from geuvadis

Usage

plid2gr(x, sepused = "_")

Arguments

x

character vector of variant names

sepused

single character, defaults to "_"

Value

GRanges instance

Examples

plid2gr("chr18_80259028_AG_A_b38")

Constructor for DelayedArray

Description

Constructor for DelayedArray

Usage

PlinkMatrix(filepath)

Arguments

filepath

path to plink bed, bim, fam resources without suffixes

Value

An instance of PlinkMatrix

Examples

PlinkMatrix

browse and launch the learnr tutorials bundled with PlinkMatrix

Description

browse and launch the learnr tutorials bundled with PlinkMatrix

Usage

PlinkMatrix_tutorials(name)

Arguments

name

character(1) name of a tutorial to launch directly (the tutorial's directory name under inst/tutorials, as reported by learnr::available_tutorials(package = "PlinkMatrix")). If missing, a menu is presented in interactive sessions; in non-interactive sessions the available tutorial names are printed and an error is raised.

Details

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.

Value

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.

Examples

if (interactive()) PlinkMatrix_tutorials()

Delayed interface to Plink genotype files

Description

This package includes C++ code to interface to Plink files. Large-scale genotype calls can be managed in a RangedSummarized Experiment instance.

Value

side effects


read subset for use in delayed matrix approach

Description

read subset for use in delayed matrix approach

Usage

read_bed_subset(prefix, snp_indices, sample_indices, n_total_samples = NULL)

Arguments

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

Value

matrix

Examples

read_bed_subset

present seed concisely

Description

present seed concisely

Usage

## S4 method for signature 'PlinkSeed'
show(object)

Arguments

object

instance of PlinkSeed

Value

side effect of cat

Examples

ex <- example_PlinkMatrix()
ex