MV.cor.test: Correlation replication test based on multivariate analysis...

Description Usage Arguments Value Author(s) References See Also Examples

Description

This function is developed to implement correlation replication test based on MVA or cMVA results

Usage

1
2
MV.cor.test(marker, gwa.1, gwa.2, R.1, R.2, traits, nrep = 10000,
  probs = c(0.025, 0.975), method = "kendall", plot = FALSE)

Arguments

marker

The SNP to be analyzed

gwa.1

GWAS summary statistics for sample 1, includes A1, A2 and two columns for each trait: beta and se

gwa.2

GWAS summary statistics for sample 2, includes A1, A2 and two columns for each trait: beta and se

R.1

Phenotypic correlation matrix for sample 1

R.2

Phenotypic correlation matrix for sample 2

traits

Traits to be analyzed

nrep

The number of Monte Carlo repetitions

probs

Percentiles of the endpoints of confidence interval

method

The method used for computing correlation coefficient

plot

If the results for making correlation test figure are needed

Value

The function returns two lists of res, which includes 1) correlation Estimated correlation computed from original sample; 2) ci.left The value at left endpoint of confidence interval; 3) ci.right The value at right endpoint of confidence interval (Note: If there are only two traits, then the ratio of correlation equals to one is provided instead of ci.left and ci.right), and df.plot, will be provided if plot = TRUE, includes 1) traits The name of traits in analysis; 2) rank.1 The rank of estimated effect sizes in sample 1; 3) rank.2 The rank of estimated effect sizes in sample 2; 4) mean.conc The mean of concordant pairs in MC generated by the trait; 5) sd.conc The standard deviation of concordant pairs in MC generated by the trait; 6) se.beta The standard error of estimated effect sizes computed using inverse-variance weighting.

Author(s)

Zheng Ning, Xia Shen

References

Zheng Ning, Yakov Tsepilov, Sodbo Zh. Sharapov, Alexander K. Grishenko, Masoud Shirali, Peter K. Joshi, James F. Wilson, Yudi Pawitan, Chris S. Haley, Yurii S. Aulchenko, Xia Shen (2018). Multivariate discovery, replication, and interpretation of pleiotropic loci using summary association statistics. Submitted.

See Also

MultiSummary

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
## Not run: 

data(example.MV.cor.test)

## Six-trait correlation test ##
traits <- c("HEIGHT", "BMI", "HIP", "WC", "WHR", "WEIGHT")
set.seed(510)
MV.cor.test(marker = "rs905938", gwa.1 = example.gwa.1, gwa.2 = example.gwa.2, R.1 = example.R.1,
            R.2 = example.R.2, traits = traits, nrep = 10000)

## Make correlation correlation test figure ##
require(ggplot2)
require(cowplot)

set.seed(510)
res.mv.cor <- MV.cor.test(marker = "rs905938", gwa.1 = example.gwa.1, gwa.2 = example.gwa.2, R.1 = example.R.1,
                          R.2 = example.R.2, traits = traits, nrep = 10000, plot = TRUE)
df.plot <- res.mv.cor$df.plot

p1 <- ggplot()+ 
  geom_point(data=df.plot, mapping=aes(x=rank.1, y=rank.2, color=traits), size=2) + 
  geom_point(data=df.plot, mapping=aes(x=rank.1, y=rank.2, color=traits, size = se.beta), alpha = 0.2) + 
  stat_smooth(data=df.plot, mapping=aes(x=rank.1, y=rank.2), method = "lm", se=FALSE, color="black", size=0.3, fullrange = TRUE) + 
  coord_cartesian(xlim = c(0.5, 6.5), ylim = c(0.5, 6.5)) + xlim(0,200) + 
  scale_size_continuous(range = c(3, 10)) +
  theme(axis.text=element_text(size=10),
        axis.title=element_text(size=14,face="bold"), 
        strip.text.x = element_text(size = 16))+ 
  theme(axis.title.x=element_blank(),axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),axis.title.y=element_blank(), legend.position = c(0.8,0.3), 
        legend.background=element_rect(colour='NA', fill='transparent'), legend.key=element_blank(), 
        legend.title=element_text(size=14), 
        legend.text=element_text(size=12), legend.key.size = unit(1.4, 'lines')) + 
  guides(colour = guide_legend(override.aes = list(alpha = 1)), size = FALSE) +
  scale_colour_discrete(name = "Traits")

p2 <- ggplot(data=df.plot, aes(x=rank.1,y=mean.conc)) +
  coord_cartesian(xlim = c(0.5, 6.5), ylim = c(0, 5.5)) + 
  geom_bar(stat = "identity", aes(fill=traits), width = 0.4) + theme(legend.position="none") + theme(
    strip.background = element_blank(),
    strip.text.x = element_blank()
  ) + geom_errorbar(aes(ymin = mean.conc - sd.conc,ymax = mean.conc + sd.conc), width = 0.1)  + 
  theme(axis.title.x=element_blank(),axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),axis.title.y=element_blank()) + 
  theme(plot.margin = unit(c(0, 0, 0, 0), "cm"))

require(cowplot)
plot_grid(p1,p2,ncol=1,align = "v", rel_heights = c(2,1))


## End(Not run)

MultiABEL documentation built on May 2, 2019, 5:57 p.m.