Skip to contents

Class definitions

S4 class definitions. The -class topic documents the slots and validity constraints; the matching constructor topic (next section) documents the user-facing factory function.

AnnotationMatrix-class
Genomic Annotation Matrix
FineMappingResultBase-class
Fine-Mapping Result Base Class
GenotypeHandle-class
Genotype File Handle
H2Estimate-class
Heritability Estimate
LdData-class
LD Data Container
LdEigen-class
Eigendecomposition-Based LD Statistic
LdScore-class
LD Score-Based LD Statistic
LdStatistic-class
LD Statistic (Virtual Base Class)
MashPrior-class
Data-Driven (mash) Prior Bundle
MultiStudyQtlDataset-class
Multi-Study QTL Dataset
SldscData-class
S-LDSC input data container
SumStatsBase-class
Summary Statistics Base Class

Class constructors

User-facing constructors. For classes that have both a -class topic and a constructor topic, prefer the constructor for day-to-day use; the -class topic is the authoritative slot reference.

AnnotationMatrix()
Create an AnnotationMatrix Object
CtwasResult()
Create a CtwasResult Collection
CtwasResultEntry()
Create a CtwasResultEntry
FineMappingEntry()
Create a FineMappingEntry Object
GenotypeHandle()
Create a GenotypeHandle Object
GwasFineMappingResult()
TWAS Weights Collection
GwasSumStats()
Create a GwasSumStats Collection Object
LdData()
Create an LdData Object
MashPrior()
Create a MashPrior Object
MultiStudyQtlDataset()
Create a MultiStudyQtlDataset Object
QtlDataset()
Fine-Mapping Entry (per-tuple payload)
QtlFineMappingResult()
GWAS Fine-Mapping Result Collection
QtlSumStats()
Create a QtlSumStats Collection Object
qtlSumStatsFromBetaMatrix()
Build a QtlSumStats from Bhat / Shat (effect-size) Matrices
qtlSumStatsFromZMatrix()
Build a QtlSumStats from a Z-score matrix
SldscData() show(<SldscData>)
Construct an SldscData object
TwasWeights()
QTL Dataset (individual-level data for one study)
TwasWeightsEntry()
QTL Summary Statistics Collection

Manifest loaders

Build the individual-level and summary-statistic containers from a manifest (a data.frame or a delimited file) that points at the phenotype / genotype / summary-statistic sources.

loadQtlDatasetFromManifest()
Load a QtlDataset from a manifest
loadMultiStudyQtlDatasetFromManifest()
Load a MultiStudyQtlDataset from manifests
loadQtlSumStatsFromManifest()
Load a QtlSumStats collection from a manifest
loadGwasSumStatsFromManifest()
Load a GwasSumStats collection from a manifest

Class methods

Accessor and behaviour methods grouped by the class they’re defined on. Generics with implementations on multiple classes appear under each. S4 pipeline dispatch methods (fineMappingPipeline, colocboostPipeline, twasWeightsPipeline) are listed under “Pipelines” further down rather than repeated per class.

AnnotationMatrix

getAnnotationMeta()
Get Annotation Metadata
getAnnotations()
Get Annotation Matrix
getBaseline()
Get Baseline Annotations
getCandidates()
Get Candidate Annotations
getGenome()
Get the Genome Build
getSnpRanges()
Get SNP Ranges

FineMappingEntry

adjustPips()
Renormalize Fine-Mapping PIPs to a Variant Subset
fsusieAffectedRegions()
fSuSiE affected genomic regions
fsusieCredibleBand()
fSuSiE credible band (fitted effect + uncertainty band)
getCredibleSetSummary()
Per-credible-set summary of a fine-mapping result
getCs()
Get Credible Sets
getLbf()
Per-variant per-effect log Bayes factors (wide)
getMarginalEffects()
Get Marginal Effects
getPip()
Get PIP Values
getSusieFit()
Get SuSiE Fit
getTopLoci()
Get Top Loci (posterior view)
getVariantIds()
Get Variant IDs
resolveWeights()
Resolve Per-Variant Weights From a Weight Source

FineMappingResultBase

getLdSketch()
Get LD Sketch
getMethodNames()
Get Method Names
getRegion()
Get Per-Row Genomic Regions
getStudy()
Get Study Identifier
writeSumstatsVcf()
Write summary statistics or fine-mapping results to VCF/BCF

CtwasResult / CtwasResultEntry

getCtwasParam()
Get cTWAS Group Prior Parameters
getFinemap()
Get cTWAS Fine-mapping Posteriors
getSusieAlpha()
Get cTWAS Per-effect Susie Alpha Table

