Skip to contents

Assemble and clean a per-condition effect-size / z-score matrix for mashr, dropping variants with invalid or insufficiently-observed statistics.

Usage

filterInvalidSummaryStat(
  datList,
  bhat = NULL,
  sbhat = NULL,
  z = NULL,
  btoz = FALSE,
  sigPCutoff = 1e-06,
  filterByMissingRate = 0.2
)

Arguments

datList

A named list of summary-statistic data frames / matrices.

bhat

Optional name of the effect-size element in datList.

sbhat

Optional name of the standard-error element in datList.

z

Optional name of the z-score element in datList.

btoz

Logical. If TRUE, derive z-scores from bhat/sbhat.

sigPCutoff

Numeric. Significance p-value cutoff for selecting strong signals. Default 1e-6.

filterByMissingRate

Numeric in [0, 1]. Drop variants observed in fewer than this fraction of conditions. Default 0.2.

Value

A cleaned list of summary-statistic matrices suitable for mash.

Examples

datList <- list(strong = list(z = matrix(rnorm(9), 3, 3)))
filterInvalidSummaryStat(datList)
#> $strong
#> $strong$z
#>            [,1]       [,2]       [,3]
#> [1,]  0.3412484 -1.2055752 -0.9224107
#> [2,]  1.3161672  1.5675731 -1.0737724
#> [3,] -0.9597765  0.2252858 -0.5523583
#> 
#>