Extract sample sizes: the per-variant sample-size vector of a
GwasSumStats or QtlSumStats entry, selected by its identity
tuple, the number of samples carried by a GenotypeHandle, or the
panel size an LdMatrix records.
Usage
nSamples(x, ...)
# S4 method for class 'LdMatrix'
nSamples(x, ...)
# S4 method for class 'GenotypeHandle'
nSamples(x)
# S4 method for class 'SumStatsBase'
nSamples(
x,
studyName = NULL,
context = NULL,
trait = NULL,
annotateSignificance = NULL,
ranges = NULL
)Arguments
- x
A
GwasSumStats,QtlSumStats,LdMatrixorGenotypeHandleobject.- ...
Class-specific selection arguments.
- studyName
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 passed through to
sumStats(QTL only);NULLapplies none.- ranges
A
GRangesorNULL(default). Return only the variants overlapping these ranges;NULLreturns everything.
Value
Numeric vector of sample sizes for a summary-statistic entry;
integer of length 1 for a GenotypeHandle or an LdMatrix
(NA when the matrix records no size).
Details
The genotype handle is the seed layer behind a panel and is not
part of the public interface; obtain a panel from
readGenotypes() and ask it directly.
Examples
data(qtlSumStatsExample)
nSamples(qtlSumStatsExample)
#> [1] 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165
#> [19] 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165
#> [37] 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165
#> [55] 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165
#> [73] 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165
#> [91] 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165
#> [109] 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165
#> [127] 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165
#> [145] 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165
#> [163] 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165
#> [181] 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165
#> [199] 165 165