GenotypeHandle

getFormat()
Get Genotype Storage Format
getNSamples()
Get Sample Count
getPath()
Get File Path
getPgenPtr()
Get plink2 pgen Pointer
getSampleIds()
Get Sample Identifiers
getSnpInfo()
Get SNP Info
readGenotypes()
Read Genotype Data

GwasFineMappingResult

getContexts()
Get Context Names
getFineMappingResult()
Get a Single Fine-Mapping Entry
getTraits()
Get Unique Trait Names

GwasSumStats

getBeta()
Get Marginal Effect Sizes
getMaf()
Get Minor Allele Frequencies
getN()
Get Sample Sizes
getP()
Get Association P-values
getSE()
Get Effect-Size Standard Errors
getSumStats()
Get a Single Summary-Statistic Entry or Embedded Collection
getSumstatDf()
Get Standardized Sumstat Data Frame for One Tuple
getVarY()
Get Phenotype Variance
getZ()
Get Z-scores
nSnps()
Get Number of SNPs
subsetChr()
Subset by Chromosome

H2Estimate

getEnrichment()
Get Enrichment Estimates
getH2()
Get Global SNP Heritability
getLocal()
Get Local Estimates
getScoreStats()
Get Score Statistics
getTauBlocks()
Get Per-Block tau Matrix

LdBlocks

getBlocks()
Get LD Block Ranges

LdData

getBlockMetadata()
Get Block Metadata
getCorrelation()
Get LD Correlation Matrix
getGenotypeHandle()
Get GenotypeHandle from LdData
getGenotypes()
Get Genotype Matrix
getMixtureWeights()
Get Mixture Weights
getNRef()
Get LD Reference Panel Size
getRefPanel()
Get Reference Panel (data.frame)
getSnpIdx()
Get SNP Indices
getVariantInfo()
Get Variant GRanges
hasGenotypes()
Check Genotype Availability

LdEigen

getEigenList()
Get Per-Block Eigendecompositions

LdScore

getLdMatrixList()
Get Per-Block LD Matrix List
getLdScoreWeights()
Get LD-Score Regression Weights
getLdScores()
Get LD Scores

LdStatistic

getInSample()
Get In-Sample Flag
getLdBlocks()
Get LD Block Container

MultiStudyQtlDataset

getQtlDatasets()
Get the Embedded QtlDataset List

QtlDataset

getAf()
Get Effect-Allele Frequencies
getGenotypeCovariates()
Get Genotype Covariates
getGenotypes()
Get Genotype Matrix
getPhenotypeCovariates()
Get Per-Context Phenotype Covariates
getPhenotypes()
Get Phenotype List
getResidualizedGenotypes()
Get Residualized Genotypes
getResidualizedPhenotypes()
Get Residualized Phenotypes
getScaleResiduals()
Get scaleResiduals Flag
getTraitPosition()
Get Per-Row Trait Positions

QtlFineMappingResult

getFineMappingResult()
Get a Single Fine-Mapping Entry

QtlSumStats

getContexts()
Get Context Names
getSignificantQtls()
Extract Significant cis-QTL Variants
getTraits()
Get Unique Trait Names
qtlAssociationPostprocess()
Hierarchical Multiple-Testing Correction for cis-QTL Association

SumStatsBase

getQcInfo()
Get QC Audit Record
getQcDiagnostics()
Get SLALOM / DENTIST Diagnostics

SldscData

getAnnotData()
Get the annotation table from an SldscData
getFrqData()
Get the allele-frequency table from an SldscData
getTraitRuns()
Get the per-trait runs list from an SldscData
getTraitNames()
Get the trait names from an SldscData
getAnnotCols()
Get the annotation column names from an SldscData
getTraitRun()
Get one trait's run from an SldscData

MashPrior

getCvFits()
Get the Per-Fold Priors from a MashPrior
getFullFit()
Get the Full-Data Prior from a MashPrior

TwasWeights

getCvResult()
Get Cross-Validation Result
getDataType()
Get Data Type
getFits()
Get Model Fits
getStandardized()
Get Standardized Flag
getTwasWeights()
Get a Single TWAS Weights Entry
getWeights()
Get TWAS Weights

TwasWeightsEntry

getCvResult()
Get Cross-Validation Result
getDataType()
Get Data Type
getFits()
Get Model Fits
getStandardized()
Get Standardized Flag
getVariantIds()
Get Variant IDs
getWeights()
Get TWAS Weights

Pipelines

End-to-end pipeline entry points. Each takes one or more S4 input classes and returns a SumStats, FineMappingResult, TwasWeights collection, or a tabular summary.

