R/machinelearning-framework-map.R
, R/machinelearning-functions-tagm-map.R
tagm-map.Rd
These functions implement the T augmented Gaussian mixture (TAGM) model for mass spectrometry-based spatial proteomics datasets using the maximum a posteriori (MAP) optimisation routine.
# S4 method for MAPParams
show(object)
logPosteriors(x)
tagmMapTrain(
object,
fcol = "markers",
method = "MAP",
numIter = 100,
mu0 = NULL,
lambda0 = 0.01,
nu0 = NULL,
S0 = NULL,
beta0 = NULL,
u = 2,
v = 10,
seed = NULL
)
tagmMapPredict(
object,
params,
fcol = "markers",
probJoint = FALSE,
probOutlier = TRUE
)
An MSnbase::MSnSet
containing the spatial
proteomics data to be passed to tagmMapTrain
and
tagmPredict
.
An object of class `MAPParams`.
The feature meta-data containing marker definitions.
Default is markers
.
A charachter()
describing the inference method for
the TAGM algorithm. Default is "MAP"
.
The number of iterations of the expectation-maximisation algorithm. Default is 100.
The prior mean. Default is colMeans
of the expression
data.
The prior shrinkage. Default is 0.01.
The prior degreed of freedom. Default is
ncol(exprs(object)) + 2
The prior inverse-wishary scale matrix. Empirical prior used by default.
The prior Dirichlet distribution concentration. Default is 1 for each class.
The prior shape parameter for Beta(u, v). Default is 2
The prior shape parameter for Beta(u, v). Default is 10.
The optional random number generator seed.
An instance of class MAPParams
, as generated by
tagmMapTrain()
.
A logical(1)
indicating whether to return the
joint probability matrix, i.e. the probability for all classes
as a new tagm.map.joint
feature variable.
A logical(1)
indicating whether to return the
probability of being an outlier as a new tagm.map.outlier
feature variable. A high value indicates that the protein is
unlikely to belong to any annotated class (and is hence
considered an outlier).
tagmMapTrain
returns an instance of class MAPParams()
.
tagmPredict
returns an instance of class
MSnbase::MSnSet
containing the localisation predictions as
a new tagm.map.allocation
feature variable.
The tagmMapTrain
function generates the MAP parameters (object or class
MAPParams
) based on an annotated quantitative spatial proteomics dataset
(object of class MSnbase::MSnSet
). Both are then passed to the
tagmPredict
function to predict the sub-cellular localisation of protein
of unknown localisation. See the pRoloc-bayesian vignette for details and
examples. In this implementation, if numerical instability is detected in
the covariance matrix of the data a small multiple of the identity is
added. A message is printed if this conditioning step is performed.
method
A character()
storing the TAGM method name.
priors
A list()
with the priors for the parameters
seed
An integer()
with the random number generation seed.
posteriors
A list()
with the updated posterior parameters
and log-posterior of the model.
datasize
A list()
with details about size of data
A Bayesian Mixture Modelling Approach For Spatial Proteomics Oliver M Crook, Claire M Mulvey, Paul D. W. Kirk, Kathryn S Lilley, Laurent Gatto bioRxiv 282269; doi: https://doi.org/10.1101/282269
The plotEllipse()
function can be used to visualise
TAGM models on PCA plots with ellipses. The tagmMapTrain()
function to use the TAGM MAP method.