Skip to contents

Behavior depends on the class of x:

For GwasSumStats / QtlSumStats

Returns the per-variant GRanges of summary statistics for one entry, selected by its identity tuple (study for GWAS; study, context, trait for QTL).

For MultiStudyQtlDataset

Returns the embedded QtlSumStats collection (the summary-statistic-only studies), or NULL when absent. No selection arguments are accepted in this case.

Usage

getSumStats(x, ...)

# S4 method for class 'MultiStudyQtlDataset'
getSumStats(x, ...)

# S4 method for class 'QtlSumStats'
getSumStats(
  x,
  study = NULL,
  context = NULL,
  trait = NULL,
  annotateSignificance = NULL,
  ranges = NULL,
  ...
)

Arguments

x

A GwasSumStats, QtlSumStats, or MultiStudyQtlDataset object.

...

Class-specific selection arguments (see above).

study

Character (length 1) or NULL. Restrict the selection to this study; NULL matches all studies.

context

Character (length 1) or NULL. Restrict the selection to this context; NULL matches all contexts.

trait

Character (length 1) or NULL. Restrict the selection to this trait; NULL matches all traits.

annotateSignificance

Optional correction-method name ("permutation" / "bonferroni_original" / "bonferroni_filtered" / "qvalue"). When set on a QtlSumStats enriched by qtlAssociationPostprocess, a logical significant mcol for that method is added to the returned entry (the significance is derived on the fly, not stored). Flat export flattens this full entry GRanges (all mcols) directly; note getSumstatDf is a fixed GWAS-schema view and does not carry the association columns.

ranges

A GRanges or NULL (default). A selected tuple can own several elements – one per chromosome, since a multi-seqname entry is split at construction – and they are stitched back into a single GRanges. Pass ranges to pull only the variants overlapping a region instead of the whole span; NULL returns everything.

Value

A GRanges, a QtlSumStats, or NULL.

Examples

data(qtlSumStatsExample)
getSumStats(qtlSumStatsExample)
#> GRanges object with 200 ranges and 8 metadata columns:
#>         seqnames    ranges strand |                SNP          A1          A2
#>            <Rle> <IRanges>  <Rle> |        <character> <character> <character>
#>     [1]    chr22  14560203      * | chr22:14560203:A:G           G           A
#>     [2]    chr22  14564328      * | chr22:14564328:T:C           C           T
#>     [3]    chr22  14850625      * | chr22:14850625:T:G           G           T
#>     [4]    chr22  14870204      * | chr22:14870204:T:C           C           T
#>     [5]    chr22  14878387      * | chr22:14878387:G:A           A           G
#>     ...      ...       ...    ... .                ...         ...         ...
#>   [196]    chr22  15823238      * | chr22:15823238:A:T           T           A
#>   [197]    chr22  15823381      * | chr22:15823381:G:A           A           G
#>   [198]    chr22  15825502      * | chr22:15825502:C:A           A           C
#>   [199]    chr22  15826914      * | chr22:15826914:T:G           G           T
#>   [200]    chr22  15826991      * | chr22:15826991:T:C           C           T
#>                 Z         N       BETA        SE       MAF
#>         <numeric> <integer>  <numeric> <numeric> <numeric>
#>     [1] -1.020025       165 -0.2367542  0.232106 0.0757576
#>     [2]  0.108826       165  0.0190289  0.174856 0.1757576
#>     [3] -0.225078       165 -0.0431312  0.191628 0.1272727
#>     [4] -0.989340       165 -0.1194302  0.120717 0.3515152
#>     [5] -0.884412       165 -0.1493989  0.168924 0.1656442
#>     ...       ...       ...        ...       ...       ...
#>   [196]  0.419345       165  0.0515903  0.123026  0.421212
#>   [197] -0.401322       165 -0.0507044  0.126344  0.339394
#>   [198]  0.284694       165  0.0350967  0.123279  0.454545
#>   [199] -0.564951       165 -0.1014774  0.179622  0.106061
#>   [200]  1.661477       165  0.2135632  0.128538  0.315152
#>   -------
#>   seqinfo: 1 sequence from hg19 genome; no seqlengths