newBASiCS_Chain {BASiCS} | R Documentation

## Creates a BASiCS_Chain object from pre-computed MCMC chains

### Description

`BASiCS_Chain` creates a `BASiCS_Chain` object from pre-computed MCMC chains.

### Usage

    newBASiCS_Chain(parameters)

### Arguments

`parameters` | List of matrices containing MCMC chains for each model parameter. mu MCMC chain for gene-specific mean expression parameters μ_i, biological genes only (matrix with `q.bio` columns, all elements must be positive numbers) delta MCMC chain for gene-specific biological over-dispersion parameters δ_i, biological genes only (matrix with `q.bio` columns, all elements must be positive numbers) phi MCMC chain for cell-specific mRNA content normalisation parameters φ_j (matrix with `n` columns, all elements must be positive numbers and the sum of its elements must be equal to `n`) . This parameter is only used when spike-in genes are available. s MCMC chain for cell-specific technical normalisation parameters s_j (matrix with `n` columns, all elements must be positive numbers) nu MCMC chain for cell-specific random effects ν_j (matrix with `n` columns, all elements must be positive numbers) theta MCMC chain for technical over-dispersion parameter(s) θ (matrix, all elements must be positive, each colum represents 1 batch) `beta` Only used for regression model. MCMC chain for regression coefficients (matrix with `k` columns, where `k` represent the number of chosen basis functions + 2) `sigma2` Only used for regression model. MCMC chain for the residual variance (matrix with one column, sigma2 represents a global parameter) `epsilon` Only used for regression model. MCMC chain for the gene specific residual over-dispersion parameter (mean corrected vraribility) (matrix with `q` columns)

### Value

An object of class `BASiCS_Chain`.

### Author(s)

Catalina A. Vallejos cnvallej@uc.cl

Nils Eling eling@ebi.ac.uk

### See Also

`BASiCS_Chain`

### Examples

    Data <- makeExampleBASiCS_Data()

    # No regression model
    Chain <- BASiCS_MCMC(Data, N = 50, Thin = 5, Burn = 5, Regression = FALSE)

    ChainMu <- displayChainBASiCS(Chain, 'mu')
    ChainDelta <- displayChainBASiCS(Chain, 'delta')
    ChainPhi <- displayChainBASiCS(Chain, 'phi')
    ChainS <- displayChainBASiCS(Chain, 's')
    ChainNu <- displayChainBASiCS(Chain, 'nu')
    ChainTheta <- displayChainBASiCS(Chain, 'theta')

    ChainNew <- newBASiCS_Chain(parameters = list(mu = ChainMu,
                                                  delta = ChainDelta,
                                                  phi = ChainPhi,
                                                  s = ChainS,
                                                  nu = ChainNu,
                                                  theta = ChainTheta))

    # No regression model
    Chain <- BASiCS_MCMC(Data, N = 50, Thin = 5, Burn = 5, Regression = TRUE)

    ChainMu <- displayChainBASiCS(Chain, 'mu')
    ChainDelta <- displayChainBASiCS(Chain, 'delta')
    ChainPhi <- displayChainBASiCS(Chain, 'phi')
    ChainS <- displayChainBASiCS(Chain, 's')
    ChainNu <- displayChainBASiCS(Chain, 'nu')
    ChainTheta <- displayChainBASiCS(Chain, 'theta')
    ChainBeta <- displayChainBASiCS(Chain, 'beta')
    ChainSigma2 <- displayChainBASiCS(Chain, 'sigma2')
    ChainEpsilon <- displayChainBASiCS(Chain, 'epsilon')

    ChainNew <- newBASiCS_Chain(parameters = list(mu = ChainMu,
                                                  delta = ChainDelta,
                                                  phi = ChainPhi,
                                                  s = ChainS,
                                                  nu = ChainNu,
                                                  theta = ChainTheta,
                                                  beta = ChainBeta,
                                                  sigma2 = ChainSigma2,
                                                  epsilon = ChainEpsilon))

[Package BASiCS version 1.8.1 Index]