Statistical Genetics Data Objects and Loaders

Loads and manages statistical genetics data objects including reference panels, genotypes, LD matrices, annotations, and summary statistics. Follows the 'statgen' specification for use across 'Python', 'R', and 'MATLAB'/'Octave' runtimes.


statgen R Package

Statistical genetics data objects and loaders for R. This package is part of the larger statgen repository, which also includes Python and MATLAB/Octave implementations.

Installation

From GitHub (development)

# Install devtools if needed
if (!require("devtools")) install.packages("devtools")

# Install from the R-package directory
devtools::install()

# Or from the repository root
devtools::install("R-package")

From CRAN (release)

install.packages("statgen")

Documentation

Allele Alignment

Loaders default to matching genomic position and alleles, accepting reversed SNVs automatically and indel swaps by opt-in. To match marker IDs and alleles:

trait <- load_sumstats(path, reference, match_by = "id")
genotype <- load_genotype(bfile_prefix, reference, match_by = "id")

ID mode matches SNVs other than A/T and C/G by case-sensitive marker ID, including strand complements. Both modes orient values to reference a1. See ?allele_matching and vignette("statgen") for details and examples.

Annotation Loading

load_annotations() loads one or more 3-column BED files as binary annotation columns. load_annotation() loads one BED-like source file and can paint selected numeric value columns as continuous annotations or expand one group_column into multiple binary annotations. Both return an AnnotationPanel whose annomat() accessor is a sparse numeric Matrix::dgCMatrix; is_binary() and annotation_metadata() expose per-column metadata.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("statgen")

0.4.3 by Andrew Morris, 4 days ago


https://github.com/precimed/statgen


Report a bug at https://github.com/precimed/statgen/issues


Browse source code at https://github.com/cran/statgen


Authors: Oleksandr Frei [aut, cph] , Andrew Morris [cre, ctb]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports Matrix, jsonlite, digest, bit64, methods, data.table

Suggests R.utils, testthat, knitr, rmarkdown


See at CRAN