Last updated: 2021-09-13

Checks: 7 0

Knit directory: ctwas_applied/

This reproducible R Markdown analysis was created with workflowr (version 1.6.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20210726) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 72c8ef7. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


working directory clean

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/ukb-d-30010_irnt_Cells_EBV-transformed_lymphocytes_known.Rmd) and HTML (docs/ukb-d-30010_irnt_Cells_EBV-transformed_lymphocytes_known.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd 72c8ef7 wesleycrouse 2021-09-13 changing mart for biomart
Rmd a49c40e wesleycrouse 2021-09-13 updating with bystander analysis
html 7e22565 wesleycrouse 2021-09-13 updating reports
Rmd 3a7fbc1 wesleycrouse 2021-09-08 generating reports for known annotations
html 3a7fbc1 wesleycrouse 2021-09-08 generating reports for known annotations
Rmd cbf7408 wesleycrouse 2021-09-08 adding enrichment to reports

Overview

These are the results of a ctwas analysis of the UK Biobank trait Red blood cell (erythrocyte) count using Cells_EBV-transformed_lymphocytes gene weights.

The GWAS was conducted by the Neale Lab, and the biomarker traits we analyzed are discussed here. Summary statistics were obtained from IEU OpenGWAS using GWAS ID: ukb-d-30010_irnt. Results were obtained from from IEU rather than Neale Lab because they are in a standardard format (GWAS VCF). Note that 3 of the 34 biomarker traits were not available from IEU and were excluded from analysis.

The weights are mashr GTEx v8 models on Cells_EBV-transformed_lymphocytes eQTL obtained from PredictDB. We performed a full harmonization of the variants, including recovering strand ambiguous variants. This procedure is discussed in a separate document. (TO-DO: add report that describes harmonization)

LD matrices were computed from a 10% subset of Neale lab subjects. Subjects were matched using the plate and well information from genotyping. We included only biallelic variants with MAF>0.01 in the original Neale Lab GWAS. (TO-DO: add more details [number of subjects, variants, etc])

Weight QC

TO-DO: add enhanced QC reporting (total number of weights, why each variant was missing for all genes)

qclist_all <- list()

qc_files <- paste0(results_dir, "/", list.files(results_dir, pattern="exprqc.Rd"))

for (i in 1:length(qc_files)){
  load(qc_files[i])
  chr <- unlist(strsplit(rev(unlist(strsplit(qc_files[i], "_")))[1], "[.]"))[1]
  qclist_all[[chr]] <- cbind(do.call(rbind, lapply(qclist,unlist)), as.numeric(substring(chr,4)))
}

qclist_all <- data.frame(do.call(rbind, qclist_all))
colnames(qclist_all)[ncol(qclist_all)] <- "chr"

rm(qclist, wgtlist, z_gene_chr)

#number of imputed weights
nrow(qclist_all)
[1] 10542
#number of imputed weights by chromosome
table(qclist_all$chr)

   1    2    3    4    5    6    7    8    9   10   11   12   13   14   15 
1060  714  603  380  468  626  514  378  386  418  621  606  198  357  355 
  16   17   18   19   20   21   22 
 481  665  163  850  307  106  286 
#proportion of imputed weights without missing variants
mean(qclist_all$nmiss==0)
[1] 0.8357048

Load ctwas results

#load ctwas results
ctwas_res <- data.table::fread(paste0(results_dir, "/", analysis_id, "_ctwas.susieIrss.txt"))

#make unique identifier for regions
ctwas_res$region_tag <- paste(ctwas_res$region_tag1, ctwas_res$region_tag2, sep="_")

#load z scores for SNPs and collect sample size
load(paste0(results_dir, "/", analysis_id, "_expr_z_snp.Rd"))

sample_size <- z_snp$ss
sample_size <- as.numeric(names(which.max(table(sample_size))))

#compute PVE for each gene/SNP
ctwas_res$PVE = ctwas_res$susie_pip*ctwas_res$mu2/sample_size

#separate gene and SNP results
ctwas_gene_res <- ctwas_res[ctwas_res$type == "gene", ]
ctwas_gene_res <- data.frame(ctwas_gene_res)
ctwas_snp_res <- ctwas_res[ctwas_res$type == "SNP", ]
ctwas_snp_res <- data.frame(ctwas_snp_res)

#add gene information to results
sqlite <- RSQLite::dbDriver("SQLite")
db = RSQLite::dbConnect(sqlite, paste0("/project2/compbio/predictdb/mashr_models/mashr_", weight, ".db"))
query <- function(...) RSQLite::dbGetQuery(db, ...)
gene_info <- query("select gene, genename from extra")
gene_info <- query("select gene, genename, gene_type from extra")
RSQLite::dbDisconnect(db)

ctwas_gene_res <- cbind(ctwas_gene_res, gene_info[sapply(ctwas_gene_res$id, match, gene_info$gene), c("genename", "gene_type")])

#add z scores to results
load(paste0(results_dir, "/", analysis_id, "_expr_z_gene.Rd"))
ctwas_gene_res$z <- z_gene[ctwas_gene_res$id,]$z

z_snp <- z_snp[z_snp$id %in% ctwas_snp_res$id,]
ctwas_snp_res$z <- z_snp$z[match(ctwas_snp_res$id, z_snp$id)]

#formatting and rounding for tables
ctwas_gene_res$z <- round(ctwas_gene_res$z,2)
ctwas_snp_res$z <- round(ctwas_snp_res$z,2)
ctwas_gene_res$susie_pip <- round(ctwas_gene_res$susie_pip,3)
ctwas_snp_res$susie_pip <- round(ctwas_snp_res$susie_pip,3)
ctwas_gene_res$mu2 <- round(ctwas_gene_res$mu2,2)
ctwas_snp_res$mu2 <- round(ctwas_snp_res$mu2,2)
ctwas_gene_res$PVE <- signif(ctwas_gene_res$PVE, 2)
ctwas_snp_res$PVE <- signif(ctwas_snp_res$PVE, 2)

#merge gene and snp results with added information
ctwas_snp_res$genename=NA
ctwas_snp_res$gene_type=NA

ctwas_res <- rbind(ctwas_gene_res,
                   ctwas_snp_res[,colnames(ctwas_gene_res)])

#store columns to report
report_cols <- colnames(ctwas_gene_res)[!(colnames(ctwas_gene_res) %in% c("type", "region_tag1", "region_tag2", "cs_index", "gene_type", "z_flag", "id", "chrom", "pos"))]
first_cols <- c("genename", "region_tag")
report_cols <- c(first_cols, report_cols[!(report_cols %in% first_cols)])

report_cols_snps <- c("id", report_cols[-1])

#get number of SNPs from s1 results; adjust for thin
ctwas_res_s1 <- data.table::fread(paste0(results_dir, "/", analysis_id, "_ctwas.s1.susieIrss.txt"))
n_snps <- sum(ctwas_res_s1$type=="SNP")/thin
rm(ctwas_res_s1)

Check convergence of parameters

library(ggplot2)
library(cowplot)

********************************************************
Note: As of version 1.0.0, cowplot does not change the
  default ggplot2 theme anymore. To recover the previous
  behavior, execute:
  theme_set(theme_cowplot())
********************************************************
load(paste0(results_dir, "/", analysis_id, "_ctwas.s2.susieIrssres.Rd"))
  
df <- data.frame(niter = rep(1:ncol(group_prior_rec), 2),
                 value = c(group_prior_rec[1,], group_prior_rec[2,]),
                 group = rep(c("Gene", "SNP"), each = ncol(group_prior_rec)))
df$group <- as.factor(df$group)

df$value[df$group=="SNP"] <- df$value[df$group=="SNP"]*thin #adjust parameter to account for thin argument

p_pi <- ggplot(df, aes(x=niter, y=value, group=group)) +
  geom_line(aes(color=group)) +
  geom_point(aes(color=group)) +
  xlab("Iteration") + ylab(bquote(pi)) +
  ggtitle("Prior mean") +
  theme_cowplot()

df <- data.frame(niter = rep(1:ncol(group_prior_var_rec), 2),
                 value = c(group_prior_var_rec[1,], group_prior_var_rec[2,]),
                 group = rep(c("Gene", "SNP"), each = ncol(group_prior_var_rec)))
df$group <- as.factor(df$group)
p_sigma2 <- ggplot(df, aes(x=niter, y=value, group=group)) +
  geom_line(aes(color=group)) +
  geom_point(aes(color=group)) +
  xlab("Iteration") + ylab(bquote(sigma^2)) +
  ggtitle("Prior variance") +
  theme_cowplot()

plot_grid(p_pi, p_sigma2)

Version Author Date
3a7fbc1 wesleycrouse 2021-09-08
#estimated group prior
estimated_group_prior <- group_prior_rec[,ncol(group_prior_rec)]
names(estimated_group_prior) <- c("gene", "snp")
estimated_group_prior["snp"] <- estimated_group_prior["snp"]*thin #adjust parameter to account for thin argument
print(estimated_group_prior)
        gene          snp 
0.0179135205 0.0002131108 
#estimated group prior variance
estimated_group_prior_var <- group_prior_var_rec[,ncol(group_prior_var_rec)]
names(estimated_group_prior_var) <- c("gene", "snp")
print(estimated_group_prior_var)
    gene      snp 
23.44062 23.28752 
#report sample size
print(sample_size)
[1] 350475
#report group size
group_size <- c(nrow(ctwas_gene_res), n_snps)
print(group_size)
[1]   10542 8696600
#estimated group PVE
estimated_group_pve <- estimated_group_prior_var*estimated_group_prior*group_size/sample_size #check PVE calculation
names(estimated_group_pve) <- c("gene", "snp")
print(estimated_group_pve)
      gene        snp 
0.01263037 0.12314626 
#compare sum(PIP*mu2/sample_size) with above PVE calculation
c(sum(ctwas_gene_res$PVE),sum(ctwas_snp_res$PVE))
[1] 0.03590177 2.76236203

Genes with highest PIPs

#distribution of PIPs
hist(ctwas_gene_res$susie_pip, xlim=c(0,1), main="Distribution of Gene PIPs")

Version Author Date
3a7fbc1 wesleycrouse 2021-09-08
#genes with PIP>0.8 or 20 highest PIPs
head(ctwas_gene_res[order(-ctwas_gene_res$susie_pip),report_cols], max(sum(ctwas_gene_res$susie_pip>0.8), 20))
     genename region_tag susie_pip    mu2     PVE      z
5498    CNIH4      1_114     1.000  37.30 1.1e-04  -6.70
1914    DOT1L       19_3     0.999 163.55 4.7e-04  11.68
9703  ZSCAN23       6_22     0.997  52.28 1.5e-04  -5.29
4293    OSER1      20_28     0.993  30.25 8.6e-05  -5.54
5336     SAE1      19_33     0.991  57.27 1.6e-04   8.58
282      TYMP      22_24     0.990  67.67 1.9e-04 -12.53
1716    GDPD3      16_24     0.989 201.56 5.7e-04  16.34
8822    ODF3B      22_24     0.988 247.80 7.0e-04 -20.20
6470 C12orf43      12_74     0.983  33.50 9.4e-05  -6.42
2603    ASF1A       6_79     0.982  36.26 1.0e-04   5.85
4151    TRAF3      14_54     0.978  30.86 8.6e-05   5.04
6818  RPS6KA4      11_36     0.973  30.01 8.3e-05  -4.78
1247   ZC3HC1       7_79     0.965  27.70 7.6e-05   4.69
1361   MARCH2       19_8     0.964  25.70 7.1e-05  -4.14
6112  ZFP36L2       2_27     0.963  40.60 1.1e-04   6.07
1386  SMARCB1       22_7     0.957  34.60 9.4e-05  -5.71
9716    WNT7B      22_20     0.950 128.41 3.5e-04 -12.33
9341 HIST1H1B       6_21     0.949  84.76 2.3e-04  -7.34
4063     LSM4      19_15     0.944  67.67 1.8e-04  -8.24
7826    SNTB2      16_37     0.939  26.52 7.1e-05  -4.52
7101     GNL3       3_36     0.926  65.99 1.7e-04   8.56
3458   NT5C3A       7_25     0.917  40.81 1.1e-04   6.43
1076  B4GALT1       9_25     0.896  26.69 6.8e-05   5.03
8223   ZNF217      20_31     0.895  34.62 8.8e-05   5.77
920    TNRC6C      17_43     0.884  33.45 8.4e-05   4.56
1585    PCIF1      20_28     0.880  45.59 1.1e-04  -7.07
7256     CDK5       7_94     0.879  65.12 1.6e-04   8.36
7254     NOS3       7_93     0.873  25.27 6.3e-05  -5.09
8249     TEFM      17_18     0.863  24.65 6.1e-05  -4.56
8707    RUFY1      5_108     0.862  19.69 4.8e-05   3.99
4177   NDFIP1       5_84     0.845  28.47 6.9e-05   4.97
6766     NAGS      17_26     0.840  22.72 5.4e-05  -4.39
7036  C4orf36       4_59     0.839  24.86 6.0e-05  -5.08
2531   CDKN1B      12_12     0.830  21.94 5.2e-05  -4.33
1713   ZNF629      16_24     0.825  53.94 1.3e-04   3.67

Genes with largest effect sizes

#plot PIP vs effect size
plot(ctwas_gene_res$susie_pip, ctwas_gene_res$mu2, xlab="PIP", ylab="mu^2", main="Gene PIPs vs Effect Size")

Version Author Date
3a7fbc1 wesleycrouse 2021-09-08
#genes with 20 largest effect sizes
head(ctwas_gene_res[order(-ctwas_gene_res$mu2),report_cols],20)
            genename region_tag susie_pip      mu2     PVE     z
156            SPRTN      1_118     0.000 48573.83 0.0e+00 -7.55
5349           RPS11      19_34     0.000 14321.38 0.0e+00 -5.40
10928  RP11-258F22.1      10_28     0.000 13420.71 0.0e+00  4.06
3052           TSNAX      1_118     0.000  8562.46 0.0e+00  0.62
1907           FCGRT      19_34     0.000  7694.78 0.0e+00  5.87
4578            AHI1       6_89     0.000  7344.77 0.0e+00  3.54
5353            RCN3      19_34     0.000  5592.29 0.0e+00 -5.12
10583          LIN52      14_34     0.000  5372.72 0.0e+00 -5.02
6917           DISC1      1_118     0.000  4111.38 0.0e+00 -2.12
6421            SYN2        3_9     0.000  3945.52 0.0e+00 -0.18
3774           PRRG2      19_34     0.000  3943.53 0.0e+00 -7.54
12104 RP11-508N22.12      10_28     0.000  3696.97 0.0e+00  2.45
2658           HBS1L       6_89     0.000  3488.61 0.0e+00 49.02
5136           PTGR2      14_34     0.000  2635.33 0.0e+00  0.86
395            USP28      11_67     0.000  2560.34 3.9e-14  4.07
10955      LINC01624      6_112     0.351  2551.67 2.6e-03 -5.09
10682         PPP1CB       2_17     0.000  2399.67 9.0e-07 -5.53
5350          RPL13A      19_34     0.000  1722.16 0.0e+00  2.32
9641          HEATR4      14_34     0.000  1610.15 0.0e+00 -1.33
8104         TRMT61B       2_17     0.000  1566.98 0.0e+00  5.28

Genes with highest PVE

#genes with 20 highest pve
head(ctwas_gene_res[order(-ctwas_gene_res$PVE),report_cols],20)
           genename region_tag susie_pip     mu2     PVE      z
10955     LINC01624      6_112     0.351 2551.67 0.00260  -5.09
8822          ODF3B      22_24     0.988  247.80 0.00070 -20.20
1716          GDPD3      16_24     0.989  201.56 0.00057  16.34
1914          DOT1L       19_3     0.999  163.55 0.00047  11.68
9716          WNT7B      22_20     0.950  128.41 0.00035 -12.33
8901         ZBTB7A       19_4     0.626  158.59 0.00028  13.56
753            TFRC      3_120     0.603  131.68 0.00023  14.74
9341       HIST1H1B       6_21     0.949   84.76 0.00023  -7.34
8667         SMIM19       8_37     0.716   98.80 0.00020 -10.91
282            TYMP      22_24     0.990   67.67 0.00019 -12.53
4063           LSM4      19_15     0.944   67.67 0.00018  -8.24
10577         CPT1B      22_24     0.674   92.52 0.00018 -14.25
7877          RGS14      5_106     0.789   77.24 0.00017   9.28
7882          THBS3       1_76     0.498  122.78 0.00017 -10.94
8372           MTX1       1_76     0.498  122.78 0.00017 -10.94
7101           GNL3       3_36     0.926   65.99 0.00017   8.56
9295          TRAIP       3_35     0.768   72.24 0.00016   8.40
7256           CDK5       7_94     0.879   65.12 0.00016   8.36
1356         SETD1A      16_24     0.396  145.96 0.00016 -10.46
12223 RP11-1072A3.4      16_24     0.396  145.96 0.00016  10.46

Genes with largest z scores

#genes with 20 largest z scores
head(ctwas_gene_res[order(-abs(ctwas_gene_res$z)),report_cols],20)
      genename region_tag susie_pip     mu2     PVE      z
2658     HBS1L       6_89     0.000 3488.61 0.0e+00  49.02
2129      TFR2       7_62     0.000  373.50 6.5e-15 -26.84
2672      BYSL       6_32     0.001  326.66 6.6e-07  21.11
3617     MED20       6_32     0.000  358.95 9.6e-16 -20.44
8822     ODF3B      22_24     0.988  247.80 7.0e-04 -20.20
2130    MOSPD3       7_62     0.000  168.18 4.9e-15 -19.90
3176   ALDH8A1       6_89     0.000 1524.42 2.6e-17  18.68
2289      WNT3      17_27     0.000  293.15 1.9e-08  17.97
6776     SYCE2      19_10     0.001  227.46 4.6e-07  17.96
8921     FARSA      19_10     0.001  222.05 4.4e-07 -17.64
8930      CALR      19_10     0.001  218.75 4.3e-07  17.54
6573  ARHGAP27      17_27     0.000  278.26 7.6e-09 -17.36
2131    PCOLCE       7_62     0.000  146.70 1.4e-12 -17.15
4057      SCO2      22_24     0.005  204.81 2.9e-06  16.54
1716     GDPD3      16_24     0.989  201.56 5.7e-04  16.34
8275      GNB2       7_62     0.000  273.03 1.1e-09 -15.77
12324 PRICKLE4       6_32     0.000  260.57 2.0e-15  14.76
753       TFRC      3_120     0.603  131.68 2.3e-04  14.74
10987   ARL17B      17_27     0.000  126.94 1.1e-07  14.65
10577    CPT1B      22_24     0.674   92.52 1.8e-04 -14.25

Comparing z scores and PIPs

#set nominal signifiance threshold for z scores
alpha <- 0.05

#bonferroni adjusted threshold for z scores
sig_thresh <- qnorm(1-(alpha/nrow(ctwas_gene_res)/2), lower=T)

#Q-Q plot for z scores
obs_z <- ctwas_gene_res$z[order(ctwas_gene_res$z)]
exp_z <- qnorm((1:nrow(ctwas_gene_res))/nrow(ctwas_gene_res))

plot(exp_z, obs_z, xlab="Expected z", ylab="Observed z", main="Gene z score Q-Q plot")
abline(a=0,b=1)

Version Author Date
3a7fbc1 wesleycrouse 2021-09-08
#plot z score vs PIP
plot(abs(ctwas_gene_res$z), ctwas_gene_res$susie_pip, xlab="abs(z)", ylab="PIP")
abline(v=sig_thresh, col="red", lty=2)

Version Author Date
3a7fbc1 wesleycrouse 2021-09-08
#proportion of significant z scores
mean(abs(ctwas_gene_res$z) > sig_thresh)
[1] 0.04344527
#genes with most significant z scores
head(ctwas_gene_res[order(-abs(ctwas_gene_res$z)),report_cols],20)
      genename region_tag susie_pip     mu2     PVE      z
2658     HBS1L       6_89     0.000 3488.61 0.0e+00  49.02
2129      TFR2       7_62     0.000  373.50 6.5e-15 -26.84
2672      BYSL       6_32     0.001  326.66 6.6e-07  21.11
3617     MED20       6_32     0.000  358.95 9.6e-16 -20.44
8822     ODF3B      22_24     0.988  247.80 7.0e-04 -20.20
2130    MOSPD3       7_62     0.000  168.18 4.9e-15 -19.90
3176   ALDH8A1       6_89     0.000 1524.42 2.6e-17  18.68
2289      WNT3      17_27     0.000  293.15 1.9e-08  17.97
6776     SYCE2      19_10     0.001  227.46 4.6e-07  17.96
8921     FARSA      19_10     0.001  222.05 4.4e-07 -17.64
8930      CALR      19_10     0.001  218.75 4.3e-07  17.54
6573  ARHGAP27      17_27     0.000  278.26 7.6e-09 -17.36
2131    PCOLCE       7_62     0.000  146.70 1.4e-12 -17.15
4057      SCO2      22_24     0.005  204.81 2.9e-06  16.54
1716     GDPD3      16_24     0.989  201.56 5.7e-04  16.34
8275      GNB2       7_62     0.000  273.03 1.1e-09 -15.77
12324 PRICKLE4       6_32     0.000  260.57 2.0e-15  14.76
753       TFRC      3_120     0.603  131.68 2.3e-04  14.74
10987   ARL17B      17_27     0.000  126.94 1.1e-07  14.65
10577    CPT1B      22_24     0.674   92.52 1.8e-04 -14.25

Locus plots for genes and SNPs

ctwas_gene_res_sortz <- ctwas_gene_res[order(-abs(ctwas_gene_res$z)),]

n_plots <- 5
for (region_tag_plot in head(unique(ctwas_gene_res_sortz$region_tag), n_plots)){
  ctwas_res_region <-  ctwas_res[ctwas_res$region_tag==region_tag_plot,]
  start <- min(ctwas_res_region$pos)
  end <- max(ctwas_res_region$pos)
  
  ctwas_res_region <- ctwas_res_region[order(ctwas_res_region$pos),]
  ctwas_res_region_gene <- ctwas_res_region[ctwas_res_region$type=="gene",]
  ctwas_res_region_snp <- ctwas_res_region[ctwas_res_region$type=="SNP",]
  
  #region name
  print(paste0("Region: ", region_tag_plot))
  
  #table of genes in region
  print(ctwas_res_region_gene[,report_cols])
  
  par(mfrow=c(4,1))
  
  #gene z scores
  plot(ctwas_res_region_gene$pos, abs(ctwas_res_region_gene$z), xlab="Position", ylab="abs(gene_z)", xlim=c(start,end),
   ylim=c(0,max(sig_thresh, abs(ctwas_res_region_gene$z))),
   main=paste0("Region: ", region_tag_plot))
  abline(h=sig_thresh,col="red",lty=2)
  
  #significance threshold for SNPs
  alpha_snp <- 5*10^(-8)
  sig_thresh_snp <- qnorm(1-alpha_snp/2, lower=T)
  
  #snp z scores
  plot(ctwas_res_region_snp$pos, abs(ctwas_res_region_snp$z), xlab="Position", ylab="abs(snp_z)",xlim=c(start,end),
   ylim=c(0,max(sig_thresh_snp, max(abs(ctwas_res_region_snp$z)))))
  abline(h=sig_thresh_snp,col="purple",lty=2)
  
  #gene pips
  plot(ctwas_res_region_gene$pos, ctwas_res_region_gene$susie_pip, xlab="Position", ylab="Gene PIP", xlim=c(start,end), ylim=c(0,1))
  abline(h=0.8,col="blue",lty=2)
  
  #snp pips
  plot(ctwas_res_region_snp$pos, ctwas_res_region_snp$susie_pip, xlab="Position", ylab="SNP PIP", xlim=c(start,end), ylim=c(0,1))
  abline(h=0.8,col="blue",lty=2)
}
[1] "Region: 6_89"
     genename region_tag susie_pip     mu2     PVE     z
299     TBPL1       6_89         0   13.64 0.0e+00 -1.12
3176  ALDH8A1       6_89         0 1524.42 2.6e-17 18.68
2658    HBS1L       6_89         0 3488.61 0.0e+00 49.02
4578     AHI1       6_89         0 7344.77 0.0e+00  3.54

Version Author Date
3a7fbc1 wesleycrouse 2021-09-08
[1] "Region: 7_62"
     genename region_tag susie_pip    mu2     PVE      z
2131   PCOLCE       7_62         0 146.70 1.4e-12 -17.15
2130   MOSPD3       7_62         0 168.18 4.9e-15 -19.90
2129     TFR2       7_62         0 373.50 6.5e-15 -26.84
8275     GNB2       7_62         0 273.03 1.1e-09 -15.77
5749   GIGYF1       7_62         0 158.48 5.9e-13  10.55
8269     POP7       7_62         0 160.73 6.9e-12  12.04
5748  SLC12A9       7_62         0  25.89 6.9e-16 -12.67
9926    EPHB4       7_62         0  25.89 6.9e-16 -12.67
1095    TRIP6       7_62         0  27.05 8.4e-16   5.77
1097     SRRT       7_62         0  27.67 6.9e-15  -2.65
8659    UFSP1       7_62         0  33.30 1.9e-15   8.29
1096     ACHE       7_62         0  37.70 2.8e-15   3.27
7947   TRIM56       7_62         0  43.86 2.2e-13  -2.57
2138 SERPINE1       7_62         0  44.83 1.8e-13  -3.89
2139    AP1S1       7_62         0   6.90 1.5e-16   1.98
2143   CLDN15       7_62         0  21.37 6.3e-15   0.19
3908    IFT22       7_62         0  10.20 6.5e-16   2.01

Version Author Date
3a7fbc1 wesleycrouse 2021-09-08
[1] "Region: 6_32"
            genename region_tag susie_pip    mu2     PVE      z
3622         APOBEC2       6_32     0.000  12.74 3.0e-18   0.96
2636          TREML2       6_32     0.000   4.96 4.7e-19   0.27
1325            NCR2       6_32     0.000   8.25 1.1e-18   0.75
4793           FOXP4       6_32     0.000  23.09 1.4e-17   0.45
2671            TFEB       6_32     0.000  81.39 7.7e-16   4.15
3611  RP11-298J23.10       6_32     0.000   6.07 6.9e-19   0.77
12324       PRICKLE4       6_32     0.000 260.57 2.0e-15  14.76
4803            FRS3       6_32     0.000 123.16 3.7e-15  -1.73
10754          TOMM6       6_32     0.000 112.82 1.2e-15  -0.72
7233           USP49       6_32     0.000  27.78 3.1e-18   0.87
3617           MED20       6_32     0.000 358.95 9.6e-16 -20.44
2672            BYSL       6_32     0.001 326.66 6.6e-07  21.11
4825            TAF8       6_32     0.000 152.91 2.8e-12   7.61

Version Author Date
3a7fbc1 wesleycrouse 2021-09-08
[1] "Region: 22_24"
          genename region_tag susie_pip    mu2     PVE      z
10631 RP1-29C18.10      22_24     0.228  23.34 1.5e-05  -4.12
10655  RP1-29C18.9      22_24     0.000   7.84 4.9e-09   1.52
9761      C22orf34      22_24     0.001  12.63 2.0e-08  -2.62
12360  CTA-722E9.1      22_24     0.475  25.18 3.4e-05  -4.36
10940 RP5-983L19.2      22_24     0.000  14.25 1.7e-08   1.83
11703  RP3-522J7.6      22_24     0.000   5.81 2.9e-09  -0.77
1499         ZBED4      22_24     0.000  13.01 1.4e-08   1.66
9322        CRELD2      22_24     0.000   6.65 4.0e-09   0.05
9204         ALG12      22_24     0.023  48.05 3.2e-06  -2.37
1500          MLC1      22_24     0.000   8.67 1.0e-08   0.05
780          PANX2      22_24     0.000  15.76 1.6e-08   1.20
8058         TRABD      22_24     0.005  25.65 3.7e-07  -4.43
781        SELENOO      22_24     0.003  12.56 9.5e-08  -3.84
9722        MAPK12      22_24     0.001  10.23 1.8e-08   1.66
1501        HDAC10      22_24     0.124  27.30 9.7e-06   4.61
9451        MAPK11      22_24     0.000   6.71 4.6e-09   0.83
9955        PLXNB2      22_24     0.000   8.59 5.4e-09   0.06
10580      DENND6B      22_24     0.000   6.37 4.8e-09   0.52
1450          MIOX      22_24     0.000   8.67 7.5e-09   1.40
283         NCAPH2      22_24     0.000  16.19 1.5e-08   0.47
4057          SCO2      22_24     0.005 204.81 2.9e-06  16.54
282           TYMP      22_24     0.990  67.67 1.9e-04 -12.53
8822         ODF3B      22_24     0.988 247.80 7.0e-04 -20.20
12132 CTA-384D8.34      22_24     0.000  59.35 2.8e-08   9.19
12074 CTA-384D8.35      22_24     0.000  60.69 2.9e-08   9.27
4056       KLHDC7B      22_24     0.000  15.35 7.3e-09  -4.62
10577        CPT1B      22_24     0.674  92.52 1.8e-04 -14.25
1457          CHKB      22_24     0.008  54.32 1.3e-06 -10.45
10801        SYCE3      22_24     0.000  16.21 1.6e-08   0.26
1462          ARSA      22_24     0.000   8.83 4.2e-09  -1.15
951         RABL2B      22_24     0.000   9.69 6.3e-09  -2.03

Version Author Date
3a7fbc1 wesleycrouse 2021-09-08
[1] "Region: 17_27"
      genename region_tag susie_pip    mu2     PVE      z
8352     DCAKD      17_27     0.000  42.23 4.6e-09   3.92
9612    HEXIM1      17_27     0.000  23.93 1.7e-10   3.94
9083     ACBD4      17_27     0.000  13.31 1.5e-10  -1.27
9390     FMNL1      17_27     0.000  37.75 1.0e-09  -4.85
6573  ARHGAP27      17_27     0.000 278.26 7.6e-09 -17.36
10890  PLEKHM1      17_27     0.000  11.46 1.4e-10  -0.31
9617      MAPT      17_27     0.000  17.76 3.8e-10   2.56
3292    KANSL1      17_27     0.000 127.02 3.4e-09   9.14
11196 LRRC37A2      17_27     0.015 140.49 5.8e-06 -13.29
8700   LRRC37A      17_27     0.684  38.22 7.5e-05   4.72
10987   ARL17B      17_27     0.000 126.94 1.1e-07  14.65
9513    ARL17A      17_27     0.000  59.95 2.9e-08   2.86
798        NSF      17_27     0.011  42.06 1.3e-06  -0.27
2289      WNT3      17_27     0.000 293.15 1.9e-08  17.97
2298     GOSR2      17_27     0.000  60.07 3.2e-09   8.10
40       CDC27      17_27     0.000  10.66 6.3e-11   2.93
11642    ITGB3      17_27     0.000   6.45 3.3e-11   1.31
8889   EFCAB13      17_27     0.000   6.98 3.5e-11   1.15
5248    NPEPPS      17_27     0.000   9.06 5.2e-11   0.85
2297     KPNB1      17_27     0.000   6.52 5.6e-11   0.43
10357   TBKBP1      17_27     0.008  37.53 9.1e-07   2.20
796      TBX21      17_27     0.000   5.81 3.2e-11   0.72

Version Author Date
3a7fbc1 wesleycrouse 2021-09-08

SNPs with highest PIPs

#snps with PIP>0.8 or 20 highest PIPs
head(ctwas_snp_res[order(-ctwas_snp_res$susie_pip),report_cols_snps],
max(sum(ctwas_snp_res$susie_pip>0.8), 20))
                 id region_tag susie_pip      mu2     PVE      z
19167     rs4655791       1_43     1.000    41.75 1.2e-04  -6.28
49398      rs322933       1_99     1.000   118.81 3.4e-04  -7.46
53650     rs3754140      1_108     1.000   122.73 3.5e-04 -12.18
58263   rs766167074      1_118     1.000 66708.73 1.9e-01   8.67
64417    rs12027924      1_131     1.000    69.61 2.0e-04  -2.03
64423    rs66858280      1_131     1.000   241.81 6.9e-04 -14.00
74241   rs569546056       2_17     1.000  2760.80 7.9e-03   5.27
80307    rs71422190       2_28     1.000   240.73 6.9e-04  18.35
80333    rs10495928       2_28     1.000   360.15 1.0e-03  24.83
85479      rs168565       2_40     1.000    49.46 1.4e-04  -6.52
116695     rs863678      2_106     1.000    73.82 2.1e-04  -9.82
142570    rs3933701       3_12     1.000   115.38 3.3e-04 -10.89
183899    rs9817452       3_97     1.000    34.86 9.9e-05  -5.44
196282    rs9812813      3_120     1.000   135.02 3.9e-04 -10.67
215494  rs145740858       4_39     1.000    90.78 2.6e-04   6.18
215548  rs115306053       4_40     1.000    53.93 1.5e-04  -5.20
215553   rs28651467       4_40     1.000    63.75 1.8e-04  -4.12
230727   rs35518360       4_67     1.000    73.20 2.1e-04  -8.57
230793   rs13140033       4_68     1.000    54.11 1.5e-04  -7.53
231461    rs7699743       4_69     1.000    45.03 1.3e-04   5.79
283275    rs2928169       5_45     1.000    53.52 1.5e-04  -6.79
306512   rs78112077       5_91     1.000    42.09 1.2e-04  -2.84
315753   rs70995354        6_2     1.000  3305.11 9.4e-03  -3.25
315756    rs3929752        6_2     1.000  3301.42 9.4e-03   3.30
324352  rs115740542       6_20     1.000    68.72 2.0e-04   8.77
324754    rs1419642       6_23     1.000    70.06 2.0e-04  -1.74
325145    rs2555469       6_27     1.000    79.56 2.3e-04   5.17
329104    rs3218097       6_32     1.000   725.11 2.1e-03 -29.06
329108    rs9689216       6_32     1.000   173.90 5.0e-04  11.91
329113  rs112233623       6_32     1.000   611.24 1.7e-03  19.90
329146    rs9369327       6_32     1.000    89.21 2.5e-04  -7.59
329581    rs1005230       6_33     1.000    98.66 2.8e-04  10.76
356889  rs113033196       6_89     1.000   416.68 1.2e-03 -32.54
357048  rs199804242       6_89     1.000 33547.37 9.6e-02   5.33
358137     rs590325       6_92     1.000    88.48 2.5e-04  11.89
358147  rs151288714       6_92     1.000   229.13 6.5e-04 -16.83
358154     rs602261       6_93     1.000    61.56 1.8e-04  -5.66
369227   rs13241427        7_2     1.000    56.19 1.6e-04   7.13
384989    rs1990053       7_33     1.000   151.99 4.3e-04  12.87
387000   rs74850530       7_36     1.000    55.26 1.6e-04  -4.11
399245    rs2237572       7_56     1.000    53.75 1.5e-04   6.80
401204  rs141862851       7_61     1.000   167.19 4.8e-04  13.20
401253    rs6465770       7_61     1.000    67.08 1.9e-04   8.20
401281    rs3197597       7_61     1.000   272.65 7.8e-04 -18.46
402351  rs763798411       7_65     1.000 17089.60 4.9e-02   2.68
402354   rs10274607       7_65     1.000 17100.72 4.9e-02  -3.08
402362    rs4997569       7_65     1.000 17107.41 4.9e-02  -2.99
429013   rs17296501       8_23     1.000   108.91 3.1e-04  10.58
466937    rs6415788        9_4     1.000    74.86 2.1e-04   8.96
471292   rs17278406       9_12     1.000   104.11 3.0e-04  10.34
498431   rs11545664       9_66     1.000    38.44 1.1e-04  -6.01
500117  rs115478735       9_70     1.000   478.41 1.4e-03  23.72
515734   rs71007692      10_28     1.000 21116.31 6.0e-02   4.54
517195   rs11239271      10_31     1.000   236.44 6.7e-04  15.84
524830    rs6480402      10_46     1.000   548.25 1.6e-03  -9.16
524850   rs73267649      10_46     1.000   375.84 1.1e-03   5.63
556521  rs369062552      11_21     1.000    80.58 2.3e-04   7.93
556531   rs34830202      11_21     1.000   110.06 3.1e-04 -10.42
581107    rs1176746      11_67     1.000  4570.30 1.3e-02   4.15
581109    rs2307599      11_67     1.000  4571.59 1.3e-02  -3.98
589119   rs35167730       12_2     1.000   143.37 4.1e-04 -12.29
603013    rs1859440      12_30     1.000    73.57 2.1e-04  10.58
604729    rs4326844      12_33     1.000    42.13 1.2e-04  -6.04
614511    rs4842610      12_53     1.000    99.20 2.8e-04  10.30
673539   rs17766755      14_29     1.000    65.67 1.9e-04   7.63
676607    rs7156583      14_34     1.000 47559.82 1.4e-01   2.48
676610  rs369107859      14_34     1.000 47533.73 1.4e-01  -6.40
697476    rs2070895      15_26     1.000    55.70 1.6e-04   7.43
699674   rs11857609      15_30     1.000   110.68 3.2e-04  11.14
701763    rs2955742      15_36     1.000    50.19 1.4e-04   7.04
709666    rs2238368       16_1     1.000   208.04 5.9e-04 -14.88
709694   rs59428751       16_1     1.000   106.43 3.0e-04  11.04
721464   rs62039688      16_27     1.000    80.82 2.3e-04   8.38
721546   rs17616063      16_27     1.000    40.51 1.2e-04   5.42
737391   rs57828851       17_7     1.000    62.90 1.8e-04   8.51
749652   rs11650989      17_36     1.000    82.96 2.4e-04   9.43
773957  rs144596877      18_35     1.000    49.41 1.4e-04   6.99
784312    rs8110787      19_10     1.000   273.04 7.8e-04  20.21
784329  rs111920893      19_10     1.000    86.44 2.5e-04 -10.85
785136  rs146213062      19_12     1.000    56.87 1.6e-04   7.80
790418   rs62126610      19_23     1.000    83.98 2.4e-04   5.89
790419    rs4432367      19_23     1.000   193.91 5.5e-04  -1.58
790422   rs55804555      19_23     1.000   381.59 1.1e-03 -16.11
794444    rs1858742      19_34     1.000 15219.57 4.3e-02  -4.93
794446  rs374141296      19_34     1.000 17177.78 4.9e-02   4.86
794447   rs35443645      19_34     1.000 16984.53 4.8e-02  -5.03
809132   rs73124945      20_24     1.000    40.64 1.2e-04   6.09
812786    rs6099616      20_33     1.000    60.80 1.7e-04   7.80
814581    rs2427539      20_38     1.000    56.16 1.6e-04   5.62
815337    rs2823025       21_2     1.000    46.50 1.3e-04   6.36
821844    rs2834259      21_14     1.000    57.78 1.6e-04  -7.56
822802    rs9981948      21_17     1.000    40.17 1.1e-04  -6.26
847348   rs17534202      1_102     1.000    63.74 1.8e-04  -7.99
860819   rs62160676       2_66     1.000   197.01 5.6e-04  18.60
869563  rs534602560        3_9     1.000 19228.44 5.5e-02   4.05
869640   rs56233336        3_9     1.000 19622.91 5.6e-02  -3.59
889290  rs760400154        5_2     1.000 63316.88 1.8e-01  -5.88
889292  rs563200821        5_2     1.000 63318.42 1.8e-01   6.01
938372   rs17287978       6_34     1.000    92.46 2.6e-04  10.21
938752     rs833805       6_34     1.000   181.64 5.2e-04 -14.51
953682    rs2983226      6_112     1.000 12582.05 3.6e-02   2.75
953692  rs139588569      6_112     1.000 12647.62 3.6e-02  -3.30
964025   rs61739556       7_62     1.000   130.82 3.7e-04  17.14
964139   rs78054447       7_62     1.000    85.87 2.4e-04  11.25
965471  rs147330150       7_62     1.000    88.97 2.5e-04  14.16
977895  rs145700013       7_94     1.000   226.00 6.4e-04   4.79
1018778   rs9549260      13_17     1.000   100.45 2.9e-04 -10.43
1046339  rs67453880      15_31     1.000   698.44 2.0e-03  -4.87
1095978 rs117049004       19_3     1.000    88.75 2.5e-04   0.86
1096102 rs547300749       19_3     1.000   675.12 1.9e-03   2.64
1107120 rs184088518      19_28     1.000   107.57 3.1e-04  10.98
1122606   rs1800961      20_28     1.000    57.13 1.6e-04  -7.74
1137561 rs151305716      20_31     1.000    73.78 2.1e-04   8.75
178939   rs79308158       3_86     0.999   102.58 2.9e-04  12.22
211583   rs10029009       4_32     0.999    45.59 1.3e-04  -6.45
283133   rs10060848       5_45     0.999    40.35 1.2e-04   6.16
329112   rs16895128       6_32     0.999   347.85 9.9e-04  21.91
501365    rs1886296       9_73     0.999    33.24 9.5e-05  -5.48
551661   rs72864006      11_12     0.999    32.86 9.4e-05   4.63
580421   rs10891252      11_66     0.999    41.78 1.2e-04   4.92
733095  rs565911571      16_51     0.999    46.63 1.3e-04   6.74
760571   rs35954636       18_9     0.999    45.55 1.3e-04  -6.06
769205    rs2878889      18_27     0.999    37.20 1.1e-04   6.07
977904    rs2536072       7_94     0.999   124.59 3.6e-04  -4.94
1107128  rs61750953      19_28     0.999    54.98 1.6e-04   6.63
35303    rs76016895       1_73     0.998    51.13 1.5e-04  -7.21
49466    rs74448403      1_100     0.998    31.24 8.9e-05  -4.77
286930     rs244760       5_52     0.998    71.90 2.0e-04   9.82
293638   rs61215818       5_66     0.998    35.92 1.0e-04   6.08
354254   rs10782229       6_84     0.998    41.21 1.2e-04  -3.96
367057    rs1472267      6_108     0.998    31.62 9.0e-05  -5.49
401208    rs3807471       7_61     0.998    60.12 1.7e-04   3.87
530819     rs478839      10_56     0.998    49.38 1.4e-04  -5.72
621804    rs7970581      12_68     0.998    31.68 9.0e-05   5.43
669225    rs2883893      14_20     0.998    48.20 1.4e-04   6.28
692258   rs28714278      15_13     0.998    69.28 2.0e-04   7.92
821931  rs147050753      21_15     0.998    32.24 9.2e-05   5.97
833463    rs9680786      22_18     0.998    52.41 1.5e-04  -6.14
36900   rs138055271       1_78     0.997    31.20 8.9e-05  -4.94
196204     rs406271      3_120     0.997   151.99 4.3e-04 -15.32
354258    rs9388461       6_84     0.997    53.93 1.5e-04   5.16
596453    rs2344157      12_18     0.997    31.34 8.9e-05   5.34
41498     rs9425587       1_84     0.996    35.84 1.0e-04   6.60
53853     rs6673799      1_109     0.996    36.58 1.0e-04   5.63
64751     rs4335411      1_131     0.996    35.07 1.0e-04  -4.96
74244     rs4580350       2_17     0.996  2675.41 7.6e-03   5.25
400967  rs149211972       7_60     0.996    29.85 8.5e-05  -4.94
493936  rs117731582       9_56     0.996    41.65 1.2e-04  -6.48
493995    rs7034523       9_56     0.996    32.96 9.4e-05   5.73
517038    rs3780890      10_31     0.996    36.86 1.0e-04  -6.19
603125  rs567199163      12_30     0.996    43.00 1.2e-04   8.52
793630     rs346738      19_31     0.996    33.44 9.5e-05   6.17
1083827  rs11652522      17_26     0.995    37.17 1.1e-04  -5.85
13330     rs2065944       1_29     0.994    42.51 1.2e-04   7.95
709691    rs1203981       16_1     0.994    69.48 2.0e-04   2.42
1090608   rs2748427      17_43     0.994   130.69 3.7e-04 -13.23
1090624    rs383603      17_43     0.994    52.61 1.5e-04  -8.95
6540       rs603412       1_14     0.993    30.49 8.6e-05   5.25
281184     rs451157       5_41     0.993    41.40 1.2e-04  -6.28
721439   rs11641493      16_27     0.993    30.31 8.6e-05   4.89
937788    rs6905288       6_34     0.993    72.09 2.0e-04  -7.53
53597   rs114775675      1_108     0.992    34.14 9.7e-05  -6.94
100128  rs141849010       2_69     0.992    30.68 8.7e-05  -5.44
317662     rs585312        6_7     0.992    40.50 1.1e-04  -5.80
628171    rs4883568      12_82     0.992    53.65 1.5e-04  -8.51
215549    rs4864911       4_40     0.991    50.13 1.4e-04  -5.46
356892    rs7775698       6_89     0.991  4715.39 1.3e-02  65.30
746125    rs1808192      17_27     0.991    43.85 1.2e-04   4.62
324973    rs3873238       6_23     0.990    37.03 1.0e-04  -6.32
581154   rs17116384      11_67     0.990    77.64 2.2e-04  -7.88
158742   rs13071298       3_48     0.989    58.63 1.7e-04  -7.34
746103    rs8073834      17_27     0.989    40.24 1.1e-04   4.59
317682   rs55792466        6_7     0.988    82.30 2.3e-04  -8.82
746685   rs11658398      17_29     0.988    32.23 9.1e-05  -5.60
12418    rs11589584       1_27     0.987    53.94 1.5e-04  -7.73
13266      rs977747       1_29     0.987    34.65 9.8e-05   6.08
120631   rs62181701      2_112     0.987    30.29 8.5e-05  -5.26
324345     rs707890       6_20     0.987    79.67 2.2e-04  -8.91
494485   rs12375564       9_58     0.987    27.17 7.7e-05   4.23
621274   rs12423752      12_66     0.987    39.24 1.1e-04   6.13
771979   rs62094231      18_31     0.987    31.25 8.8e-05   5.62
145127    rs1667747       3_18     0.986    41.87 1.2e-04  -4.16
550793   rs11022762      11_10     0.986    46.90 1.3e-04  -6.82
734316    rs4547319      16_53     0.986    47.30 1.3e-04  -6.50
322721   rs78381359       6_16     0.985    55.31 1.6e-04  -7.73
685014   rs35604463      14_52     0.985    43.79 1.2e-04  -6.41
67907     rs4669306        2_6     0.984    58.11 1.6e-04   7.59
111746  rs115200150       2_96     0.984    29.62 8.3e-05  -6.06
507268     rs737376      10_12     0.983    37.44 1.1e-04  -5.83
790002    rs9304832      19_22     0.983    31.73 8.9e-05   5.40
964368    rs7778978       7_62     0.983   267.54 7.5e-04 -25.01
144947    rs9819064       3_17     0.982    26.37 7.4e-05   4.82
546095    rs2239681       11_2     0.982    31.05 8.7e-05  -5.48
187968    rs1290790      3_104     0.980    67.60 1.9e-04   7.94
467208   rs10974716        9_5     0.980    33.29 9.3e-05   8.10
524831   rs10998724      10_46     0.980   226.05 6.3e-04   2.57
575184    rs3016490      11_55     0.980    26.65 7.5e-05  -4.83
86517    rs12466865       2_42     0.979    30.95 8.6e-05  -5.38
286934     rs304151       5_52     0.979    60.32 1.7e-04  10.70
726318   rs12708919      16_38     0.979    63.99 1.8e-04  -7.50
793653   rs73036520      19_31     0.979    38.12 1.1e-04  -6.68
812846    rs1328757      20_33     0.979    39.72 1.1e-04  -5.90
910368    rs3864294       6_22     0.979    93.23 2.6e-04   4.91
223408   rs11725113       4_52     0.978    27.35 7.6e-05   3.41
532809   rs11462611      10_61     0.977    51.27 1.4e-04   7.38
80334    rs17034605       2_28     0.975   107.54 3.0e-04  14.01
807255    rs3746615      20_19     0.974    79.40 2.2e-04  -7.95
80281    rs35617557       2_28     0.971    63.22 1.8e-04  -5.58
196279   rs73891224      3_120     0.971    32.10 8.9e-05  -1.84
312320     rs322351      5_103     0.971    29.08 8.1e-05   4.40
730947   rs11862358      16_46     0.971    24.84 6.9e-05  -4.40
152446    rs4974078       3_34     0.970    31.99 8.9e-05  -4.78
84947     rs1641155       2_39     0.969    27.88 7.7e-05  -5.41
467286   rs10815095        9_5     0.969   251.05 6.9e-04 -17.90
701357     rs876383      15_35     0.969    29.12 8.1e-05   5.17
726496   rs34889159      16_38     0.969    40.70 1.1e-04  -6.79
821896    rs4817606      21_15     0.969    28.41 7.9e-05   6.04
37404     rs2494211       1_79     0.967    28.60 7.9e-05   5.05
318449   rs79248374        6_9     0.967    25.48 7.0e-05  -5.00
59465     rs2884425      1_121     0.966    62.84 1.7e-04   6.51
327775    rs4713943       6_29     0.965    32.80 9.0e-05   5.89
369226   rs78148157        7_2     0.965    26.54 7.3e-05  -3.90
623617   rs12830847      12_73     0.964    29.39 8.1e-05  -5.50
621616     rs653178      12_67     0.963   233.05 6.4e-04  17.84
324806    rs1233385       6_23     0.962    88.13 2.4e-04   7.11
784653   rs34438120      19_11     0.962    35.17 9.7e-05  -5.51
34875     rs2236398       1_73     0.961    30.08 8.2e-05  -3.19
451218   rs72671791       8_69     0.961    28.17 7.7e-05  -5.00
123676   rs67409803      2_120     0.960    27.66 7.6e-05  -5.10
182392     rs370612       3_94     0.960    28.25 7.7e-05   5.09
822732    rs8128857      21_16     0.959    31.13 8.5e-05   5.53
400940  rs117645417       7_60     0.958    25.61 7.0e-05  -4.34
215580   rs74995222       4_40     0.957    48.03 1.3e-04   4.77
433752   rs13274178       8_35     0.957    28.21 7.7e-05  -5.02
732940    rs1915035      16_50     0.957    24.94 6.8e-05   4.60
329582   rs28357093       6_33     0.955    33.18 9.0e-05   7.15
729963   rs34252270      16_45     0.955    25.41 6.9e-05  -4.68
602955   rs11608702      12_30     0.954    26.31 7.2e-05  -4.94
734350    rs2608604      16_53     0.954   133.74 3.6e-04  11.87
818519  rs118097076       21_8     0.954    24.72 6.7e-05   4.45
822830    rs9305604      21_17     0.954    28.61 7.8e-05  -5.13
1071358 rs117473347      16_54     0.953    50.89 1.4e-04   6.60
306478   rs74417235       5_91     0.950    36.14 9.8e-05   7.30
692257   rs11853517      15_13     0.949    31.76 8.6e-05  -4.37
17058     rs2261980       1_38     0.948    25.20 6.8e-05   4.63
338791  rs144917451       6_51     0.947    26.89 7.3e-05   4.95
366385    rs4709820      6_107     0.947   164.18 4.4e-04 -12.14
49427   rs567188561       1_99     0.943    36.11 9.7e-05  -7.72
705362    rs2518967      15_42     0.942    25.39 6.8e-05   4.79
319406    rs7453037       6_11     0.939    26.84 7.2e-05   4.97
583667     rs497879      11_74     0.938    25.24 6.8e-05  -4.66
50614     rs4617466      1_103     0.936    30.86 8.2e-05  -5.19
358954   rs13208190       6_94     0.936    27.51 7.3e-05  -4.94
565266  rs546240759      11_34     0.936    36.63 9.8e-05  -7.62
624827    rs4765552      12_75     0.934    28.88 7.7e-05   4.73
312687    rs2594836      5_104     0.933    33.59 8.9e-05   4.37
430648   rs34795012       8_27     0.932    32.87 8.7e-05   5.41
22183    rs12134068       1_48     0.931    26.51 7.0e-05  -4.74
120956  rs192394817      2_113     0.927    24.88 6.6e-05  -4.89
709663    rs2238366       16_1     0.925    35.95 9.5e-05  -4.67
850     rs111652194        1_2     0.924    26.67 7.0e-05  -4.80
451729    rs2570952       8_69     0.924    31.23 8.2e-05   5.26
312725     rs189650      5_104     0.923    44.30 1.2e-04  -6.00
33323    rs60897900       1_71     0.920    40.05 1.1e-04   5.69
539479    rs1925282      10_73     0.920    25.95 6.8e-05   4.73
990537   rs11245982       11_1     0.920    42.89 1.1e-04  -5.83
80422    rs11539645       2_29     0.919    24.88 6.5e-05  -4.73
580464    rs1123066      11_66     0.918    42.98 1.1e-04  -5.39
919142    rs2429657       6_25     0.916   100.16 2.6e-04 -10.16
742073    rs1023682      17_17     0.913    26.66 6.9e-05  -2.96
107671   rs10201197       2_86     0.912    44.75 1.2e-04  -6.93
110964   rs78236918       2_94     0.912    25.11 6.5e-05   4.57
12986     rs1768808       1_28     0.911    86.23 2.2e-04  12.55
1048625  rs11631859      15_37     0.910    35.22 9.1e-05  -6.53
830287    rs9609565      22_12     0.909    62.83 1.6e-04 -10.53
1037615  rs12885878      14_54     0.909    42.62 1.1e-04  -6.85
244003   rs13106087       4_94     0.907    25.80 6.7e-05   4.61
583806    rs1945397      11_75     0.907    27.50 7.1e-05   4.90
627936   rs57565032      12_81     0.907    27.35 7.1e-05   4.90
320657    rs7767676       6_13     0.906    57.12 1.5e-04  -7.53
145143   rs12632081       3_18     0.905    64.09 1.7e-04   5.66
811565    rs2072241      20_32     0.904    29.01 7.5e-05   4.90
1148588  rs35042034      21_18     0.901    49.80 1.3e-04   7.85
128661  rs115997322      2_129     0.898    27.54 7.1e-05   5.63
358155  rs113883411       6_93     0.898    82.88 2.1e-04   7.54
684588    rs7159884      14_51     0.898    29.44 7.5e-05   5.18
80581     rs2166475       2_29     0.896    41.23 1.1e-04  -5.90
41833   rs144869587       1_85     0.893    36.88 9.4e-05   6.18
323940  rs145151542       6_19     0.892    24.89 6.3e-05   3.87
589638     rs594088       12_4     0.891    25.31 6.4e-05   4.58
501858  rs113790047       10_2     0.890    32.55 8.3e-05   5.51
409024    rs9649546       7_80     0.889    26.65 6.8e-05   4.86
467343    rs6476934        9_6     0.889    25.57 6.5e-05   4.86
293651   rs62371569       5_66     0.887    25.33 6.4e-05  -4.80
100471   rs35883727       2_70     0.885    64.66 1.6e-04  -8.23
2574     rs11121022        1_6     0.884    27.27 6.9e-05  -4.87
1020391  rs35870087      13_17     0.884    30.57 7.7e-05   3.54
53345    rs12408694      1_108     0.883    41.15 1.0e-04  -6.28
292299    rs6884480       5_63     0.883    23.56 5.9e-05   4.37
780683    rs2238586       19_2     0.883    31.27 7.9e-05  -5.11
386998   rs12718598       7_36     0.882   299.07 7.5e-04  16.82
153876  rs137980154       3_39     0.881    23.85 6.0e-05   4.09
357064    rs6923513       6_89     0.881 33551.77 8.4e-02  -6.32
98016   rs144442782       2_65     0.879    25.75 6.5e-05   4.85
833464    rs2413715      22_18     0.879    99.61 2.5e-04  -8.81
49770     rs2737649      1_100     0.878    25.75 6.5e-05  -4.76
175298    rs2811366       3_79     0.878    24.33 6.1e-05  -4.41
326430    rs4318925       6_27     0.876   114.41 2.9e-04  10.81
708595   rs11635896      15_48     0.874    24.28 6.1e-05  -4.37
751231  rs147300783      17_39     0.873    25.86 6.4e-05   4.65
534977  rs111604275      10_65     0.872    26.47 6.6e-05  -4.84
675178    rs1275824      14_32     0.872    27.58 6.9e-05   5.14
68353   rs139638572        2_6     0.871    31.04 7.7e-05   5.29
205951     rs963209       4_20     0.870    36.98 9.2e-05   6.64
326930  rs115401532       6_28     0.870    26.22 6.5e-05   4.49
663789     rs797342       14_8     0.870    47.37 1.2e-04  -6.12
741453    rs8078135      17_16     0.870    25.26 6.3e-05  -4.79
286706    rs7700278       5_51     0.868    26.06 6.5e-05  -4.81
495388    rs1861882       9_60     0.866    25.50 6.3e-05  -4.30
622541    rs7972038      12_70     0.866    28.84 7.1e-05   4.94
748173  rs754267414      17_32     0.866    23.80 5.9e-05   4.30
26706    rs12130551       1_56     0.864    24.90 6.1e-05   4.70
15       rs28562941        1_1     0.859    24.27 5.9e-05   4.26
589600   rs61907084       12_4     0.857    25.86 6.3e-05  -4.57
3355       rs205474        1_8     0.853    24.51 6.0e-05   4.49
49370    rs10489689       1_99     0.853    77.74 1.9e-04   5.80
149684  rs111998223       3_27     0.849    55.35 1.3e-04  -7.13
906057   rs75040706       6_21     0.847    32.51 7.9e-05   4.20
709       rs2742690        1_2     0.844    36.60 8.8e-05  -5.94
701661   rs11072556      15_35     0.844    31.79 7.7e-05   4.33
552459   rs11025069      11_13     0.841    32.42 7.8e-05  -6.25
158804    rs7640269       3_48     0.839    27.82 6.7e-05   4.14
14023    rs57401684       1_32     0.838    38.90 9.3e-05   5.66
811506    rs2145697      20_30     0.837    58.95 1.4e-04  10.42
74240     rs7562170       2_17     0.836  2664.02 6.4e-03  -5.15
793158     rs346528      19_30     0.835    47.17 1.1e-04  -6.95
785827  rs113809670      19_14     0.834    27.36 6.5e-05   4.80
700090   rs16952867      15_32     0.831    30.98 7.4e-05   5.38
702314  rs142004961      15_36     0.831    27.56 6.5e-05   5.05
737478    rs7224566       17_7     0.828    37.81 8.9e-05   6.45
34868      rs839605       1_73     0.826    51.55 1.2e-04  -6.55
822200    rs2834711      21_15     0.826    32.56 7.7e-05  -5.75
500133   rs71483206       9_70     0.824    34.47 8.1e-05   5.83
673788    rs8006419      14_30     0.824    76.74 1.8e-04  10.26
49662     rs4915386      1_100     0.821    25.14 5.9e-05   4.29
860807  rs372515880       2_66     0.821   192.48 4.5e-04  17.77
349435   rs13196629       6_73     0.819    80.44 1.9e-04  12.98
158714   rs13079951       3_48     0.818    25.31 5.9e-05  -4.54
358138  rs112784432       6_92     0.818    36.54 8.5e-05   6.94
389754  rs189049917       7_40     0.817    25.14 5.9e-05   4.64
552209   rs66514853      11_13     0.817    27.25 6.4e-05  -4.85
815375     rs926167       21_2     0.817    29.66 6.9e-05   5.75
299204    rs4463178       5_77     0.816    27.32 6.4e-05  -4.88
572055    rs7941337      11_47     0.814    26.16 6.1e-05  -4.75
380103   rs34311813       7_23     0.812    28.48 6.6e-05   5.02
93228     rs4441469       2_54     0.810    26.27 6.1e-05  -4.58
748331    rs3794748      17_32     0.809    28.37 6.6e-05   4.82
307261    rs4704834       5_92     0.808    36.69 8.5e-05  -5.76
459174   rs10956395       8_84     0.808    26.48 6.1e-05   4.85
248134    rs1830456      4_102     0.807    25.61 5.9e-05  -4.67
153796    rs6445819       3_39     0.805   144.78 3.3e-04  12.20
178992  rs146526750       3_87     0.805    26.82 6.2e-05   4.42
8734      rs7525656       1_19     0.801    27.87 6.4e-05   4.74
154200    rs2362899       3_39     0.801    25.39 5.8e-05  -4.35
801618    rs2423508       20_8     0.801    32.47 7.4e-05   5.64

SNPs with largest effect sizes

#plot PIP vs effect size
plot(ctwas_snp_res$susie_pip, ctwas_snp_res$mu2, xlab="PIP", ylab="mu^2", main="SNP PIPs vs Effect Size")

Version Author Date
3a7fbc1 wesleycrouse 2021-09-08
#SNPs with 50 largest effect sizes
head(ctwas_snp_res[order(-ctwas_snp_res$mu2),report_cols_snps],50)
                id region_tag susie_pip      mu2     PVE     z
58263  rs766167074      1_118     1.000 66708.73 1.9e-01  8.67
58262     rs971534      1_118     0.713 66307.82 1.3e-01 -8.84
58261    rs2486737      1_118     0.572 66307.66 1.1e-01 -8.83
58260   rs10489611      1_118     0.146 66306.08 2.8e-02 -8.82
58257    rs2790891      1_118     0.127 66301.14 2.4e-02 -8.83
58258    rs2491405      1_118     0.127 66301.14 2.4e-02 -8.83
58254    rs2256908      1_118     0.071 66300.85 1.3e-02 -8.82
58270    rs2211176      1_118     0.103 66281.95 2.0e-02 -8.82
58271    rs2790882      1_118     0.103 66281.95 2.0e-02 -8.82
58269    rs2248646      1_118     0.606 66280.43 1.1e-01 -8.84
58250    rs1076804      1_118     0.000 66200.80 2.1e-05 -8.83
58272    rs1416913      1_118     0.002 66199.35 3.1e-04 -8.84
58275    rs2790874      1_118     0.017 66193.85 3.1e-03 -8.87
58251     rs910824      1_118     0.000 66030.92 1.2e-12 -8.78
58274    rs2808603      1_118     0.000 66025.84 4.7e-08 -8.89
58249    rs2474635      1_118     0.000 65831.36 0.0e+00 -8.75
58268  rs143905935      1_118     0.000 65737.49 0.0e+00 -8.65
58246     rs722302      1_118     0.000 65701.35 0.0e+00 -8.61
58266    rs2739509      1_118     0.000 65038.90 0.0e+00 -8.66
58276    rs2474631      1_118     0.000 63895.27 0.0e+00 -8.30
58273    rs3071894      1_118     0.000 63842.43 0.0e+00 -8.73
889292 rs563200821        5_2     1.000 63318.42 1.8e-01  6.01
889290 rs760400154        5_2     1.000 63316.88 1.8e-01 -5.88
889260 rs116876144        5_2     0.000 63226.53 4.0e-06  5.99
889256  rs79843325        5_2     0.000 63219.97 1.1e-06  5.99
889262 rs113261319        5_2     0.000 63215.22 8.2e-09  5.95
889302 rs118079687        5_2     0.000 63213.38 2.6e-07  6.00
58278    rs2790871      1_118     0.000 63190.76 0.0e+00 -8.90
58279    rs2790870      1_118     0.000 63178.60 0.0e+00 -8.91
889250  rs79635912        5_2     0.000 63173.56 2.1e-09  5.99
58264    rs2739512      1_118     0.000 63081.03 0.0e+00 -8.77
889241 rs117110053        5_2     0.000 63023.07 3.0e-16  6.07
889340 rs112060190        5_2     0.000 62988.08 0.0e+00  6.01
889220 rs117324785        5_2     0.000 62956.83 0.0e+00  6.08
889344 rs117279826        5_2     0.000 62935.37 0.0e+00  6.02
889218 rs117169356        5_2     0.000 62933.76 0.0e+00  6.07
889217 rs117971540        5_2     0.000 62928.89 0.0e+00  6.07
889355 rs111378768        5_2     0.000 62901.12 0.0e+00  6.01
889320 rs576289416        5_2     0.000 62837.10 0.0e+00  5.94
889317 rs111206023        5_2     0.000 62654.05 0.0e+00  6.00
889285 rs554884394        5_2     0.000 62638.09 0.0e+00  6.01
889231 rs117025467        5_2     0.000 62619.03 0.0e+00  6.01
889358 rs117576772        5_2     0.000 62525.37 0.0e+00  5.98
889223 rs116875834        5_2     0.000 62517.64 0.0e+00  6.09
889300 rs372122514        5_2     0.000 62487.25 0.0e+00 -4.98
889342 rs117589613        5_2     0.000 62459.89 0.0e+00  6.06
889351 rs111460998        5_2     0.000 62424.84 0.0e+00  6.06
889173 rs116961707        5_2     0.000 62421.83 0.0e+00  6.06
889359 rs113325004        5_2     0.000 62290.97 0.0e+00  6.05
889242 rs117476328        5_2     0.000 62013.68 0.0e+00  6.01

SNPs with highest PVE

#SNPs with 50 highest pve
head(ctwas_snp_res[order(-ctwas_snp_res$PVE),report_cols_snps],50)
                 id region_tag susie_pip      mu2    PVE      z
58263   rs766167074      1_118     1.000 66708.73 0.1900   8.67
889290  rs760400154        5_2     1.000 63316.88 0.1800  -5.88
889292  rs563200821        5_2     1.000 63318.42 0.1800   6.01
676607    rs7156583      14_34     1.000 47559.82 0.1400   2.48
676610  rs369107859      14_34     1.000 47533.73 0.1400  -6.40
58262      rs971534      1_118     0.713 66307.82 0.1300  -8.84
58261     rs2486737      1_118     0.572 66307.66 0.1100  -8.83
58269     rs2248646      1_118     0.606 66280.43 0.1100  -8.84
357048  rs199804242       6_89     1.000 33547.37 0.0960   5.33
357064    rs6923513       6_89     0.881 33551.77 0.0840  -6.32
515734   rs71007692      10_28     1.000 21116.31 0.0600   4.54
869640   rs56233336        3_9     1.000 19622.91 0.0560  -3.59
869563  rs534602560        3_9     1.000 19228.44 0.0550   4.05
402351  rs763798411       7_65     1.000 17089.60 0.0490   2.68
402354   rs10274607       7_65     1.000 17100.72 0.0490  -3.08
402362    rs4997569       7_65     1.000 17107.41 0.0490  -2.99
794446  rs374141296      19_34     1.000 17177.78 0.0490   4.86
794447   rs35443645      19_34     1.000 16984.53 0.0480  -5.03
515743   rs11011452      10_28     0.722 21219.35 0.0440  -4.44
794444    rs1858742      19_34     1.000 15219.57 0.0430  -4.93
953682    rs2983226      6_112     1.000 12582.05 0.0360   2.75
953692  rs139588569      6_112     1.000 12647.62 0.0360  -3.30
515733    rs2474565      10_28     0.535 21217.57 0.0320  -4.45
58260    rs10489611      1_118     0.146 66306.08 0.0280  -8.82
58257     rs2790891      1_118     0.127 66301.14 0.0240  -8.83
58258     rs2491405      1_118     0.127 66301.14 0.0240  -8.83
953703   rs59421548      6_112     0.663 12519.76 0.0240   2.83
515740    rs2472183      10_28     0.370 21217.63 0.0220  -4.45
58270     rs2211176      1_118     0.103 66281.95 0.0200  -8.82
58271     rs2790882      1_118     0.103 66281.95 0.0200  -8.82
869635   rs28897669        3_9     0.312 19534.39 0.0170   4.35
869637   rs28897670        3_9     0.287 19534.76 0.0160   4.34
58254     rs2256908      1_118     0.071 66300.85 0.0130  -8.82
356892    rs7775698       6_89     0.991  4715.39 0.0130  65.30
581107    rs1176746      11_67     1.000  4570.30 0.0130   4.15
581109    rs2307599      11_67     1.000  4571.59 0.0130  -3.98
869632   rs73813138        3_9     0.214 19535.15 0.0120   4.34
953698   rs62424359      6_112     0.337 12571.73 0.0120   2.89
357047    rs2327654       6_89     0.119 33547.64 0.0110  -6.31
869631   rs35839040        3_9     0.188 19535.31 0.0100   4.34
315753   rs70995354        6_2     1.000  3305.11 0.0094  -3.25
315756    rs3929752        6_2     1.000  3301.42 0.0094   3.30
74241   rs569546056       2_17     1.000  2760.80 0.0079   5.27
74244     rs4580350       2_17     0.996  2675.41 0.0076   5.25
74240     rs7562170       2_17     0.836  2664.02 0.0064  -5.15
58275     rs2790874      1_118     0.017 66193.85 0.0031  -8.87
870148   rs35240997        3_9     0.481  1580.71 0.0022   9.25
329104    rs3218097       6_32     1.000   725.11 0.0021 -29.06
1046339  rs67453880      15_31     1.000   698.44 0.0020  -4.87
870089    rs2067819        3_9     0.410  1581.68 0.0019   9.23

SNPs with largest z scores

#SNPs with 50 largest z scores
head(ctwas_snp_res[order(-abs(ctwas_snp_res$z)),report_cols_snps],50)
                id region_tag susie_pip     mu2     PVE      z
356892   rs7775698       6_89     0.991 4715.39 1.3e-02  65.30
356894   rs9402685       6_89     0.009 4709.70 1.2e-04  65.22
356893  rs56293029       6_89     0.000 4604.26 0.0e+00  64.57
356899   rs6925841       6_89     0.000  914.18 4.9e-18 -39.29
356900   rs9321485       6_89     0.000  891.66 5.6e-19 -38.59
356904   rs6909822       6_89     0.000  770.16 0.0e+00 -37.04
356907  rs12204380       6_89     0.000  753.42 0.0e+00 -36.83
215541    rs218251       4_39     0.526 1065.27 1.6e-03  34.44
215538    rs218237       4_39     0.333 1064.35 1.0e-03  34.42
215540    rs218240       4_39     0.144 1062.33 4.4e-04  34.40
215539    rs218239       4_39     0.002  652.91 3.6e-06  34.35
356889 rs113033196       6_89     1.000  416.68 1.2e-03 -32.54
356845   rs6899500       6_89     0.000 1525.86 0.0e+00 -32.02
964097   rs2075672       7_62     0.642  537.99 9.9e-04  30.80
964089   rs9801017       7_62     0.209  534.94 3.2e-04  30.75
964087   rs7385804       7_62     0.149  533.98 2.3e-04  30.74
964161    rs221790       7_62     0.000  514.62 3.8e-10  30.65
964144    rs221788       7_62     0.000  509.53 1.0e-10  30.63
964188    rs221799       7_62     0.000  511.69 3.2e-10  30.59
964216   rs2432930       7_62     0.000  512.20 3.6e-10  30.59
964224    rs221772       7_62     0.000  512.03 3.5e-10  30.59
964225    rs221771       7_62     0.000  512.22 3.6e-10  30.59
964192    rs221801       7_62     0.000  510.52 2.8e-10  30.57
964275   rs1617640       7_62     0.000  509.78 3.8e-10  30.54
964238  rs10277087       7_62     0.000  507.88 2.4e-10  30.53
964241    rs504141       7_62     0.000  507.68 2.4e-10  30.53
964244   rs1734909       7_62     0.000  507.63 2.4e-10  30.53
964274    rs576236       7_62     0.000  508.32 3.1e-10  30.53
964263    rs554055       7_62     0.000  507.61 2.7e-10  30.52
964265  rs56189543       7_62     0.000  507.70 2.7e-10  30.52
964284    rs551238       7_62     0.000  508.53 3.8e-10  30.52
964252    rs568733       7_62     0.000  506.23 2.1e-10  30.50
964260   rs1734908       7_62     0.000  505.89 2.0e-10  30.50
964272  rs35495521       7_62     0.000  507.22 2.5e-10  30.49
964277    rs507392       7_62     0.000  505.13 2.2e-10  30.48
964269    rs475339       7_62     0.000  504.48 1.8e-10  30.47
964243   rs1734910       7_62     0.000  500.71 9.6e-11  30.42
356891  rs55731938       6_89     0.000  327.12 0.0e+00 -30.01
964137 rs371423364       7_62     0.000  475.93 3.2e-12  29.42
964073   rs4548095       7_62     0.000  479.74 1.2e-13  29.39
964062   rs4729597       7_62     0.000  486.72 9.5e-13  29.38
964211  rs66481397       7_62     0.000  460.20 3.0e-12  29.38
964066  rs35142847       7_62     0.000  478.63 4.5e-14  29.20
329104   rs3218097       6_32     1.000  725.11 2.1e-03 -29.06
964136 rs567170062       7_62     0.000  394.97 1.9e-15  26.61
329089  rs10947992       6_32     0.000  613.84 2.0e-15 -26.48
329092   rs9381097       6_32     0.000  612.90 2.0e-15 -26.46
329082   rs9349202       6_32     0.000  607.16 1.7e-15 -26.29
964293 rs760985353       7_62     0.000  340.75 1.2e-16  26.27
964175    rs221795       7_62     0.000  342.43 1.2e-16  26.24

Gene set enrichment for genes with PIP>0.8

#GO enrichment analysis
library(enrichR)
Welcome to enrichR
Checking connection ... 
Enrichr ... Connection is Live!
FlyEnrichr ... Connection is available!
WormEnrichr ... Connection is available!
YeastEnrichr ... Connection is available!
FishEnrichr ... Connection is available!
dbs <- c("GO_Biological_Process_2021", "GO_Cellular_Component_2021", "GO_Molecular_Function_2021")
genes <- ctwas_gene_res$genename[ctwas_gene_res$susie_pip>0.8]

#number of genes for gene set enrichment
length(genes)
[1] 35
if (length(genes)>0){
  GO_enrichment <- enrichr(genes, dbs)

  for (db in dbs){
    print(db)
    df <- GO_enrichment[[db]]
    df <- df[df$Adjusted.P.value<0.05,c("Term", "Overlap", "Adjusted.P.value", "Genes")]
    print(df)
  }
  
  #DisGeNET enrichment
  
  # devtools::install_bitbucket("ibi_group/disgenet2r")
  library(disgenet2r)
  
  disgenet_api_key <- get_disgenet_api_key(
                    email = "wesleycrouse@gmail.com", 
                    password = "uchicago1" )
  
  Sys.setenv(DISGENET_API_KEY= disgenet_api_key)
  
  res_enrich <-disease_enrichment(entities=genes, vocabulary = "HGNC",
                               database = "CURATED" )
  
  df <- res_enrich@qresult[1:10, c("Description", "FDR", "Ratio",  "BgRatio")]
  print(df)
  
  #WebGestalt enrichment
  library(WebGestaltR)
  
  background <- ctwas_gene_res$genename
  
  #listGeneSet()
  databases <- c("pathway_KEGG", "disease_GLAD4U", "disease_OMIM")
  
  enrichResult <- WebGestaltR(enrichMethod="ORA", organism="hsapiens",
                              interestGene=genes, referenceGene=background,
                              enrichDatabase=databases, interestGeneType="genesymbol",
                              referenceGeneType="genesymbol", isOutput=F)
  print(enrichResult[,c("description", "size", "overlap", "FDR", "database", "userId")])
}
Uploading data to Enrichr... Done.
  Querying GO_Biological_Process_2021... Done.
  Querying GO_Cellular_Component_2021... Done.
  Querying GO_Molecular_Function_2021... Done.
Parsing results... Done.
[1] "GO_Biological_Process_2021"
                                                                                                            Term
1                                                                        arginine metabolic process (GO:0006525)
2                                                        positive regulation of protein sumoylation (GO:0033235)
3                                                                      nucleoside metabolic process (GO:0009116)
4                                                           pyrimidine nucleoside catabolic process (GO:0046135)
5                                                  pyrimidine-containing compound metabolic process (GO:0072527)
6                                                                      nucleoside catabolic process (GO:0009164)
7                                                            negative regulation of gene expression (GO:0010629)
8                                                           pyrimidine nucleoside metabolic process (GO:0006213)
9  positive regulation of nuclear-transcribed mRNA catabolic process, deadenylation-dependent decay (GO:1900153)
10          regulation of nuclear-transcribed mRNA catabolic process, deadenylation-dependent decay (GO:1900151)
11              positive regulation of protein modification by small protein conjugation or removal (GO:1903322)
12                                                 pyrimidine-containing compound catabolic process (GO:0072529)
13                                                                regulation of protein sumoylation (GO:0033233)
14                                                             regulation of nervous system process (GO:0031644)
15                                                       positive regulation of histone acetylation (GO:0035066)
   Overlap Adjusted.P.value                               Genes
1     2/10       0.01502710                           NOS3;NAGS
2     2/10       0.01502710                           SAE1;GNL3
3     2/10       0.01502710                         NT5C3A;TYMP
4     2/11       0.01502710                         NT5C3A;TYMP
5     2/12       0.01502710                         NT5C3A;TYMP
6     2/12       0.01502710                         NT5C3A;TYMP
7    5/322       0.01502710 RPS6KA4;TNRC6C;NDFIP1;PCIF1;ZFP36L2
8     2/15       0.01502710                         NT5C3A;TYMP
9     2/15       0.01502710                      TNRC6C;ZFP36L2
10    2/15       0.01502710                      TNRC6C;ZFP36L2
11    3/77       0.01502710                    NDFIP1;SAE1;GNL3
12    2/17       0.01668230                         NT5C3A;TYMP
13    2/18       0.01730491                           SAE1;GNL3
14    2/19       0.01793959                           NOS3;TYMP
15    2/23       0.02466416                     RPS6KA4;SMARCB1
[1] "GO_Cellular_Component_2021"
[1] Term             Overlap          Adjusted.P.value Genes           
<0 rows> (or 0-length row.names)
[1] "GO_Molecular_Function_2021"
                           Term Overlap Adjusted.P.value     Genes
1 arginine binding (GO:0034618)     2/8      0.008854511 NOS3;NAGS
LSM4 gene(s) from the input list not found in DisGeNET CURATEDC12orf43 gene(s) from the input list not found in DisGeNET CURATEDOSER1 gene(s) from the input list not found in DisGeNET CURATEDMARCH2 gene(s) from the input list not found in DisGeNET CURATEDTNRC6C gene(s) from the input list not found in DisGeNET CURATEDCNIH4 gene(s) from the input list not found in DisGeNET CURATEDSNTB2 gene(s) from the input list not found in DisGeNET CURATEDSAE1 gene(s) from the input list not found in DisGeNET CURATEDZSCAN23 gene(s) from the input list not found in DisGeNET CURATEDPCIF1 gene(s) from the input list not found in DisGeNET CURATEDC4orf36 gene(s) from the input list not found in DisGeNET CURATEDGNL3 gene(s) from the input list not found in DisGeNET CURATEDTEFM gene(s) from the input list not found in DisGeNET CURATEDNDFIP1 gene(s) from the input list not found in DisGeNET CURATEDHIST1H1B gene(s) from the input list not found in DisGeNET CURATEDWNT7B gene(s) from the input list not found in DisGeNET CURATEDZNF629 gene(s) from the input list not found in DisGeNET CURATED
                                                                    Description
58                                                   Hypertension, Renovascular
109                                          Premature ventricular contractions
136                                                                   Chloracne
138                                                    Hyperammonemia, type III
187                                            Atypical Teratoid Rhabdoid Tumor
192                                    Small Intestinal Neuroendocrine Neoplasm
202                                                    Teratoid Tumor, Atypical
203                         RHABDOID TUMOR PREDISPOSITION SYNDROME 1 (disorder)
206 Uridine 5-Prime Monophosphate Hydrolase Deficiency, Hemolytic Anemia due to
212                                       Multiple Endocrine Neoplasia, Type IV
           FDR Ratio BgRatio
58  0.02748145  1/18  1/9703
109 0.02748145  1/18  1/9703
136 0.02748145  2/18 33/9703
138 0.02748145  1/18  1/9703
187 0.02748145  1/18  1/9703
192 0.02748145  1/18  1/9703
202 0.02748145  1/18  1/9703
203 0.02748145  1/18  1/9703
206 0.02748145  1/18  1/9703
212 0.02748145  1/18  1/9703
******************************************

*                                        *

*          Welcome to WebGestaltR !      *

*                                        *

******************************************
Loading the functional categories...
Loading the ID list...
Loading the reference list...
Performing the enrichment analysis...
Warning in oraEnrichment(interestGeneList, referenceGeneList, geneSet,
minNum = minNum, : No significant gene set is identified based on FDR 0.05!
NULL

Sensitivity, specificity and precision for silver standard genes

library("readxl")

known_annotations <- read_xlsx("data/summary_known_genes_annotations.xlsx", sheet="RBC count")
known_annotations <- unique(known_annotations$`Gene Symbol`)

unrelated_genes <- ctwas_gene_res$genename[!(ctwas_gene_res$genename %in% known_annotations)]

#number of genes in known annotations
print(length(known_annotations))
[1] 71
#number of genes in known annotations with imputed expression
print(sum(known_annotations %in% ctwas_gene_res$genename))
[1] 37
#assign ctwas, TWAS, and bystander genes
ctwas_genes <- ctwas_gene_res$genename[ctwas_gene_res$susie_pip>0.8]
twas_genes <- ctwas_gene_res$genename[abs(ctwas_gene_res$z)>sig_thresh]
novel_genes <- ctwas_genes[!(ctwas_genes %in% twas_genes)]

#significance threshold for TWAS
print(sig_thresh)
[1] 4.575849
#number of ctwas genes
length(ctwas_genes)
[1] 35
#number of TWAS genes
length(twas_genes)
[1] 458
#show novel genes (ctwas genes with not in TWAS genes)
ctwas_gene_res[ctwas_gene_res$genename %in% novel_genes,report_cols]
     genename region_tag susie_pip   mu2     PVE     z
8707    RUFY1      5_108     0.862 19.69 4.8e-05  3.99
2531   CDKN1B      12_12     0.830 21.94 5.2e-05 -4.33
1713   ZNF629      16_24     0.825 53.94 1.3e-04  3.67
7826    SNTB2      16_37     0.939 26.52 7.1e-05 -4.52
8249     TEFM      17_18     0.863 24.65 6.1e-05 -4.56
6766     NAGS      17_26     0.840 22.72 5.4e-05 -4.39
920    TNRC6C      17_43     0.884 33.45 8.4e-05  4.56
1361   MARCH2       19_8     0.964 25.70 7.1e-05 -4.14
#sensitivity / recall
sensitivity <- rep(NA,2)
names(sensitivity) <- c("ctwas", "TWAS")
sensitivity["ctwas"] <- sum(ctwas_genes %in% known_annotations)/length(known_annotations)
sensitivity["TWAS"] <- sum(twas_genes %in% known_annotations)/length(known_annotations)
sensitivity
     ctwas       TWAS 
0.01408451 0.05633803 
#specificity
specificity <- rep(NA,2)
names(specificity) <- c("ctwas", "TWAS")
specificity["ctwas"] <- sum(!(unrelated_genes %in% ctwas_genes))/length(unrelated_genes)
specificity["TWAS"] <- sum(!(unrelated_genes %in% twas_genes))/length(unrelated_genes)
specificity
    ctwas      TWAS 
0.9967634 0.9567825 
#precision / PPV
precision <- rep(NA,2)
names(precision) <- c("ctwas", "TWAS")
precision["ctwas"] <- sum(ctwas_genes %in% known_annotations)/length(ctwas_genes)
precision["TWAS"] <- sum(twas_genes %in% known_annotations)/length(twas_genes)
precision
      ctwas        TWAS 
0.028571429 0.008733624 
#ROC curves

pip_range <- (0:1000)/1000
sensitivity <- rep(NA, length(pip_range))
specificity <- rep(NA, length(pip_range))

for (index in 1:length(pip_range)){
  pip <- pip_range[index]
  ctwas_genes <- ctwas_gene_res$genename[ctwas_gene_res$susie_pip>=pip]
  sensitivity[index] <- sum(ctwas_genes %in% known_annotations)/length(known_annotations)
  specificity[index] <- sum(!(unrelated_genes %in% ctwas_genes))/length(unrelated_genes)
}

plot(1-specificity, sensitivity, type="l", xlim=c(0,1), ylim=c(0,1))

sig_thresh_range <- seq(from=0, to=max(abs(ctwas_gene_res$z)), length.out=length(pip_range))

for (index in 1:length(sig_thresh_range)){
  sig_thresh_plot <- sig_thresh_range[index]
  twas_genes <- ctwas_gene_res$genename[abs(ctwas_gene_res$z)>=sig_thresh_plot]
  sensitivity[index] <- sum(twas_genes %in% known_annotations)/length(known_annotations)
  specificity[index] <- sum(!(unrelated_genes %in% twas_genes))/length(unrelated_genes)
}

lines(1-specificity, sensitivity, xlim=c(0,1), ylim=c(0,1), col="red", lty=2)

Version Author Date
3a7fbc1 wesleycrouse 2021-09-08

Sensitivity, specificity and precision for silver standard genes - bystanders only

This section first uses all silver standard genes to identify bystander genes within 1Mb. The silver standard and bystander gene lists are then subset to only genes with imputed expression in this analysis. Then, the ctwas and TWAS gene lists from this analysis are subset to only genes that are in the (subset) silver standard and bystander genes. These gene lists are then used to compute sensitivity, specificity and precision for ctwas and TWAS.

library(biomaRt)
library(GenomicRanges)
Loading required package: stats4
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'
The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB
The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs
The following objects are masked from 'package:base':

    anyDuplicated, append, as.data.frame, basename, cbind,
    colnames, dirname, do.call, duplicated, eval, evalq, Filter,
    Find, get, grep, grepl, intersect, is.unsorted, lapply, Map,
    mapply, match, mget, order, paste, pmax, pmax.int, pmin,
    pmin.int, Position, rank, rbind, Reduce, rownames, sapply,
    setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min
Loading required package: S4Vectors

Attaching package: 'S4Vectors'
The following object is masked from 'package:base':

    expand.grid
Loading required package: IRanges
Loading required package: GenomeInfoDb
ensembl <- useEnsembl(biomart="ENSEMBL_MART_ENSEMBL", dataset="hsapiens_gene_ensembl")
G_list <- getBM(filters= "chromosome_name", attributes= c("hgnc_symbol","chromosome_name","start_position","end_position","gene_biotype"), values=1:22, mart=ensembl)
G_list <- G_list[G_list$hgnc_symbol!="",]
G_list <- G_list[G_list$gene_biotype %in% c("protein_coding","lncRNA"),]
G_list$start <- G_list$start_position
G_list$end <- G_list$end_position
G_list_granges <- makeGRangesFromDataFrame(G_list, keep.extra.columns=T)

known_annotations_positions <- G_list[G_list$hgnc_symbol %in% known_annotations,]
half_window <- 1000000
known_annotations_positions$start <- known_annotations_positions$start_position - half_window
known_annotations_positions$end <- known_annotations_positions$end_position + half_window
known_annotations_positions$start[known_annotations_positions$start<1] <- 1
known_annotations_granges <- makeGRangesFromDataFrame(known_annotations_positions, keep.extra.columns=T)

bystanders <- findOverlaps(known_annotations_granges,G_list_granges)
bystanders <- unique(subjectHits(bystanders))
bystanders <- G_list$hgnc_symbol[bystanders]
bystanders <- bystanders[!(bystanders %in% known_annotations)]
unrelated_genes <- bystanders

#number of genes in known annotations
print(length(known_annotations))
[1] 71
#number of genes in known annotations with imputed expression
print(sum(known_annotations %in% ctwas_gene_res$genename))
[1] 37
#number of bystander genes
print(length(unrelated_genes))
[1] 1909
#number of bystander genes with imputed expression
print(sum(unrelated_genes %in% ctwas_gene_res$genename))
[1] 901
#remove genes without imputed expression from gene lists
known_annotations <- known_annotations[known_annotations %in% ctwas_gene_res$genename]
unrelated_genes <- unrelated_genes[unrelated_genes %in% ctwas_gene_res$genename]

#assign ctwas and TWAS genes
ctwas_genes <- ctwas_gene_res$genename[ctwas_gene_res$susie_pip>0.8]
twas_genes <- ctwas_gene_res$genename[abs(ctwas_gene_res$z)>sig_thresh]

#significance threshold for TWAS
print(sig_thresh)
[1] 4.575849
#number of ctwas genes
length(ctwas_genes)
[1] 35
#number of ctwas genes in known annotations or bystanders
sum(ctwas_genes %in% c(known_annotations, unrelated_genes))
[1] 3
#number of ctwas genes
length(twas_genes)
[1] 458
#number of TWAS genes
sum(twas_genes %in% c(known_annotations, unrelated_genes))
[1] 71
#remove genes not in known or bystander lists from results
ctwas_genes <- ctwas_genes[ctwas_genes %in% c(known_annotations, unrelated_genes)]
twas_genes <- twas_genes[twas_genes %in% c(known_annotations, unrelated_genes)]

#sensitivity / recall
sensitivity <- rep(NA,2)
names(sensitivity) <- c("ctwas", "TWAS")
sensitivity["ctwas"] <- sum(ctwas_genes %in% known_annotations)/length(known_annotations)
sensitivity["TWAS"] <- sum(twas_genes %in% known_annotations)/length(known_annotations)
sensitivity
     ctwas       TWAS 
0.02702703 0.10810811 
#specificity
specificity <- rep(NA,2)
names(specificity) <- c("ctwas", "TWAS")
specificity["ctwas"] <- sum(!(unrelated_genes %in% ctwas_genes))/length(unrelated_genes)
specificity["TWAS"] <- sum(!(unrelated_genes %in% twas_genes))/length(unrelated_genes)
specificity
    ctwas      TWAS 
0.9977802 0.9256382 
#precision / PPV
precision <- rep(NA,2)
names(precision) <- c("ctwas", "TWAS")
precision["ctwas"] <- sum(ctwas_genes %in% known_annotations)/length(ctwas_genes)
precision["TWAS"] <- sum(twas_genes %in% known_annotations)/length(twas_genes)
precision
     ctwas       TWAS 
0.33333333 0.05633803 

sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Scientific Linux 7.4 (Nitrogen)

Matrix products: default
BLAS/LAPACK: /software/openblas-0.2.19-el7-x86_64/lib/libopenblas_haswellp-r0.2.19.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] parallel  stats4    stats     graphics  grDevices utils     datasets 
[8] methods   base     

other attached packages:
 [1] GenomicRanges_1.36.0 GenomeInfoDb_1.20.0  IRanges_2.18.1      
 [4] S4Vectors_0.22.1     BiocGenerics_0.30.0  biomaRt_2.40.1      
 [7] readxl_1.3.1         WebGestaltR_0.4.4    disgenet2r_0.99.2   
[10] enrichR_3.0          cowplot_1.0.0        ggplot2_3.3.3       

loaded via a namespace (and not attached):
 [1] bitops_1.0-6           fs_1.3.1               bit64_4.0.5           
 [4] doParallel_1.0.16      progress_1.2.2         httr_1.4.1            
 [7] rprojroot_2.0.2        tools_3.6.1            doRNG_1.8.2           
[10] utf8_1.2.1             R6_2.5.0               DBI_1.1.1             
[13] colorspace_1.4-1       withr_2.4.1            tidyselect_1.1.0      
[16] prettyunits_1.0.2      bit_4.0.4              curl_3.3              
[19] compiler_3.6.1         git2r_0.26.1           Biobase_2.44.0        
[22] labeling_0.3           scales_1.1.0           readr_1.4.0           
[25] stringr_1.4.0          apcluster_1.4.8        digest_0.6.20         
[28] rmarkdown_1.13         svglite_1.2.2          XVector_0.24.0        
[31] pkgconfig_2.0.3        htmltools_0.3.6        fastmap_1.1.0         
[34] rlang_0.4.11           RSQLite_2.2.7          farver_2.1.0          
[37] generics_0.0.2         jsonlite_1.6           dplyr_1.0.7           
[40] RCurl_1.98-1.1         magrittr_2.0.1         GenomeInfoDbData_1.2.1
[43] Matrix_1.2-18          Rcpp_1.0.6             munsell_0.5.0         
[46] fansi_0.5.0            gdtools_0.1.9          lifecycle_1.0.0       
[49] stringi_1.4.3          whisker_0.3-2          yaml_2.2.0            
[52] zlibbioc_1.30.0        plyr_1.8.4             grid_3.6.1            
[55] blob_1.2.1             promises_1.0.1         crayon_1.4.1          
[58] lattice_0.20-38        hms_1.1.0              knitr_1.23            
[61] pillar_1.6.1           igraph_1.2.4.1         rjson_0.2.20          
[64] rngtools_1.5           reshape2_1.4.3         codetools_0.2-16      
[67] XML_3.98-1.20          glue_1.4.2             evaluate_0.14         
[70] data.table_1.14.0      vctrs_0.3.8            httpuv_1.5.1          
[73] foreach_1.5.1          cellranger_1.1.0       gtable_0.3.0          
[76] purrr_0.3.4            assertthat_0.2.1       cachem_1.0.5          
[79] xfun_0.8               later_0.8.0            tibble_3.1.2          
[82] iterators_1.0.13       AnnotationDbi_1.46.0   memoise_2.0.0         
[85] workflowr_1.6.2        ellipsis_0.3.2