causalInferencePipeline()
Causal Inference Pipeline (TWAS-Z + Mendelian Randomization)
colocboostPipeline()
ColocBoost multi-trait colocalization pipeline (S4)
colocPipeline()
Colocalization Pipeline (coloc.bf_bf over QTL + GWAS LBF matrices)
ctwasPipeline()
Causal TWAS Pipeline (cTWAS, multi LD block)
fineMappingPipeline()
Fine-Mapping Pipeline
mashPipeline()
Run mashr Across Multi-Context QTL or GWAS Summary Statistics
qtlEnrichmentPipeline()
QTL Enrichment Pipeline (Genome-Wide)
sldscPostprocessingPipeline()
sLDSC Postprocessing Pipeline
twasWeightsPipeline()
TWAS Weights Pipeline

cTWAS

The four chainable steps that ctwasPipeline is built from: assembleCtwasInputsestCtwasParamscreenCtwasRegionsfinemapCtwasRegions. Use the steps directly when you want to override the estimated priors (e.g. fall back to the prefit EM values after an accurate-EM divergence), inspect the assembled region data, or run only part of the pipeline.

assembleCtwasInputs()
Assemble cTWAS inputs from S4 GwasSumStats / TwasWeights
estCtwasParam()
Estimate cTWAS group prior + prior variance
screenCtwasRegions()
Screen cTWAS regions
finemapCtwasRegions()
Fine-map cTWAS regions
asCtwasResult()
Structure a granular cTWAS finemap result as a CtwasResult

Quality control

Summary-statistics QC orchestrator plus the underlying allele harmonization, LD-mismatch, kriging, SLALOM, DENTIST, RAISS, and relatedness checks.

summaryStatsQc()
Run QC on a SumStats Collection
effectiveN()
Effective sample size for a case/control study
alignVariantNames()
(Deprecated) Align variant names to a reference convention
ldMismatchQc()
Detect LD-Summary Statistic Mismatches
krigingOutlierQc()
Kriging-style LD-consistency outlier QC
slalom()
Slalom Function for Summary Statistics QC for Fine-Mapping Analysis
dentist()
Detect Outliers Using Dentist Algorithm
dentistSingleWindow()
Perform DENTIST on a single window
autoDecision()
Process Credible Set Information and Determine Updating Strategy
raiss()
Impute Summary Statistics Using LD (RAISS)
mergeVariantInfo()
Merge variant info from two sources with allele-flip-aware matching
mergeSusieCs()
Merge SuSiE credible sets across conditions
parseCsCorr()
Parse Credible Set Correlations from extractCsInfo() Output
filterRelatedness()
Filter related individuals from a study

LD infrastructure

Loading and manipulating LD matrices, plus design-matrix conditioning utilities.

loadLdMatrix()
Load and Process Linkage Disequilibrium (LD) Matrix
loadLdSketch()
Load LD sketch genotypes for a region
checkLd()
Check and optionally repair LD matrix quality
enforceDesignFullRank()
Iteratively enforce full column rank on a design matrix
ldClumpByScore()
LD clumping by a per-variant score using bigsnpr
ldLoader()
Create an LD loader for on-demand block-wise LD retrieval
ldPruneByCorrelation()
Prune columns by pairwise correlation (LD-style prune)
filterVariantsByLdReference()
Filter variants by LD Reference

Genotype I/O

Reading and manipulating per-region genotype data outside the GenotypeHandle accessor surface.

extractBlockGenotypes()
Extract Block Genotypes
computeBlockLdCor()
Compute Block LD Correlation
loadGenotypeRegion()
Load genotype data for a specific region
readAfreq()
Read a PLINK2 allele frequency file (.afreq or .afreq.zst)
getRefVariantInfo()
Get variant information from any LD reference source.
invertMinmaxScaling()
Invert min-max [0,2] scaling to recover the original U matrix.

Variant ID and region helpers

Parsing, formatting, and overlap checks for variant IDs (chr:pos:A2:A1) and genomic regions (chr:start-end).

parseVariantId()
Parse variant IDs into a data frame
normalizeVariantId()
Re-format variant IDs to a chosen output convention
classifyVariantType()
Classify variant type from allele strings
regionToDf()
Utility function to convert LD region_ids to `region of interest` dataframe
regionsOverlap()
Test whether two genomic regions overlap
findOverlappingRegions()
Find which target regions overlap a query region
asGranges()
Convert region specifications to a GRanges object

Fine-mapping

SuSiE-family fit wrappers (individual-level and summary-stat variants) plus the shared post-processing that produces the unified top_loci table. The VCF writer for fine-mapping results is documented under in the Class methods section above.

