Extract Information for Top Variant from Finemapping Results
Source:R/fineMappingWrappers.R
extractTopPipInfo.RdThis function extracts information about the variant with the highest Posterior Inclusion Probability (PIP) from finemapping results, typically used when no Credible Sets (CS) are identified in the analysis.
Arguments
- fmRow
A
fineMappingRowcarrying the SuSiE fit and variant ids (e.g. fromgetFineMappingResult).- sumstats
A list or data frame carrying a
zelement aligned to the fit's variants (sumstats$z).
Value
A data frame with one row containing the following columns:
- cs_name
NA (as no CS is identified)
- variants_per_cs
NA (as no CS is identified)
- top_variant
ID of the variant with the highest PIP
- top_variant_index
Index of the top variant in the original data
- top_pip
Highest Posterior Inclusion Probability (PIP)
- top_z
Z-score of the top variant
- p_value
P-value calculated from the top Z-score
- cs_corr_max
NA (no between-CS correlation without a CS)
- cs_corr_min
NA (no between-CS correlation without a CS)
Details
This function is designed to be used when no Credible Sets are identified in the finemapping results, but information about the most significant variant is still desired. It identifies the variant with the highest PIP and extracts relevant statistical information.
Note
This function is particularly useful for capturing information about potentially important variants that might be included in Credible Sets under different analysis parameters or lower coverage. It maintains a structure similar to the output of `extract_cs_info()` for consistency in downstream analyses.
See also
extractCsInfo for processing when Credible Sets are
present.
Examples
vids <- c("chr1:100:A:G", "chr1:200:C:T", "chr1:300:G:A")
fit <- list(pip = c(0.1, 0.7, 0.2))
tl <- data.frame(variant_id = vids, pip = c(0.1, 0.7, 0.2))
fe <- fineMappingRow(variantIds = vids, susieFit = fit, topLoci = tl)
extractTopPipInfo(fe, sumstats = list(z = c(1.0, 3.5, -0.5)))
#> $cs_name
#> [1] NA
#>
#> $variants_per_cs
#> [1] NA
#>
#> $top_variant
#> [1] "chr1:200:C:T"
#>
#> $top_variant_index
#> [1] 2
#>
#> $top_pip
#> [1] 0.7
#>
#> $top_z
#> [1] 3.5
#>
#> $p_value
#> [1] 0.0004652582
#>
#> $cs_corr_max
#> [1] NA
#>
#> $cs_corr_min
#> [1] NA
#>