R/bandle-sampling-utils.R
bandle-internal.Rd
Internal sampling function, not for outside use documented for completness
proteinAllocation(loglikelihoods, currentweights, alloctemp, cond)
outlierAllocationProbs(
outlierlikelihood,
loglikelihoods,
epsilon,
alloctemp,
cond
)
sampleOutlier(allocoutlierprob)
covOrganelle(object, fcol = "markers")
pg_prior(object_cond1, object_cond2, K, pgPrior = NULL, fcol = "markers")
sample_weights_pg(nk_mat, pgPrior, w, K, tau = 0.2)
sample_weights_dir(nk_mat, dirPrior)
the log likelihoods
the current allocations weights
the current protein allocations
the control = 1, treatment = 2
the outlier log likelihoods
the outlier component weight
the outlier probabilities
An instance of class MSnSet
The feature column containing the markers.
A list of instance of class MSnSets
usually control
A list of instance of class MSnSets
usually treatment
The number of organelle classes
The Polya-Gamma prior
The summary matrix of allocations
The Polya-Gamma auxiliary variable
The empirical bayes parameter for the Polya-Gamma variable. Defaults to 0.2.
The Dirichlet prior
returns samples for protein allocations, log likelihoods and probabilities
returns outlier probabilities
returns outlier allocations
returns covariance of organelles using marker proteins
returns the Polya-Gamma prior
returns A sample of the weights using Polya-Gamma priors.
returns A sample of the weights using Dirichlet prior.
library(pRolocdata)
data("tan2009r1")
covOrganelle(object = tan2009r1)
#> Cytoskeleton ER Golgi Lysosome Nucleus
#> Cytoskeleton 0.014786342 -0.0160860113 -0.018799752 0.003876995 0.024366324
#> ER -0.016086011 0.0317329860 0.018207736 0.004640893 -0.015961969
#> Golgi -0.018799752 0.0182077362 0.028318258 -0.003761787 -0.021176262
#> Lysosome 0.003876995 0.0046408927 -0.003761787 0.008149294 0.020192427
#> Nucleus 0.024366324 -0.0159619693 -0.021176262 0.020192427 0.080338719
#> PM -0.004121962 -0.0006152607 0.002974068 -0.006193553 -0.019240322
#> Peroxisome 0.014750959 0.0027111740 -0.014536207 0.020074195 0.058467555
#> Proteasome 0.011652809 -0.0172516837 -0.017202148 -0.001754042 0.007039362
#> Ribosome 40S 0.016964272 -0.0148680345 -0.016841793 0.010022437 0.045555104
#> Ribosome 60S 0.003711893 0.0028966465 -0.001619015 0.007937383 0.023094984
#> mitochondrion 0.023726451 -0.0266340295 -0.028297884 0.006807311 0.043398617
#> PM Peroxisome Proteasome Ribosome 40S
#> Cytoskeleton -0.0041219617 0.0147509589 0.0116528089 0.016964272
#> ER -0.0006152607 0.0027111740 -0.0172516837 -0.014868034
#> Golgi 0.0029740678 -0.0145362070 -0.0172021478 -0.016841793
#> Lysosome -0.0061935533 0.0200741955 -0.0017540418 0.010022437
#> Nucleus -0.0192403218 0.0584675554 0.0070393616 0.045555104
#> PM 0.0052978377 -0.0162588852 0.0007402262 -0.010015871
#> Peroxisome -0.0162588852 0.0521191289 0.0001045974 0.031003185
#> Proteasome 0.0007402262 0.0001045974 0.0130315816 0.008166531
#> Ribosome 40S -0.0100158709 0.0310031846 0.0081665307 0.027263829
#> Ribosome 60S -0.0066901708 0.0202529689 -0.0025125814 0.011471407
#> mitochondrion -0.0076343091 0.0256585993 0.0176320443 0.029279886
#> Ribosome 60S mitochondrion
#> Cytoskeleton 0.003711893 0.023726451
#> ER 0.002896646 -0.026634030
#> Golgi -0.001619015 -0.028297884
#> Lysosome 0.007937383 0.006807311
#> Nucleus 0.023094984 0.043398617
#> PM -0.006690171 -0.007634309
#> Peroxisome 0.020252969 0.025658599
#> Proteasome -0.002512581 0.017632044
#> Ribosome 40S 0.011471407 0.029279886
#> Ribosome 60S 0.008641058 0.007351111
#> mitochondrion 0.007351111 0.038863863
library(pRolocdata)
data("tan2009r1")
set.seed(1)
tansim <- sim_dynamic(object = tan2009r1,
numRep = 6L,
numDyn = 100L)
d1 <- tansim$lopitrep
control1 <- d1[1:3]
treatment1 <- d1[4:6]
out <- pg_prior(object_cond1 = control1,
object_cond2 = treatment1, K = 11)