susieWeights()
Compute SuSiE TWAS weights
susieRssWeights()
Compute SuSiE-RSS TWAS weights
susieInfWeights()
Compute SuSiE-inf TWAS weights
susieInfRssWeights()
Compute SuSiE-inf-RSS TWAS weights
susieAshWeights()
Compute SuSiE-ASH TWAS weights
susieAshRssWeights()
Compute SuSiE-ASH-RSS TWAS weights
mvsusieWeights()
Compute mvSuSiE TWAS weights
mvsusieRssWeights()
Compute mvSuSiE-RSS TWAS weights from summary statistics
fsusieWeights()
Compute fSuSiE feature-level TWAS weights
fitMvsusie()
Fit mvSuSiE on individual-level (X, Y) data
fitMvsusieRss()
Fit mvSuSiE-RSS on summary-statistic (Z, R, N) data
fitFsusie()
Fit fSuSiE on individual-level (X, Y, pos) data
fitSusieInfThenSusieRss()
Two-stage SuSiE-RSS Fine-mapping
fsusieGetCs()
@title Create Sets Similar to SuSiE Output from fSuSiE Object
fsusieWrapper()
Wrapper for fsusie Function with Automatic Post-Processing
getSusieResult()
Extract the trimmed SuSiE fit from a finemapping pipeline result
extractCsInfo()
Process Credible Sets (CS) from Finemapping Results
extractTopPipInfo()
Extract Information for Top Variant from Finemapping Results
formatFinemappingOutput()
Format Fine-mapping Post-processing for Protocol Output
lbfToAlpha()
Applies the 'lbfToAlphaVector' function row-wise to a matrix of log Bayes factors to convert them to Single Effect PIP values.
postprocessFinemappingFits()
Post-process Fine-mapping Fits
combineFineMappingResults()
Combine FineMappingResult collections
overlapTopLoci()
Overlap QTL and GWAS top loci by allele-aware variant matching

TWAS

Per-method weight-training functions invoked by twasWeightsPipeline(), the cross-validation / ensembling machinery that combines them, and multi-method p-value combination. Grouped by method family below. (SuSiE-family weight functions live under “Fine-mapping” above since they double as fine-mappers.)

Penalized regression

lassosumRss()
Lassosum RSS: LASSO on summary statistics with LD reference
lassosumRssWeights()
Extract weights from lassosumRss with shrinkage grid search
mcpWeights()
Compute Weights Using MCP-Penalized Regression
mcpRssWeights()
Compute MCP-Penalized Weights from Summary Statistics
scadWeights()
Compute Weights Using SCAD-Penalized Regression
scadRssWeights()
Compute SCAD-Penalized Weights from Summary Statistics
l0learnWeights()
Compute Weights Using L0Learn
l0learnRssWeights()
Compute L0-Penalized Weights from Summary Statistics
penalizedRss()
Penalized Regression on RSS (Summary Statistics) Objective

Bayesian alphabet

bayesAlphabetWeights()
Extract Coefficients From Bayesian Linear Regression
bayesAWeights()
Use t-distribution as prior.
bayesBWeights()
Compute Weights Using BayesB
bayesCWeights()
Use a rounded spike prior (low-variance Gaussian).
bayesLWeights()
Use laplace/double exponential distribution as prior. This is equivalent to Bayesian LASSO.
bayesNWeights()
Use Gaussian distribution as prior. Posterior means will be BLUP, equivalent to Ridge Regression.
bayesRWeights()
Use a hierarchical Bayesian mixture model with four Gaussian components. Variances are scaled by 0, 0.0001 , 0.001 , and 0.01 .
bLassoWeights()
Compute Weights Using the Bayesian LASSO (BGLR)
prsCs()
PRS-CS: a polygenic prediction method that infers posterior SNP effect sizes under continuous shrinkage (CS) priors
prsCsWeights()
Extract weights from prsCs function
sdpr()
SDPR (Summary-Statistics-Based Dirichelt Process Regression for Polygenic Risk Prediction)
sdprWeights()
Extract weights from sdpr function
dprWeights() dprVbWeights() dprGibbsWeights() dprAdaptiveGibbsWeights()
Compute Weights Using Dirichlet Process Regression (RcppDPR)

mr.mash / mr.ash

