flashfmZero.Rmd
flashfmZero (flexible and shared information fine-mapping of uncorrelated quantitative traits) is an R package to simultaneously fine-map genetic associations for multiple (with zero correlation) quantitative traits. It extends on the multi-trait fine-mapping framework of flashfm. In addition, it provides an approach to estimate latent factor GWAS summary statistics using only summary level data - observed trait GWAS summary statistics, observed trait covariance matrix.
FlashfmZero is a computationally efficient approach to simultaneously fine-map signals in any number of uncorrelated quantitative traits (i.e. zero correlation), as may result from latent factors estimated from factor analysis using a varimax rotation. For correlated traits, the original flashfm multi-trait fine-mapping method should be used, which is also available in this package for convenience. Flashfm and flashfmZero output trait-specific results, leveraging information between traits; for each trait, credible sets, SNP marginal posterior probabilities of causality (MPP), and multi-SNP model posterior probabilities (PP) are output.
Any single-trait fine-mapping method that outputs model posterior probabilities may be integrated with flashfmZero and flashfm, and here we provide wrapper functions that integrate our expanded version of JAM. A wrapper function for flashfm with FINEMAP, FLASHFMwithFINEMAP, is available here with examples in the flashfm R package, where an overview of flashfm multi-trait fine-mapping is provided.
Example annotated scripts that only use observed trait summary-level data in our analysis of the INTERVAL study’s NMR metabolic traits (Karjalainen et al. 2024) are available on the flashfmZero website in the article tabs. These scripts (with minor modifications) were also used in our analysis of 99 blood cell traits from the INTERVAL study (Astle et al. 2016, Akbari et al. 2023).
See Estimation of latent factors and Latent factor GWAS and fine-mapping for annotated example R scripts that use summary-level data and are broadly applicable to other GWAS data. There, we also include an example of how to use built-in functions from this package to summarise results from many traits and regions, producing a table as in Supplementary Tables S9 and S14 of the associated paper.
For more details, please see:
F Zhou, WJ Astle, AS Butterworth, JL Asimit. (2025). Improved genetic discovery and fine-mapping resolution through multivariate latent factor analysis of high-dimensional traits. Cell Genomics. link
Estimating latent factor GWAS summary statistics from observed trait GWAS summary statistics
We recommend removing any traits that have measurements from fewer than half of the participants in the study. Factor analysis estimates latent factors from the covariance matrix of the observed traits, but when there are many highly correlated latent factors (e.g. multiple pairs of traits with correlation > 0.99, as in the NMR data from the INTERVAL study) it is not computationally possible. In such cases, we recommend removing traits one-by-one based on the number of high-correlations that they have, as illustrated in Estimation of latent factors.
Example code (with data provided in this package) are described for:
Factor analysis is used to estimate the factor loadings for the latent factors that explain variation in the observed traits and is carried out using functions from the psych R library. It only requires the trait covariance matrix, which may be calculated from the individual-level trait data, allowing for missing trait measurements, i.e. each trait covariance is calculated from pairwise complete trait measurements. Alternatively, the trait covariance could be estimated from GWAS summary statistics using a method like cross-trait LD score regression.
Below we illustrate how to run factor analysis using 10 blood cell traits from the INTERVAL study; this is a subset of the 99 blood cell traits that are available. The INTERVAL study consists of healthy UK blood donors and the original GWAS data are described in Astle et al. (2016) and Akbari et al. (2023).
The trait covariance matrix for the 10 selected traits was calculated using pairwise complete observations and is stored as sel_covY in this package.
library(psych)
sel_covY <- cov(Y, use="pairwise.complete.obs", method='pearson') # Y is an NxP matrix of P traits (allowing for missing values) measured in a sample of N individuals
# alternatively, covY could be estimated from GWAS summary statistics using a method like cross-trait LD score regression
The trait covariance is then used to estimate the number of latent factors using the psych::fa.parallel function, with arguments fa=“fa” for factor analysis, fm=“ml” for maximum likelihood estimation, and rotate=“varimax” for a varimax rotation, which ensures that the latent factors have zero correlation. The fa.parallel function will produce a scree plot to help determine the number of factor and will suggest the number of factors, which is printed to the screen and stored in the “nfact” list component of the fa.parallel output.
After estimating the number of latent factors, factor analysis is run using psych::fa and specifying the number of latent factors, nfact, fm=“ml” for maximum likelihood estimation, and rotate=“varimax” for a varimax rotation. The factor loadings are stored in the loadings component of the fa output, and we provide it in this package as faYloading.
N <- 43059 # INTERVAL study sample size
facheck <- psych::fa.parallel(sel_covY, fm="ml", n.obs=N,fa="fa",show.legend=F,main="") # select number of factors
faY <- psych::fa(r=sel_covY, nfactors=facheck$nfact, fm="ml", rotate="varimax") # run factor analysis
faYloading <- as.matrix(faY$loadings) # factor loadings matrix available in this package for convenience
We provide the function factor_contributions that helps in interpreting latent factors. This function takes the factor loading matrix as input and returns the latent factor contributions (re-scaled factor loadings) and factor loading matrix with observed traits ordered by maximum contributing latent factor. The contribution of latent factor j to observed trait i indicates the proportion of variance in the observed trait that is explained by the latent factor. Grouping observed traits by common highest contributing latent factor helps in understanding which groups of observed traits have common underlying latent factors.
library(flashfmZero)
latent_terms <- flashfmZero::factor_contributions(faYloading)
rescaledFAloading <- latent_terms[[1]] # rows are observed traits and columns are latent factors
FAloading <- latent_terms[[2]]
sel_covY <- sel_covY[rownames(FAloading),rownames(FAloading)] # reorder covY so traits are in same order as for FAloading
In our example data of ten traits, four latent factors are recommended and the contributions matrix is:
print(rescaledFAloading)
#> ML1 ML2 ML3 ML4
#> RET_Xch 0.881629882 0.04011455 0.0681982614 0.0100573054
#> mfr_pct 0.933805744 0.02891708 0.0125177905 0.0247593890
#> lfr_pct 0.893484382 0.02997260 0.0613639012 0.0151791210
#> hlr_p 0.892301102 0.01670686 0.0231408061 0.0678512359
#> hlr 0.891476867 0.01295529 0.0216744860 0.0738933529
#> irf 0.897458694 0.02991139 0.0591360531 0.0134938646
#> rdw_sd_fl 0.009206151 0.98656724 0.0035557957 0.0006708088
#> macror_pct 0.081193172 0.83495672 0.0002973601 0.0835527516
#> rdw 0.010110982 0.95504733 0.0105618779 0.0242798069
#> hfr_pct 0.314461245 0.01716073 0.6682284177 0.0001496026
This suggests that three traits (rdw_sd_fl, macror_pct, pct) are explained by latent factor ML2, five traits (mfr_pct, lfr_pct, hlr_p, hlr, irf) are explained by ML1, and one trait (hfr_pct) is explained by ML3 (67%) and ML1 (31%).
GWAS of latent factors may be conducted directly by estimating latent factor scores from factor analysis, which requires individual-level trait measurements in complete data, i.e. all individuals have measurements for all traits (no missing values). Then, using individual-level genotype data to perform a GWAS of the latent factor.
Alternatively, latent factor GWAS summary statistics may be estimated from the observed trait GWAS summary statistics and the observed trait covariance matrix; the factor loading matrix is also needed, which is estimated using the trait covariance matrix as described in the factor analysis section.
Required data for latent factor GWAS estimation using summary-level data
L: Factor loading matrix (FAloading in above example), which has observed trait names as row names and latent factor names as column names.
covY: Trait covariance matrix (sel_covY in above example), which has observed trait names in row and column names, appearing in the same order as the trait names in the rows of FAloading.
obsGWAS: Observed trait GWAS effect estimates and standard errors, (sel_obsgwas is provided as an example for ten traits). This should be a list of the P observed trait GWAS data.frames, each data.frame, i.e. sel_obsgwas[[i]] is the data.frame for trait i. The observed traits must appear in the same order as in covY. Each data.frame has rows corresponding to genetic variants and columns of the SNP id, effect estimates (beta) and their standard errors, and effect allele frequencies. Only variants present for all traits should be included. Column names are recommended to be “beta”, “SE”, and “rsID” for compatibility with the fine-mapping functions. All GWAS must have the same effect allele before running latentGWAS. The function flashfmZero::harmoniseGWAS may be used to re-format data.
library(flashfmZero)
latent_gwas <- latentGWAS(obsGWAS = sel_obsgwas,covY = sel_covY,L = FAloading, beta_colname="beta",se_colname="SE", snpID_colname="rsID",EAF = sel_obsgwas[[1]]$EAF)
Here we illustrate fine-mapping using latent factors that were estimated from the 99 blood cell traits of the INTERVAL study, to replicate results from our analyses.
Required data for fine-mapping
Example data are described in detail below. Briefly, all multi-trait functions require:
rsID: (variant ID names - if using the JAM functions, variant names must not contain “:” and variant names must start with a non-numeric character, see Notes for details). All rsIDs must be unique, i.e. no duplicate names.
beta: GWAS effect sizes
EAF: effect allele frequency; frequency of effect allele that coincides with beta
To assist in harmonising the GWAS summary statistics from all traits (same variants for all traits and same effect allele) we provide the harmoniseGWAS function.
To align the GWAS data with the LD data, we provide the alignGWAS function.
The single-trait functions require the same input, except the GWAS argument is gwas, a data.frame as in gwas.list, i.e. gwas has the form of gwas.list[[1]].
Available fine-mapping functions in this package include:
JAMdwithGroups: for single-trait fine-mapping using our JAMdynamic algorithm that adjusts the maximum number of causal variants, according to the data, so that out-of-sample reference panels, such as from the 1000 Genomes Project, may be used; output includes SNP groups that indicate distinct causal variants.
multiJAMd: for single-trait fine-mapping of multiple traits using our JAMdynamic algorithm and outputting SNP groups that indicate distinct causal variants. By running multiJAMd, a single set of SNP groups is produced allowing simple comparisons of group-level results between traits; running JAMdwithGroups on each trait will produce a set of SNP groups each time, where the group label names will not necessarily match. Any number of traits is accepted.
FLASHFMZEROwithJAMd: flashfm multi-trait fine-mapping (zero correlated traits) with JAMdynamic; runs single and multi-trait fine-mapping and outputs both sets of results. Any number of uncorrelated traits is accepted.
FLASHFMwithJAMd: flashfm multi-trait fine-mapping with JAMdynamic (as available in MGflashfm at https://jennasimit.github.io/MGflashfm/, where an example is provided); runs single and multi-trait fine-mapping and outputs both sets of results. The trait correlation needs to be provided as input, and allows up to six traits.
For use with pre-calculated single-trait fine-mapping results, use the function flashfmZero and follow the steps in the last example here, which illustrates how to combine flashfm (same steps as for flashfmZero) with FINEMAP.
This vignette introduces JAMdwithGroups, multiJAMd, and FLASHFMZEROwithJAMd and gives illustrations of their use on example data of three uncorrelated latent factors based on the INTERVAL cohort, for a subset of the SMIM1 region; this example data are provided in the flashfmZero R package.
Example data are described below, followed by illustrations.
For an overview of the flashfm and MGflashfm R packages and further examples, see the flashfm GitHub page and MGflashfm GitHub page
This example data has been extracted from our analyses of the INTERVAL study. The INTERVAL study consists of healthy UK blood donors and the original GWAS data are described in Astle et al. (2016) and Akbari et al. (2023).
As data are not missing at random, we focus on 18,310 participants who have all 99 blood cell trait measured, and run a factor analysis with varimax rotation to estimate 25 latent factors (based on scree plot) that are uncorrelated (analysis scripts available at https://github.com/fz-cambridge/flashfmZero-INTERVAL-analysis). Upon running GWAS on these 25 latent factors and the 99 raw blood cell traits, we identified three latent factors and eight raw blood cell traits that have genome-wide signals in the gene SMIM1. All of these traits are related to red blood cells.
The 99% credible sets (CS99) based on raw traits range from 30 to 58 variants, whilst latent single-trait fine-mapping reduces the CS99 with sizes between 5 and 30, and flashfmZero multi-trait fine-mapping reduces each of the CS99 to the same single variant, rs1175550; rs1175550 is a high-confidence variant for red blood cell traits (e.g. HGB, RBC#, MCHC) in UK Biobank (Vuckovik et al. 2020), rs1175550 has also been shown to be transcriptionally active and modulates Vel blood group antigen expression (Cvejic et al. 2013).
The original region contains 2,940 variants, and in our provided example we focus on 313 variants from the centre of this region.
The data that are needed to run our fine-mapping functions are shown below, to indicate the required format.
library(flashfmZero)
lapply(SMIM1.gwas.list.interval.fa25,head)
#> $ML12
#> rsID beta EAF P_value
#> 1304 chr1_bp3680056_rsidrs56079032 0.0246839 0.038106 0.420
#> 1305 chr1_bp3680086_rsidrs41300096 -0.0323755 0.010960 0.610
#> 1306 chr1_bp3680150_rsidrs370577539 -0.0661367 0.013883 0.280
#> 1307 chr1_bp3680345_rsidrs144028564 0.0834726 0.006468 0.200
#> 1308 chr1_bp3680427_rsidrs41306998 -0.0790459 0.023954 0.071
#> 1309 chr1_bp3680464_rsidrs115148292 -0.0368321 0.017191 0.430
#>
#> $ML14
#> rsID beta EAF P_value
#> 1304 chr1_bp3680056_rsidrs56079032 0.01292720 0.038106 0.68
#> 1305 chr1_bp3680086_rsidrs41300096 0.02021970 0.010960 0.76
#> 1306 chr1_bp3680150_rsidrs370577539 -0.00331711 0.013883 0.96
#> 1307 chr1_bp3680345_rsidrs144028564 0.08080000 0.006468 0.23
#> 1308 chr1_bp3680427_rsidrs41306998 -0.00253683 0.023954 0.96
#> 1309 chr1_bp3680464_rsidrs115148292 -0.02852000 0.017191 0.55
#>
#> $ML4
#> rsID beta EAF P_value
#> 1304 chr1_bp3680056_rsidrs56079032 -0.03947990 0.038106 0.22
#> 1305 chr1_bp3680086_rsidrs41300096 0.09128710 0.010960 0.16
#> 1306 chr1_bp3680150_rsidrs370577539 -0.01864240 0.013883 0.77
#> 1307 chr1_bp3680345_rsidrs144028564 -0.00426462 0.006468 0.95
#> 1308 chr1_bp3680427_rsidrs41306998 -0.00621393 0.023954 0.89
#> 1309 chr1_bp3680464_rsidrs115148292 -0.01792620 0.017191 0.71
#library(flashfmZero)
SMIM1.corX[1:2,1:2]
#> chr1_bp3680056_rsidrs56079032
#> chr1_bp3680056_rsidrs56079032 1.000000000
#> chr1_bp3680086_rsidrs41300096 -0.006982815
#> chr1_bp3680086_rsidrs41300096
#> chr1_bp3680056_rsidrs56079032 -0.006982815
#> chr1_bp3680086_rsidrs41300096 1.000000000
library(flashfmZero)
save.path.tmp <- "tmpDIR"
dir.create(save.path.tmp)
#' NB If a directory is not provided in save.path, the function will create this save.path as a sub-folder in the working directory.
#'
# use JAMdwithGroups function for one trait
JAMdwithGroups.out.fa25.single <- JAMdwithGroups(gwas = SMIM1.gwas.list.interval.fa25[[1]],
N = SMIM1.N,
corX = SMIM1.corX,
cred = 0.99,
save.path = save.path.tmp,
jam.nM.iter = 5,
maxcv = 1,
maxcv_stop = 20,
min.mppi = 0.01,
r2.minmerge = 0.8,
extra.java.arguments = NULL)
More specifically, the above arguments are:
- gwas: GWAS results for one single trait, i.e. a data.frame with the first 3 columns named: rsID, beta, EAF;
- N: scalar that is the trait sample size;
- corX: SNP correlation matrix that must have snp names in row.names and col.names;
- cred: probability for credible set, default is 0.99 for 99% credible sets;
- save.path: Path to save JAM output files, tmp files and could delete these later e.g. save.path=paste0(DIRout,"/tmpJAM/region1");
- jam.nM.iter: in millions, number of iterations to use in JAM, default is 1 (one million);
- maxcv: starting value for maximum number of causal variants;
- maxcv_stop: maximum value to consider for maximum number of causal variants (maxcv_stop >= maxcv);
- min.mppi: trim snp groups with total MPPI < min.mppi, default is 0.01;
- r2.minmerge: merge groups with minimum between-group r2 > r2.minmerge, default is 0.5;
- extra.java.arguments: default is NULL; A character string to be passed through to the java command line. E.g. to specify a different temporary directory by passing "-Djava.io.tmpdir=/Temp".
Ouput can be viewed here.
library(flashfmZero)
save.path.tmp <- "tmpDIR"
dir.create(save.path.tmp)
#' NB If the named directory in save.path does not exist, the function will create this save.path (if single directory name) as a sub-folder in the working directory.
#' set NCORES=M (number of traits M is optimal but could choose smaller number) or NCORES=1 if running on hpc,
#' but if on Windows/Mac, must use NCORES=1
#'
# JAM on multiple traits, also outputting SNP groups
all.single.traits.results <- multiJAMd(gwas.list = SMIM1.gwas.list.interval.fa25,
corX = SMIM1.corX,
N = SMIM1.N,
save.path = save.path.tmp,
maxcv = 1,
maxcv_stop = 20,
jam.nM.iter = 5,
r2.minmerge = 0.8,
minsnpmppi = 0.01,
NCORES = 1)
all.single.traits.CS99 <- multiJAMdCS(all.single.traits.results, cred = 0.99)
In addition to some of the arguments in JAMdwithGroups earlier, the different arguments are:
- gwas.list: List of M data.frames, where M is the number of traits; gwas.list[[i]] is a data.frame (one for each trait) with the first 3 columns named: rsID, beta, EAF; if trait names are provided for the M data.frames, these trait names are given in output.
- N: scalar that is the trait sample size - same for all traits; if different sample sizes across traits, use flashfm to return single and multi-trait results;
- NCORES: number of cores for parallel computing; recommend NCORES=M in hpc or Linux, but if on local Windows/Mac machines, use NCORES=1.
Ouput can be viewed here.
library(flashfmZero)
save.path.tmp <- "tmpDIR"
dir.create(save.path.tmp)
#' NB If the named directory in save.path does not exist, the function will create this save.path (if single directory name) as a sub-folder in the working directory.
#' set NCORES=M (number of traits M is optimal but could choose smaller number) or NCORES=1 if running on hpc,
#' but if on Windows/Mac, must use NCORES=1
#'
# flashfm on multiple traits with zero correlation
multi.trait.results <- FLASHFMZEROwithJAMd(gwas.list = SMIM1.gwas.list.interval.fa25,
corX = SMIM1.corX,
N = SMIM1.N,
save.path=save.path.tmp,
TOdds = 1,
cpp = 0.99,
NCORES = 1,
maxcv = 1,
maxcv_stop = 20,
jam.nM.iter = 5,
r2.minmerge = 0.8,
minsnpmppi = 0.01)
multi.trait.results.CS99 <- allcredsetsPP(multi.trait.results$mpp.pp, cred=.99)
In addition to the arguments in JAMdwithGroups and multiJAMd earlier, the extra arguments are:
- TOdds: target odds of no sharing to sharing, default is 1.
- cpp: cumulative posterior probability threshold for selecting top models, default is 0.99.
Ouput can be viewed here.
# > JAMdwithGroups.out.fa25.single$CS
# MPP snp group
# chr1_bp3691528_rsidrs1175550 0.920955014 chr1_bp3691528_rsidrs1175550 A
# chr1_bp3687739_rsidrs1175552 0.029917755 chr1_bp3687739_rsidrs1175552 A
# chr1_bp3684954_rsidrs1181870 0.019770459 chr1_bp3684954_rsidrs1181870 A
# chr1_bp3691727_rsidrs1175549 0.015788612 chr1_bp3691727_rsidrs1175549 A
# chr1_bp3691434_rsidrs70940313 0.009034836 chr1_bp3691434_rsidrs70940313 chr1_bp3691434_rsidrs70940313
# > JAMdwithGroups.out.fa25.single$mpp.pp
# $MPP
# MPP
# chr1_bp3691528_rsidrs1175550 0.920955014
# chr1_bp3687739_rsidrs1175552 0.029917755
# chr1_bp3684954_rsidrs1181870 0.019770459
# chr1_bp3691727_rsidrs1175549 0.015788612
# chr1_bp3691434_rsidrs70940313 0.009034836
# chr1_bp3694796_rsidrs1891934 0.004533324
#
# $MPPg
# MPP
# A 0.986431839
# chr1_bp3691434_rsidrs70940313 0.009034836
# chr1_bp3694796_rsidrs1891934 0.004533324
#
# $PP
# PP
# chr1_bp3691528_rsidrs1175550 0.920955014
# chr1_bp3687739_rsidrs1175552 0.029917755
# chr1_bp3684954_rsidrs1181870 0.019770459
# chr1_bp3691727_rsidrs1175549 0.015788612
# chr1_bp3691434_rsidrs70940313 0.009034836
# chr1_bp3694796_rsidrs1891934 0.004533324
#
# $PPg
# PP
# A 0.986431839
# chr1_bp3691434_rsidrs70940313 0.009034836
# chr1_bp3694796_rsidrs1891934 0.004533324
# > JAMdwithGroups.out.fa25.single$snpGroups
# $A
# [1] "chr1_bp3691727_rsidrs1175549" "chr1_bp3691528_rsidrs1175550" "chr1_bp3687739_rsidrs1175552"
# [4] "chr1_bp3684954_rsidrs1181870"
# > all.single.traits.results
# $mpp.pp
# $mpp.pp$MPP
# $mpp.pp$MPP[[1]]
# MPP
# chr1_bp3691528_rsidrs1175550 9.135832e-01
# chr1_bp3687739_rsidrs1175552 2.967828e-02
# chr1_bp3684954_rsidrs1181870 1.961221e-02
# chr1_bp3691727_rsidrs1175549 1.566223e-02
# chr1_bp3691434_rsidrs70940313 8.962516e-03
# chr1_bp3694796_rsidrs1891934 4.497037e-03
# chr1_bp3691240_rsidrs1184341 2.649970e-03
# chr1_bp3693909_rsidrs1175546 1.601057e-03
# chr1_bp3706816_rsidrs149570540 1.152007e-03
# chr1_bp3697291_rsidrs2996428 7.076501e-04
# chr1_bp3704041_rsidrs7527973 6.938047e-04
# chr1_bp3718591_rsidrs113282222 5.881415e-04
# chr1_bp3711689_rsidrs6667255 2.433844e-04
# chr1_bp3718244_rsidrs12120684 1.988198e-04
# chr1_bp3709487_rsidrs7513053 1.579134e-04
# chr1_bp3719890_rsidrs6661554 1.182267e-05
#
# $mpp.pp$MPP[[2]]
# MPP
# chr1_bp3709487_rsidrs7513053 3.413734e-01
# chr1_bp3691528_rsidrs1175550 1.904409e-01
# chr1_bp3691434_rsidrs70940313 1.024995e-01
# chr1_bp3719890_rsidrs6661554 7.527003e-02
# chr1_bp3713746_rsidrs6424052 6.971481e-02
# chr1_bp3711689_rsidrs6667255 6.817898e-02
# chr1_bp3684954_rsidrs1181870 5.147635e-02
# chr1_bp3691240_rsidrs1184341 3.999624e-02
# chr1_bp3721609_rsidrs12127399 1.247632e-02
# chr1_bp3687739_rsidrs1175552 1.139365e-02
# chr1_bp3704041_rsidrs7527973 1.100342e-02
# chr1_bp3709093_rsidrs61759306 4.312098e-03
# chr1_bp3697291_rsidrs2996428 4.237263e-03
# chr1_bp3723155_rsidrs12125237 4.166272e-03
# chr1_bp3722486_rsidrs6424056 3.527337e-03
# chr1_bp3722830_rsidrs12125964 2.412461e-03
# chr1_bp3691727_rsidrs1175549 2.337911e-03
# chr1_bp3694796_rsidrs1891934 1.761245e-03
# chr1_bp3706816_rsidrs149570540 1.672484e-03
# chr1_bp3693909_rsidrs1175546 1.165261e-03
# chr1_bp3718244_rsidrs12120684 4.014782e-04
# chr1_bp3718591_rsidrs113282222 1.727522e-04
# chr1_bp3683690_rsidrs1181873 9.812805e-06
#
# $mpp.pp$MPP[[3]]
# MPP
# chr1_bp3691528_rsidrs1175550 0.4252065124
# chr1_bp3691727_rsidrs1175549 0.2176701711
# chr1_bp3694796_rsidrs1891934 0.0770320035
# chr1_bp3693909_rsidrs1175546 0.0681866839
# chr1_bp3684954_rsidrs1181870 0.0635163745
# chr1_bp3697291_rsidrs2996428 0.0507882758
# chr1_bp3691434_rsidrs70940313 0.0438767710
# chr1_bp3691240_rsidrs1184341 0.0150490061
# chr1_bp3687739_rsidrs1175552 0.0114188660
# chr1_bp3693032_rsidrs1175548 0.0064066155
# chr1_bp3693755_rsidrs1175547 0.0052522622
# chr1_bp3699568_rsidrs2799185 0.0045480481
# chr1_bp3704041_rsidrs7527973 0.0043959753
# chr1_bp3711689_rsidrs6667255 0.0033721258
# chr1_bp3713746_rsidrs6424052 0.0011248246
# chr1_bp3721609_rsidrs12127399 0.0006968169
# chr1_bp3719890_rsidrs6661554 0.0006059394
# chr1_bp3709487_rsidrs7513053 0.0004917694
# chr1_bp3706816_rsidrs149570540 0.0001940217
# chr1_bp3709093_rsidrs61759306 0.0001669367
#
#
# $mpp.pp$MPPg
# $mpp.pp$MPPg[[1]]
# MPP
# A 0.9980610313
# chr1_bp3706816_rsidrs149570540 0.0011520074
# chr1_bp3718591_rsidrs113282222 0.0005881415
# chr1_bp3718244_rsidrs12120684 0.0001988198
#
# $mpp.pp$MPPg[[2]]
# MPP
# A 9.833253e-01
# chr1_bp3709093_rsidrs61759306 4.312098e-03
# chr1_bp3723155_rsidrs12125237 4.166272e-03
# chr1_bp3722486_rsidrs6424056 3.527337e-03
# chr1_bp3722830_rsidrs12125964 2.412461e-03
# chr1_bp3706816_rsidrs149570540 1.672484e-03
# chr1_bp3718244_rsidrs12120684 4.014782e-04
# chr1_bp3718591_rsidrs113282222 1.727522e-04
# chr1_bp3683690_rsidrs1181873 9.812805e-06
#
# $mpp.pp$MPPg[[3]]
# MPP
# A 0.9834321157
# chr1_bp3693032_rsidrs1175548 0.0064066155
# chr1_bp3693755_rsidrs1175547 0.0052522622
# chr1_bp3699568_rsidrs2799185 0.0045480481
# chr1_bp3706816_rsidrs149570540 0.0001940217
# chr1_bp3709093_rsidrs61759306 0.0001669367
#
#
# $mpp.pp$PP
# $mpp.pp$PP[[1]]
# PP
# chr1_bp3691528_rsidrs1175550 9.135832e-01
# chr1_bp3684954_rsidrs1181870 1.961221e-02
# chr1_bp3687739_rsidrs1175552 2.967828e-02
# chr1_bp3691727_rsidrs1175549 1.566223e-02
# chr1_bp3691434_rsidrs70940313 8.962516e-03
# chr1_bp3691240_rsidrs1184341 2.649970e-03
# chr1_bp3694796_rsidrs1891934 4.497037e-03
# chr1_bp3693909_rsidrs1175546 1.601057e-03
# chr1_bp3697291_rsidrs2996428 7.076501e-04
# chr1_bp3706816_rsidrs149570540 1.152007e-03
# chr1_bp3719890_rsidrs6661554 1.182267e-05
# chr1_bp3718244_rsidrs12120684 1.988198e-04
# chr1_bp3718591_rsidrs113282222 5.881415e-04
# chr1_bp3704041_rsidrs7527973 6.938047e-04
# chr1_bp3711689_rsidrs6667255 2.433844e-04
# chr1_bp3709487_rsidrs7513053 1.579134e-04
#
# $mpp.pp$PP[[2]]
# PP
# chr1_bp3709487_rsidrs7513053 3.413734e-01
# chr1_bp3691528_rsidrs1175550 1.904409e-01
# chr1_bp3691434_rsidrs70940313 1.024995e-01
# chr1_bp3719890_rsidrs6661554 7.527003e-02
# chr1_bp3713746_rsidrs6424052 6.971481e-02
# chr1_bp3684954_rsidrs1181870 5.147635e-02
# chr1_bp3687739_rsidrs1175552 1.139365e-02
# chr1_bp3691240_rsidrs1184341 3.999624e-02
# chr1_bp3704041_rsidrs7527973 1.100342e-02
# chr1_bp3711689_rsidrs6667255 6.817898e-02
# chr1_bp3721609_rsidrs12127399 1.247632e-02
# chr1_bp3697291_rsidrs2996428 4.237263e-03
# chr1_bp3709093_rsidrs61759306 4.312098e-03
# chr1_bp3722830_rsidrs12125964 2.412461e-03
# chr1_bp3723155_rsidrs12125237 4.166272e-03
# chr1_bp3722486_rsidrs6424056 3.527337e-03
# chr1_bp3691727_rsidrs1175549 2.337911e-03
# chr1_bp3694796_rsidrs1891934 1.761245e-03
# chr1_bp3693909_rsidrs1175546 1.165261e-03
# chr1_bp3706816_rsidrs149570540 1.672484e-03
# chr1_bp3683690_rsidrs1181873 9.812805e-06
# chr1_bp3718244_rsidrs12120684 4.014782e-04
# chr1_bp3718591_rsidrs113282222 1.727522e-04
#
# $mpp.pp$PP[[3]]
# PP
# chr1_bp3691528_rsidrs1175550 0.4252065124
# chr1_bp3691727_rsidrs1175549 0.2176701711
# chr1_bp3694796_rsidrs1891934 0.0770320035
# chr1_bp3693909_rsidrs1175546 0.0681866839
# chr1_bp3684954_rsidrs1181870 0.0635163745
# chr1_bp3687739_rsidrs1175552 0.0114188660
# chr1_bp3697291_rsidrs2996428 0.0507882758
# chr1_bp3691434_rsidrs70940313 0.0438767710
# chr1_bp3691240_rsidrs1184341 0.0150490061
# chr1_bp3693755_rsidrs1175547 0.0052522622
# chr1_bp3699568_rsidrs2799185 0.0045480481
# chr1_bp3704041_rsidrs7527973 0.0043959753
# chr1_bp3711689_rsidrs6667255 0.0033721258
# chr1_bp3693032_rsidrs1175548 0.0064066155
# chr1_bp3709487_rsidrs7513053 0.0004917694
# chr1_bp3721609_rsidrs12127399 0.0006968169
# chr1_bp3713746_rsidrs6424052 0.0011248246
# chr1_bp3719890_rsidrs6661554 0.0006059394
# chr1_bp3709093_rsidrs61759306 0.0001669367
# chr1_bp3706816_rsidrs149570540 0.0001940217
#
#
# $mpp.pp$PPg
# $mpp.pp$PPg[[1]]
# PP
# A 0.9980610313
# chr1_bp3706816_rsidrs149570540 0.0011520074
# chr1_bp3718591_rsidrs113282222 0.0005881415
# chr1_bp3718244_rsidrs12120684 0.0001988198
#
# $mpp.pp$PPg[[2]]
# PP
# A 9.833253e-01
# chr1_bp3709093_rsidrs61759306 4.312098e-03
# chr1_bp3723155_rsidrs12125237 4.166272e-03
# chr1_bp3722486_rsidrs6424056 3.527337e-03
# chr1_bp3722830_rsidrs12125964 2.412461e-03
# chr1_bp3706816_rsidrs149570540 1.672484e-03
# chr1_bp3718244_rsidrs12120684 4.014782e-04
# chr1_bp3718591_rsidrs113282222 1.727522e-04
# chr1_bp3683690_rsidrs1181873 9.812805e-06
#
# $mpp.pp$PPg[[3]]
# PP
# A 0.9834321157
# chr1_bp3693032_rsidrs1175548 0.0064066155
# chr1_bp3693755_rsidrs1175547 0.0052522622
# chr1_bp3699568_rsidrs2799185 0.0045480481
# chr1_bp3706816_rsidrs149570540 0.0001940217
# chr1_bp3709093_rsidrs61759306 0.0001669367
#
#
#
# $snpGroups
# $snpGroups$A
# [1] "chr1_bp3687739_rsidrs1175552" "chr1_bp3684954_rsidrs1181870" "chr1_bp3691240_rsidrs1184341"
# [4] "chr1_bp3691528_rsidrs1175550" "chr1_bp3691434_rsidrs70940313" "chr1_bp3693909_rsidrs1175546"
# [7] "chr1_bp3691727_rsidrs1175549" "chr1_bp3694796_rsidrs1891934" "chr1_bp3697291_rsidrs2996428"
# [10] "chr1_bp3709487_rsidrs7513053" "chr1_bp3711689_rsidrs6667255" "chr1_bp3704041_rsidrs7527973"
# [13] "chr1_bp3713746_rsidrs6424052" "chr1_bp3719890_rsidrs6661554" "chr1_bp3721609_rsidrs12127399"
# > all.single.traits.CS99
# $fm
# $fm[[1]]
# SNP MPP
# 1 chr1_bp3691528_rsidrs1175550 0.913583164
# 2 chr1_bp3687739_rsidrs1175552 0.029678276
# 3 chr1_bp3684954_rsidrs1181870 0.019612205
# 4 chr1_bp3691727_rsidrs1175549 0.015662231
# 5 chr1_bp3691434_rsidrs70940313 0.008962516
# 6 chr1_bp3694796_rsidrs1891934 0.004497037
#
# $fm[[2]]
# SNP MPP
# 1 chr1_bp3709487_rsidrs7513053 0.341373417
# 2 chr1_bp3691528_rsidrs1175550 0.190440874
# 3 chr1_bp3691434_rsidrs70940313 0.102499533
# 4 chr1_bp3719890_rsidrs6661554 0.075270028
# 5 chr1_bp3713746_rsidrs6424052 0.069714812
# 6 chr1_bp3711689_rsidrs6667255 0.068178981
# 7 chr1_bp3684954_rsidrs1181870 0.051476350
# 8 chr1_bp3691240_rsidrs1184341 0.039996236
# 9 chr1_bp3721609_rsidrs12127399 0.012476324
# 10 chr1_bp3687739_rsidrs1175552 0.011393654
# 11 chr1_bp3704041_rsidrs7527973 0.011003416
# 12 chr1_bp3709093_rsidrs61759306 0.004312098
# 13 chr1_bp3697291_rsidrs2996428 0.004237263
# 14 chr1_bp3723155_rsidrs12125237 0.004166272
# 15 chr1_bp3722486_rsidrs6424056 0.003527337
#
# $fm[[3]]
# SNP MPP
# 1 chr1_bp3691528_rsidrs1175550 0.425206512
# 2 chr1_bp3691727_rsidrs1175549 0.217670171
# 3 chr1_bp3694796_rsidrs1891934 0.077032003
# 4 chr1_bp3693909_rsidrs1175546 0.068186684
# 5 chr1_bp3684954_rsidrs1181870 0.063516374
# 6 chr1_bp3697291_rsidrs2996428 0.050788276
# 7 chr1_bp3691434_rsidrs70940313 0.043876771
# 8 chr1_bp3691240_rsidrs1184341 0.015049006
# 9 chr1_bp3687739_rsidrs1175552 0.011418866
# 10 chr1_bp3693032_rsidrs1175548 0.006406616
# 11 chr1_bp3693755_rsidrs1175547 0.005252262
# 12 chr1_bp3699568_rsidrs2799185 0.004548048
# 13 chr1_bp3704041_rsidrs7527973 0.004395975
#
#
# $cred
# [1] 0.99
# > multi.trait.results
# $mpp.pp
# $mpp.pp$MPP
# $mpp.pp$MPP[[1]]
# null 52
# chr1_bp3691528_rsidrs1175550 0.920955014 9.965705e-01
# chr1_bp3687739_rsidrs1175552 0.029917755 3.302034e-04
# chr1_bp3684954_rsidrs1181870 0.019770459 1.348791e-03
# chr1_bp3691727_rsidrs1175549 0.015788612 8.428648e-04
# chr1_bp3691434_rsidrs70940313 0.009034836 8.091800e-04
# chr1_bp3694796_rsidrs1891934 0.004533324 9.848764e-05
#
# $mpp.pp$MPP[[2]]
# null 52
# chr1_bp3709487_rsidrs7513053 0.344798439 1.623921e-03
# chr1_bp3691528_rsidrs1175550 0.192351579 9.921420e-01
# chr1_bp3691434_rsidrs70940313 0.103527918 2.316782e-03
# chr1_bp3719890_rsidrs6661554 0.076025217 3.580613e-04
# chr1_bp3713746_rsidrs6424052 0.070414265 3.316350e-04
# chr1_bp3711689_rsidrs6667255 0.068863025 3.243290e-04
# chr1_bp3684954_rsidrs1181870 0.051992816 2.095486e-03
# chr1_bp3691240_rsidrs1184341 0.040397521 3.372677e-04
# chr1_bp3721609_rsidrs12127399 0.012601500 5.935017e-05
# chr1_bp3687739_rsidrs1175552 0.011507968 2.171567e-04
# chr1_bp3704041_rsidrs7527973 0.011113814 6.415724e-05
# chr1_bp3709093_rsidrs61759306 0.004355362 2.051275e-05
# chr1_bp3697291_rsidrs2996428 0.004279776 7.271649e-05
# chr1_bp3723155_rsidrs12125237 0.004208073 1.981906e-05
# chr1_bp3722486_rsidrs6424056 0.003562727 1.677963e-05
#
# $mpp.pp$MPP[[3]]
# null 52
# chr1_bp3691528_rsidrs1175550 0.428054114 9.927908e-01
# chr1_bp3691727_rsidrs1175549 0.219127905 1.769318e-03
# chr1_bp3694796_rsidrs1891934 0.077547886 4.270479e-04
# chr1_bp3693909_rsidrs1175546 0.068643329 3.070270e-04
# chr1_bp3684954_rsidrs1181870 0.063941743 2.097379e-03
# chr1_bp3697291_rsidrs2996428 0.051128404 2.786015e-04
# chr1_bp3691434_rsidrs70940313 0.044170613 1.812382e-03
# chr1_bp3691240_rsidrs1184341 0.015149789 2.073696e-04
# chr1_bp3687739_rsidrs1175552 0.011495338 2.060872e-04
# chr1_bp3693032_rsidrs1175548 0.006449521 2.884733e-05
# chr1_bp3693755_rsidrs1175547 0.005287437 2.364957e-05
# chr1_bp3699568_rsidrs2799185 0.004578506 2.047868e-05
# chr1_bp3704041_rsidrs7527973 0.004425415 3.101323e-05
#
#
# $mpp.pp$MPPg
# $mpp.pp$MPPg[[1]]
# null 52
# A 1 0.9965705
#
# $mpp.pp$MPPg[[2]]
# null 52
# A 0.9878738 0.992142
#
# $mpp.pp$MPPg[[3]]
# null 52
# A 0.9836845 0.9927908
#
#
# $mpp.pp$PP
# $mpp.pp$PP[[1]]
# null 52
# chr1_bp3691528_rsidrs1175550 0.920955014 9.965705e-01
# chr1_bp3687739_rsidrs1175552 0.029917755 3.302034e-04
# chr1_bp3684954_rsidrs1181870 0.019770459 1.348791e-03
# chr1_bp3691727_rsidrs1175549 0.015788612 8.428648e-04
# chr1_bp3691434_rsidrs70940313 0.009034836 8.091800e-04
# chr1_bp3694796_rsidrs1891934 0.004533324 9.848764e-05
#
# $mpp.pp$PP[[2]]
# null 52
# chr1_bp3709487_rsidrs7513053 0.344798439 1.623921e-03
# chr1_bp3691528_rsidrs1175550 0.192351579 9.921420e-01
# chr1_bp3691434_rsidrs70940313 0.103527918 2.316782e-03
# chr1_bp3719890_rsidrs6661554 0.076025217 3.580613e-04
# chr1_bp3713746_rsidrs6424052 0.070414265 3.316350e-04
# chr1_bp3711689_rsidrs6667255 0.068863025 3.243290e-04
# chr1_bp3684954_rsidrs1181870 0.051992816 2.095486e-03
# chr1_bp3691240_rsidrs1184341 0.040397521 3.372677e-04
# chr1_bp3721609_rsidrs12127399 0.012601500 5.935017e-05
# chr1_bp3687739_rsidrs1175552 0.011507968 2.171567e-04
# chr1_bp3704041_rsidrs7527973 0.011113814 6.415724e-05
# chr1_bp3709093_rsidrs61759306 0.004355362 2.051275e-05
# chr1_bp3697291_rsidrs2996428 0.004279776 7.271649e-05
# chr1_bp3723155_rsidrs12125237 0.004208073 1.981906e-05
# chr1_bp3722486_rsidrs6424056 0.003562727 1.677963e-05
#
# $mpp.pp$PP[[3]]
# null 52
# chr1_bp3691528_rsidrs1175550 0.428054114 9.927908e-01
# chr1_bp3691727_rsidrs1175549 0.219127905 1.769318e-03
# chr1_bp3694796_rsidrs1891934 0.077547886 4.270479e-04
# chr1_bp3693909_rsidrs1175546 0.068643329 3.070270e-04
# chr1_bp3684954_rsidrs1181870 0.063941743 2.097379e-03
# chr1_bp3697291_rsidrs2996428 0.051128404 2.786015e-04
# chr1_bp3691434_rsidrs70940313 0.044170613 1.812382e-03
# chr1_bp3691240_rsidrs1184341 0.015149789 2.073696e-04
# chr1_bp3687739_rsidrs1175552 0.011495338 2.060872e-04
# chr1_bp3693032_rsidrs1175548 0.006449521 2.884733e-05
# chr1_bp3693755_rsidrs1175547 0.005287437 2.364957e-05
# chr1_bp3699568_rsidrs2799185 0.004578506 2.047868e-05
# chr1_bp3704041_rsidrs7527973 0.004425415 3.101323e-05
#
#
# $mpp.pp$PPg
# $mpp.pp$PPg[[1]]
# null 52
# A 1 0.9965705
#
# $mpp.pp$PPg[[2]]
# null 52
# A 0.9878738 0.992142
#
# $mpp.pp$PPg[[3]]
# null 52
# A 0.9836845 0.9927908
#
#
#
# $snpGroups
# $snpGroups$groups.fm
# $snpGroups$groups.fm$A
# [1] "chr1_bp3687739_rsidrs1175552" "chr1_bp3684954_rsidrs1181870" "chr1_bp3691240_rsidrs1184341"
# [4] "chr1_bp3691528_rsidrs1175550" "chr1_bp3691434_rsidrs70940313" "chr1_bp3693909_rsidrs1175546"
# [7] "chr1_bp3691727_rsidrs1175549" "chr1_bp3694796_rsidrs1891934" "chr1_bp3697291_rsidrs2996428"
# [10] "chr1_bp3709487_rsidrs7513053" "chr1_bp3711689_rsidrs6667255" "chr1_bp3704041_rsidrs7527973"
# [13] "chr1_bp3713746_rsidrs6424052" "chr1_bp3719890_rsidrs6661554" "chr1_bp3721609_rsidrs12127399"
#
#
# $snpGroups$groups.flashfm
# $snpGroups$groups.flashfm$A
# [1] "chr1_bp3691528_rsidrs1175550"
#
#
# $snpGroups$group.sizes
# A
# null 15
# 52 1
# > multi.trait.results.CS99
# $fm
# $fm[[1]]
# SNP MPP
# chr1_bp3691528_rsidrs1175550 chr1_bp3691528_rsidrs1175550 0.920955014
# chr1_bp3687739_rsidrs1175552 chr1_bp3687739_rsidrs1175552 0.029917755
# chr1_bp3684954_rsidrs1181870 chr1_bp3684954_rsidrs1181870 0.019770459
# chr1_bp3691727_rsidrs1175549 chr1_bp3691727_rsidrs1175549 0.015788612
# chr1_bp3691434_rsidrs70940313 chr1_bp3691434_rsidrs70940313 0.009034836
#
# $fm[[2]]
# SNP MPP
# chr1_bp3709487_rsidrs7513053 chr1_bp3709487_rsidrs7513053 0.344798439
# chr1_bp3691528_rsidrs1175550 chr1_bp3691528_rsidrs1175550 0.192351579
# chr1_bp3691434_rsidrs70940313 chr1_bp3691434_rsidrs70940313 0.103527918
# chr1_bp3719890_rsidrs6661554 chr1_bp3719890_rsidrs6661554 0.076025217
# chr1_bp3713746_rsidrs6424052 chr1_bp3713746_rsidrs6424052 0.070414265
# chr1_bp3711689_rsidrs6667255 chr1_bp3711689_rsidrs6667255 0.068863025
# chr1_bp3684954_rsidrs1181870 chr1_bp3684954_rsidrs1181870 0.051992816
# chr1_bp3691240_rsidrs1184341 chr1_bp3691240_rsidrs1184341 0.040397521
# chr1_bp3721609_rsidrs12127399 chr1_bp3721609_rsidrs12127399 0.012601500
# chr1_bp3687739_rsidrs1175552 chr1_bp3687739_rsidrs1175552 0.011507968
# chr1_bp3704041_rsidrs7527973 chr1_bp3704041_rsidrs7527973 0.011113814
# chr1_bp3709093_rsidrs61759306 chr1_bp3709093_rsidrs61759306 0.004355362
# chr1_bp3697291_rsidrs2996428 chr1_bp3697291_rsidrs2996428 0.004279776
#
# $fm[[3]]
# SNP MPP
# chr1_bp3691528_rsidrs1175550 chr1_bp3691528_rsidrs1175550 0.428054114
# chr1_bp3691727_rsidrs1175549 chr1_bp3691727_rsidrs1175549 0.219127905
# chr1_bp3694796_rsidrs1891934 chr1_bp3694796_rsidrs1891934 0.077547886
# chr1_bp3693909_rsidrs1175546 chr1_bp3693909_rsidrs1175546 0.068643329
# chr1_bp3684954_rsidrs1181870 chr1_bp3684954_rsidrs1181870 0.063941743
# chr1_bp3697291_rsidrs2996428 chr1_bp3697291_rsidrs2996428 0.051128404
# chr1_bp3691434_rsidrs70940313 chr1_bp3691434_rsidrs70940313 0.044170613
# chr1_bp3691240_rsidrs1184341 chr1_bp3691240_rsidrs1184341 0.015149789
# chr1_bp3687739_rsidrs1175552 chr1_bp3687739_rsidrs1175552 0.011495338
# chr1_bp3693032_rsidrs1175548 chr1_bp3693032_rsidrs1175548 0.006449521
# chr1_bp3693755_rsidrs1175547 chr1_bp3693755_rsidrs1175547 0.005287437
#
#
# $flashfm
# $flashfm[[1]]
# SNP MPP
# 1 chr1_bp3691528_rsidrs1175550 0.9965705
#
# $flashfm[[2]]
# SNP MPP
# 1 chr1_bp3691528_rsidrs1175550 0.992142
#
# $flashfm[[3]]
# SNP MPP
# 1 chr1_bp3691528_rsidrs1175550 0.9927908
#
#
# $cred
# [1] 0.99