Learn R Programming

RJaCGH (version 1.2.5)

relabelStates: Relabelling of hidden states to biological states of alteration.

Description

For every model, each hidden state is assigned to a state of copy number alteration ('normal', 'loss1', 'loss2', 'gain1', 'gain2'...)

Usage

relabelStates(obj, normal.reference = 0, normal.ref.percentile = 0.95, auto.label = NULL)
## S3 method for class 'RJaCGH':
relabelStates(obj, normal.reference = 0,
normal.ref.percentile = 0.95, auto.label = NULL)
## S3 method for class 'RJaCGH.Chrom':
relabelStates(obj, normal.reference = 0,
normal.ref.percentile = 0.95, auto.label = NULL)
## S3 method for class 'RJaCGH.genome':
relabelStates(obj, normal.reference = 0,
normal.ref.percentile = 0.95, auto.label = NULL)
## S3 method for class 'RJaCGH.array':
relabelStates(obj, normal.reference = 0,
normal.ref.percentile = 0.95, auto.label = NULL)

Arguments

obj
An object returned form RJaCGH of class 'RJaCGH', 'RJaCGH.Chrom', 'RJaCGH.genome', 'RJaCGH.array'.
normal.reference
The value considered as the mean of the normal state. See details. By default is 0.
normal.ref.percentile
Percentage for the relabelling of states. See details. by default is 0.95.
auto.label
If not NULL, should be the minimum proportion of observations labeled as 'Normal'. See details.

Value

  • An object of the same class as obj with hidden states relabelled.

Details

A relabelling of hidden states is performed to match biological states. The states that have the normal.reference value inside a normal.ref.percentile% probability interval based on a normal distribution with means the median of mu and sd the square root of the median of sigma.2 are labelled as 'Normal'. If no state is close enough to normal.reference then there will not be a normal state. Bear this in mind for normalization issues. If auto.label is not null, closest states to 'Normal' are also labelled as 'Normal' until a proportion of auto.label is reached. Please note that the default value is 0.60, so at least the 60% of the observations will be labelled as 'Normal'. If this laeblling is not satisfactory, you can relabel manually. See the example.

References

Rueda OM, Diaz-Uriarte R. Flexible and Accurate Detection of Genomic Copy-Number Changes from aCGH. PLoS Comput Biol. 2007;3(6):e122

See Also

RJaCGH

Examples

Run this code
y <- c(rnorm(100, 0, 1), rnorm(10, -3, 1), rnorm(20, 3, 1),
       rnorm(100,0, 1)) 
Pos <- sample(x=1:500, size=230, replace=TRUE)
Pos <- cumsum(Pos)
Chrom <- rep(1:23, rep(10, 23))

jp <- list(sigma.tau.mu=rep(0.05, 4), sigma.tau.sigma.2=rep(0.03, 4),
           sigma.tau.beta=rep(0.07, 4), tau.split.mu=0.1, tau.split.beta=0.1)

fit.chrom <- RJaCGH(y=y, Pos=Pos, Chrom=Chrom, model="Chrom",
                    burnin=10, TOT=1000, k.max = 4,
                    jump.parameters=jp)
plot(fit.chrom)
fit.chrom.2 <- relabelStates(fit.chrom, normal.reference=3)
plot(fit.chrom.2)

## Manual labelling
fit.chrom.2[[1]][[2]]$state.labels <- c("Normal", "Normal")

Run the code above in your browser using DataLab