From Matched Measurements to Shared Clusters
When RNA and protein measurements are collected on the same biological samples, a joint clustering analysis can ask whether both modalities support a common partition of those samples. The key modeling choice is to give each sample one latent cluster label, while allowing RNA and protein to have different cluster-specific profiles. This is not the same as assuming that the two modalities have identical measurements or identical noise.
The analysis below uses a small hypothetical data set with two standardized RNA features and two standardized protein features measured on each sample. Standardization puts the features on comparable scales for this example; it does not make their measurement errors equal or guarantee that a Gaussian model is appropriate. In an application, matching sample identifiers and checking the preprocessing are prerequisites to fitting any joint model.
A Joint Gaussian Mixture Model
For a concrete specification, suppose there are \(n\) matched samples, \(p\) RNA features, \(q\) protein features, and a fixed number \(K\) of clusters. Let the mixing proportions be \(\boldsymbol{\pi}=(\pi_1,\ldots,\pi_K)\), with \(\pi_k\geq0\) and \(\sum_k\pi_k=1\). Assume \(z_i\mid\boldsymbol{\pi}\sim\text{Categorical}(\boldsymbol{\pi})\). Conditional on \(z_i=k\), take the features to be independent Gaussian measurements:
Here \(R\) denotes RNA and \(P\) denotes protein. Variances are feature-specific and shared across clusters in this basic model; the means are cluster-specific. Conditional independence means that, given the cluster label and model parameters, the likelihood factors across features and modalities. It is a substantive assumption, not a consequence of measuring the modalities on the same samples.
The complete-data likelihood, including the labels, is
where \(f_N(\cdot;\mu,\sigma^2)\) is the normal density with mean \(\mu\) and variance \(\sigma^2\). One possible prior specification is \(\boldsymbol{\pi}\sim\text{Dirichlet}(\alpha_1,\ldots,\alpha_K)\), independent normal priors on the cluster means, and independent inverse-gamma priors on the feature variances. The prior hyperparameters must be chosen on scales appropriate to the standardized data and examined for sensitivity.
The Bayesian target is the posterior distribution of labels and parameters given the observed data:
A fit can be obtained with the earlier material on Gibbs sampling for joint cluster assignments, collapsed sampling, or variational inference. Regardless of the fitting method, the number of clusters, priors, data preprocessing, and likelihood assumptions define what the posterior means. Since mixture labels are interchangeable, label-specific summaries require consistent alignment of labels across retained draws, as in the earlier material on label switching.
Why the Joint Assignment Has This Form
For fixed parameters, the conditional probability that sample \(i\) belongs to cluster \(k\) is proportional to its prior cluster probability times its RNA and protein likelihoods. Normalizing over all clusters gives
where \(L^{(R)}_{ik}\) and \(L^{(P)}_{ik}\) are the products of the corresponding feature densities. This expression follows directly from Bayes' rule: the numerator is the joint density of the observations and label \(k\), and the denominator sums that quantity over all possible labels. In computation, log densities are generally used to avoid numerical underflow.
With two clusters, equal mixing proportions, and unit variances for every feature, suppose every cluster-1 mean is \(-0.8\) and every cluster-2 mean is \(+0.8\). The conditional log posterior odds for cluster 2 versus cluster 1 simplify to
where \(\theta\) denotes the fixed parameters. To verify the feature contribution, the log density ratio for one observed value \(v\) is \(\{(v+0.8)^2-(v-0.8)^2\}/2=1.6v\). Summing those ratios across RNA and protein features gives the displayed expression. This derivation shows how evidence accumulates under the conditional-independence assumption; it does not establish that the features are truly independent.
Worked Example: Conditional Assignment for a Matched Sample
Use the two-cluster parameters just specified. A hypothetical sample A has RNA values \(0.6,0.3\) and protein values \(0.4,0.1\). Calculate its conditional probability of cluster 2.
The sum of its four feature values is \(0.6+0.3+0.4+0.1=1.4\). Therefore the log posterior odds are \(1.6(1.4)=2.24\), and the posterior odds are \(\exp(2.24)\approx9.40\). With equal mixing proportions, the posterior probability is
Thus, conditional on these parameter values, sample A has about a 0.904 probability of cluster 2. This is not yet a probability averaged over uncertainty in the means, variances, and mixing proportions; that distinction matters when reporting results from a full Bayesian fit.
Worked Analysis of a Small Matched Data Set
The following hypothetical observations use the same two RNA and two protein features. For transparent arithmetic, take the fitted representative parameter values from the preceding section. The table gives the conditional probability of cluster 2 at those values, calculated from the log-odds formula. These calculations demonstrate the likelihood and assignment mechanics; actual reported Bayesian assignments should integrate parameter uncertainty using posterior draws.
| Sample | RNA values | Protein values | Sum of four values | Conditional \(P(z_i=2\mid x_i,y_i,\theta)\) |
|---|---|---|---|---|
| A | 0.6, 0.3 | 0.4, 0.1 | 1.4 | 0.904 |
| B | 0.7, 0.4 | -0.2, -0.1 | 0.8 | 0.782 |
| C | -0.4, -0.6 | -0.5, -0.3 | -1.8 | 0.0531 |
| D | 0.1, -0.1 | 0.05, -0.05 | 0 | 0.500 |
| E | 0.4, 0.2 | -0.5, -0.4 | -0.3 | 0.382 |
Worked Example: Reading a Conflicting RNA and Protein Signal
For sample E, the RNA values sum to \(0.4+0.2=0.6\), while the protein values sum to \(-0.5-0.4=-0.9\). Under the stated model, the RNA log-odds contribution is \(1.6(0.6)=0.96\), and the protein contribution is \(1.6(-0.9)=-1.44\). The combined log odds are \(0.96-1.44=-0.48\), so
RNA favors cluster 2 and protein favors cluster 1, but the protein contribution is larger in magnitude under these model parameters. The joint conditional probability therefore favors cluster 1, without implying certainty or a causal relationship. This decomposition is useful for interpretation, but it inherits the model's feature-independence and equal-variance assumptions.
From Conditional Probabilities to Posterior Assignments
In a full fit, parameters are unknown. If \(M\) retained, label-aligned posterior draws are available, a posterior assignment probability can be estimated by the fraction of draws assigning sample \(i\) to cluster \(k\):
where \(I(\cdot)\) is 1 when its argument is true and 0 otherwise. Each draw reflects uncertainty in labels and parameters jointly. The most probable cluster may be reported as a concise summary, but the probability itself should accompany it when uncertainty is meaningful.
Worked Example: Summarizing Posterior Draws
Suppose a hypothetical, converged, label-aligned run retains \(M=2{,}000\) draws. Sample B is assigned to cluster 2 in 1,558 draws and to cluster 1 in 442 draws. Its estimated posterior assignment probabilities are
The estimated probability difference is \(0.779-0.221=0.558\), so cluster 2 is the modal assignment, with appreciable remaining uncertainty. The value 0.779 is a Monte Carlo estimate of a posterior probability, not a frequentist confidence level. It can vary with finite simulation, so convergence and Monte Carlo precision must be assessed before treating small differences as meaningful.
Checks, Alternatives, and Limits
A credible analysis checks both the computation and the adequacy of the model. The earlier material on convergence diagnostics for clustered omics chains provides tools for assessing mixing and Monte Carlo stability. For this application, inspect trace behavior for cluster proportions and representative means, compare assignment summaries across chains after label alignment, and examine whether small clusters or near-empty clusters recur. Posterior predictive checks ask whether replicated data from the fitted model reproduce important features of the observed matched data.
For example, compare observed and replicated within-cluster feature spreads, RNA-protein discordance, and marginal distributions for each feature. If replicated data systematically show less cross-modality disagreement than the observed data, the conditional-independence/shared-label specification may be too restrictive. Strong within-modality correlations can also make a product of independent feature likelihoods overstate the amount of evidence. A useful check is to compare residual correlations within inferred clusters with those in posterior predictive replicates.
The shared-label model is attractive when the scientific target is one joint partition. Separate modality-specific clustering allows different partitions and can reveal that no single grouping is supported across layers; it does not directly answer the same shared-cluster question. A model that explicitly represents cross-modal dependence can be more flexible, but requires additional parameters and stronger data support. Model choice should follow the scientific target and the observed fit, not a presumption that integration is always preferable.
Important limitations remain. The number \(K\) is fixed in this specification; choosing it requires separate model assessment. Gaussian feature distributions may be poor for counts, heavy-tailed measurements, or outliers. Standardizing features does not remove batch effects, dependence, or errors in sample matching. Finally, a shared label forces a common grouping even when RNA and protein genuinely indicate different structures. Posterior probabilities quantify uncertainty within the chosen model; they do not measure uncertainty about every possible modeling assumption.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- Under the two-cluster, unit-variance model, a sample has four feature values that sum to \(0.5\). What are its conditional log odds for cluster 2 versus cluster 1, and its conditional probability of cluster 2?
- A sample has posterior assignment probabilities 0.52 for cluster 1 and 0.48 for cluster 2. Why is reporting only its modal cluster potentially misleading?
- Why does a shared-cluster model not imply that RNA and protein features have the same cluster means?
- What does a posterior predictive check assess, and name one data feature that could be checked in this setting.
Solutions. 1. The log odds are \(1.6(0.5)=0.8\). Thus \(P(z_i=2\mid x_i,y_i,\theta)=\exp(0.8)/(1+\exp(0.8))\approx0.690\). 2. Cluster 1 is only slightly more probable; the 0.52 probability indicates substantial assignment uncertainty, hidden by a hard label alone. 3. The shared label represents one sample-level grouping, while the model has separate modality-specific means \(\mu^{(R)}_{kj}\) and \(\mu^{(P)}_{k\ell}\). 4. It assesses whether data replicated from the fitted posterior predictive distribution resemble relevant aspects of the observed data; for example, one can compare within-cluster feature spreads or RNA-protein discordance.