mrashWeights()
Compute Weights Using mr.ash Shrinkage
mrAshRssWeights()
Extract weights from mr.ash.rss (susieR)
mrmashWeights()
Compute mr.mash TWAS weights
mrmashRssWeights()
Compute mr.mash-RSS TWAS weights from summary statistics
mrmashWrapper()
Mr.Mash Wrapper
buildMrmashPriorMatrices()
Build mr.mash prior covariance matrices
computeCovDiag()
Compute diagonal covariance matrix
computeCovFlash()
Compute covariance matrix using FLASH

Ensembling / cross-validation / prediction

learnTwasWeights()
Run multiple TWAS weight methods
ensembleWeights()
Ensemble TWAS Weights via Stacked Regression
combineTwasWeights()
Combine TwasWeights collections
twasWeightsCv()
Cross-Validation for weights selection in Transcriptome-Wide Association Studies (TWAS)
twasPredict()
Predict outcomes using TWAS weights
twasZ()
Calculate TWAS Z-Statistics for One or More Methods / Contexts
estimateSparsity()
Estimate Sparsity from mr.ash Mixture Proportions

Multi-method p-value combination

combinePValues()
Combine P-values via Any of a Menu of Methods

mash

The mash (multivariate adaptive shrinkage) track: the chainable steps -> -> (or ) -> -> that is built from, the posterior-contrast + feature-score layer, and the supporting utilities for contrast construction and meta-analysis.

mashInput()
Assemble MASH strong / random / null input from S4 objects
mashResidualCorrelation()
Estimate the mash Residual Correlation Matrix (Vhat)
mashCovarianceComponents()
Build mash Data-Driven Covariance Components
mashPriorCovariances()
Estimate mash Prior Covariances and Mixture Weights
mashModelFit()
Fit a mash Model for Posterior Computation
mashPosterior()
Compute mash Posterior Matrices for a Target Set
mashPosteriorContrast()
Posterior contrast table over an entire mash posterior
calculateFeatureScores()
Feature score from deviation contrasts (random-effects meta per condition)
nSignificantScore()
Feature score from the fraction of significant deviation contrasts
scoreFromCs()
Feature score from fine-mapped credible sets
makePairwiseContrastCol()
Create a pairwise contrast column
fitMashContrast()
Compute pairwise contrasts from mash posterior
metaAnalysisPerCondition()
Random-Effects Meta-Analysis of Mash Pairwise Contrasts, per Condition
sanitizeMashData()
Sanitize NaN/Inf values in mash data
sliceMashData()
Subset mash data matrices to specific SNPs and conditions
updateMashModelCov()
Subset a fitted mash model to a subset of conditions

Heritability and enrichment

Heritability estimation, LD-score computation, stratified LD-score regression utilities, and per-variant QTL/GWAS enrichment analysis (low-level kernel that powers ).

estimateH2()
Estimate SNP Heritability
computeLdScores()
Compute LD Scores
computeSldscAnnotSd()
Compute per-annotation standard deviation, MAF-restricted
computeSldscMRef()
Reference-panel SNP count (the M_ref used to standardise tau*)
readAnnotations()
Read Annotations
readSldscTrait()
Read S-LDSC outputs from polyfun for one trait/run
readSldscAnnot()
Read target annotation files (.annot.gz) into one table
readSldscFrq()
Read PLINK allele-frequency files (.frq) into one table
standardizeSldscTrait()
Standardize tau and compute EnrichStat for one polyfun run
h2EstimateToSldscTrait()
Convert H2Estimate to S-LDSC Trait Format
isBinarySldscAnnot()
Detect whether each annotation is binary or continuous
metaSldscRandom()
Random-effects meta-analysis of S-LDSC quantities across traits
sldscSubsetMeta()
Random-effects meta-analysis over a subset of sLDSC traits
qtlEnrichment()
Implementation of enrichment analysis described in https://doi.org/10.1371/journal.pgen.1006646

Bundled example datasets

Synthetic data shipped with the package for vignettes and tests. Their bundled GenotypeHandle paths resolve to the installed inst/extdata/ location automatically at extraction time.

qtl_dataset_example
Example QtlDataset (S4)
qtl_sumstats_example
Example QtlSumStats (S4)
qtl_sumstats_multicontext_example
Example multi-context QtlSumStats (S4) for mash demos
gwas_sumstats_s4_example
Example GwasSumStats (S4)
multi_study_qtl_dataset_example
Example MultiStudyQtlDataset (S4)
eqtl_region_example
Example eQTL Region Data (Individual-Level)
gwas_sumstats_example
Example GWAS Summary Statistics
gwas_finemapping_example
Example GWAS Fine-Mapping Results (SuSiE)
qtl_finemapping_example
Example QTL Fine-Mapping Results (SuSiE)
multitrait_data
Simulated Multi-condition Data for TWAS analysis