Create a Table of Credible Sets from SusieR Model
susieR_cs_table.RdThis function processes a susieR model object to extract the SNPs and their corresponding Posterior Inclusion Probabilities (PIP) for each credible set. It also includes a list of other SNPs in the same credible set, ensuring that only the SNP with the highest PIP in each credible set receives a label in the label column.
Arguments
- susieR_model
A
susieRmodel object, which includes the following components:setsA list containing credible sets, where each set is represented by indices of SNPs.X_column_scale_factorsA vector of SNP identifiers (e.g., SNP names).pipA named vector of Posterior Inclusion Probability (PIP) values, indexed by SNP names.
- df
A data frame containing SNP information, with the following columns:
SNPThe SNP identifiers.POSThe position of each SNP.PThe p-value associated with each SNP.
Value
A tibble (data frame) containing the following columns:
SNPThe SNP identifiers.POSThe position of each SNP.PThe p-value for each SNP.PIPThe Posterior Inclusion Probability for each SNP.cs_snpsA string listing the other SNPs in the same credible set (NA if only one SNP).csThe credible set identifier, represented as a factor.testA string indicating the test used for generating the table (always "susie").labelThe SNP identifier for the SNP with the lowest P value within each credible set (NA for other SNPs).
Examples
if (FALSE) { # \dontrun{
result <- susieR_cs_table(susie_model, df)
print(result)
} # }