MEAD

We give a tutorial on how to use MEAD in this vignette.

Install the package

install.packages('devtools')
devtools::install_github('DongyueXie/MEAD')
library(MEAD)

Load data

Neuron dataset from Jerber et al. (2021). We selected 6 individuals as reference and bulk samples are obtained by aggregating single cell data.

ref = readRDS('ref.rds')
bulk = readRDS('bulk.rds')

Run analysis

Run MEAD

# R01 = get_R01(bulk,alpha=0.1)
# To get R01, uncomment the above line and comment out the next line.
R01 = readRDS('R01.rds')
fit = MEAD(bulk[,1:10],ref,R01=R01)

Estimated cell type proportions.

t(fit$p_hat)
#>                          DA       Epen1        FPP      P_FPP      Sert
#> HPSI0714i-iudw_1 0.42861016 0.004520672 0.26990370 0.06147027 0.1157379
#> HPSI0114i-eipl_1 0.00000000 0.166111128 0.48346432 0.03954649 0.0000000
#> HPSI0614i-liqa_1 0.24412090 0.000000000 0.15632379 0.15512648 0.3778662
#> HPSI0115i-paim_1 0.27933688 0.030519262 0.08047641 0.02549879 0.5841687
#> HPSI0914i-suop_5 0.51717447 0.005553116 0.00000000 0.02893406 0.4483383
#> HPSI0214i-eiwy_1 0.28831801 0.019432167 0.00000000 0.11311273 0.5529123
#> HPSI1113i-podx_1 0.65504375 0.040799027 0.03021061 0.01228853 0.2441114
#> HPSI0614i-uevq_6 0.08203685 0.244116208 0.32027503 0.17738777 0.0000000
#> HPSI0214i-pelm_3 0.40108806 0.080195322 0.02841764 0.02407245 0.4662265
#> HPSI0514i-uenn_3 0.13657585 0.237400240 0.26785185 0.10513094 0.1768156
#>                      U_Neur
#> HPSI0714i-iudw_1 0.11975725
#> HPSI0114i-eipl_1 0.31087806
#> HPSI0614i-liqa_1 0.06656262
#> HPSI0115i-paim_1 0.00000000
#> HPSI0914i-suop_5 0.00000000
#> HPSI0214i-eiwy_1 0.02622484
#> HPSI1113i-podx_1 0.01754669
#> HPSI0614i-uevq_6 0.17618414
#> HPSI0214i-pelm_3 0.00000000
#> HPSI0514i-uenn_3 0.07622553

Standard errors of estimated cell type proportions.

t(fit$p_hat_se)
#>                          DA      Epen1        FPP      P_FPP       Sert
#> HPSI0714i-iudw_1 0.04428645 0.01281724 0.03761751 0.02236970 0.05398730
#> HPSI0114i-eipl_1 0.07377000 0.01793565 0.07480554 0.01343936 0.07806430
#> HPSI0614i-liqa_1 0.04669469 0.04575642 0.03629011 0.02149403 0.05287775
#> HPSI0115i-paim_1 0.04606003 0.01239745 0.03596910 0.02481730 0.04721866
#> HPSI0914i-suop_5 0.05099184 0.01226192 0.05536257 0.01710589 0.04419345
#> HPSI0214i-eiwy_1 0.03901840 0.01088638 0.04385897 0.01807592 0.05534416
#> HPSI1113i-podx_1 0.04199868 0.01150442 0.04105451 0.02158945 0.06752747
#> HPSI0614i-uevq_6 0.04199872 0.01672203 0.04249046 0.02566292 0.05842776
#> HPSI0214i-pelm_3 0.03413624 0.01279542 0.04331990 0.02122127 0.08415409
#> HPSI0514i-uenn_3 0.05181492 0.02178093 0.05182419 0.02739205 0.07706541
#>                      U_Neur
#> HPSI0714i-iudw_1 0.02570205
#> HPSI0114i-eipl_1 0.05017586
#> HPSI0614i-liqa_1 0.02968226
#> HPSI0115i-paim_1 0.03194758
#> HPSI0914i-suop_5 0.03669169
#> HPSI0214i-eiwy_1 0.02322422
#> HPSI1113i-podx_1 0.02690066
#> HPSI0614i-uevq_6 0.01321837
#> HPSI0214i-pelm_3 0.04512239
#> HPSI0514i-uenn_3 0.01928574

Construct confidence intervals of proportions.

get_ci(fit)
#> $ci_l
#>                          DA       Epen1         FPP      P_FPP        Sert
#> HPSI0714i-iudw_1 0.34181031 0.000000000 0.196174738 0.01762646 0.009924777
#> HPSI0114i-eipl_1 0.00000000 0.130957894 0.336848142 0.01320584 0.000000000
#> HPSI0614i-liqa_1 0.15260100 0.000000000 0.085196487 0.11299894 0.274227722
#> HPSI0115i-paim_1 0.18906088 0.006220714 0.009978269 0.00000000 0.491621781
#> HPSI0914i-suop_5 0.41723230 0.000000000 0.000000000 0.00000000 0.361720783
#> HPSI0214i-eiwy_1 0.21184335 0.000000000 0.000000000 0.07768458 0.444439689
#> HPSI1113i-podx_1 0.57272785 0.018250771 0.000000000 0.00000000 0.111759983
#> HPSI0614i-uevq_6 0.00000000 0.211341626 0.236995256 0.12708936 0.000000000
#> HPSI0214i-pelm_3 0.33418225 0.055116770 0.000000000 0.00000000 0.301287549
#> HPSI0514i-uenn_3 0.03502048 0.194710409 0.166278308 0.05144351 0.025770146
#>                       U_Neur
#> HPSI0714i-iudw_1 0.069382158
#> HPSI0114i-eipl_1 0.212535191
#> HPSI0614i-liqa_1 0.008386456
#> HPSI0115i-paim_1 0.000000000
#> HPSI0914i-suop_5 0.000000000
#> HPSI0214i-eiwy_1 0.000000000
#> HPSI1113i-podx_1 0.000000000
#> HPSI0614i-uevq_6 0.150276608
#> HPSI0214i-pelm_3 0.000000000
#> HPSI0514i-uenn_3 0.038426182
#> 
#> $ci_r
#>                         DA      Epen1       FPP      P_FPP      Sert     U_Neur
#> HPSI0714i-iudw_1 0.5154100 0.02964201 0.3436327 0.10531408 0.2215511 0.17013234
#> HPSI0114i-eipl_1 0.1445865 0.20126436 0.6300805 0.06588715 0.1530032 0.40922094
#> HPSI0614i-liqa_1 0.3356408 0.08968094 0.2274511 0.19725401 0.4815047 0.12473878
#> HPSI0115i-paim_1 0.3696129 0.05481781 0.1509746 0.07413980 0.6767155 0.06261610
#> HPSI0914i-suop_5 0.6171166 0.02958604 0.1085086 0.06246100 0.5349559 0.07191440
#> HPSI0214i-eiwy_1 0.3647927 0.04076908 0.0859620 0.14854089 0.6613848 0.07174347
#> HPSI1113i-podx_1 0.7373597 0.06334728 0.1106760 0.05460308 0.3764628 0.07027102
#> HPSI0614i-uevq_6 0.1643528 0.27689079 0.4035548 0.22768618 0.1145163 0.20209167
#> HPSI0214i-pelm_3 0.4679939 0.10527387 0.1133231 0.06566537 0.6311655 0.08843826
#> HPSI0514i-uenn_3 0.2381312 0.28009007 0.3694254 0.15881838 0.3278610 0.11402488