Get a Single Summary-Statistic Entry or Embedded Collection
Source:R/AllGenerics.R, R/MultiStudyQtlDataset.R, R/qtlSumStats.R
getSumStats.RdBehavior depends on the class of x:
- For
GwasSumStats/QtlSumStats Returns the per-variant
GRangesof summary statistics for one entry, selected by its identity tuple (studyfor GWAS;study,context,traitfor QTL).- For
MultiStudyQtlDataset Returns the embedded
QtlSumStatscollection (the summary-statistic-only studies), orNULLwhen 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, orMultiStudyQtlDatasetobject.- ...
Class-specific selection arguments (see above).
- study
Character (length 1) or
NULL. Restrict the selection to this study;NULLmatches all studies.- context
Character (length 1) or
NULL. Restrict the selection to this context;NULLmatches all contexts.- trait
Character (length 1) or
NULL. Restrict the selection to this trait;NULLmatches all traits.- annotateSignificance
Optional correction-method name (
"permutation"/"bonferroni_original"/"bonferroni_filtered"/"qvalue"). When set on a QtlSumStats enriched byqtlAssociationPostprocess, a logicalsignificantmcol 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; notegetSumstatDfis a fixed GWAS-schema view and does not carry the association columns.- ranges
A
GRangesorNULL(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 singleGRanges. Passrangesto pull only the variants overlapping a region instead of the whole span;NULLreturns everything.
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