pREC_A: Probabilistic Common Regions for copy number alteration.

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/RJaCGH.R

Description

This method compute regions of gain/lost copy number with a joint probability of alteration greater than a given threshold.

Usage

1
2
pREC_A(obj, p, alteration = "Gain", array.weights = NULL,
       verbose = FALSE)

Arguments

obj

An object of class 'RJaCGH', 'RJaCGH.Chrom', 'RJaCGH.Genome' or 'RJaCGH.array'.

p

Threshold for the minimum joint probability of alteration of the region.

alteration

Either 'Gain' or 'Lost'

array.weights

When 'obj' contains several arrays, the user can give a weight to each of them according to their reliability or precision.

verbose

If TRUE provide more details on what is being done, including intermediate output from the C functions themselves. Only helpful for debugging or if you are bored; this will often write more output than you want.

Details

RJaCGH can compute common regions taking into account the probability of every probe to have an altered copy number. The result is a set of probes whose joint probability (not the product of their marginal probabilities, as returned by states or modelAveraging) is at least as p or greater.

Please note that if the method returns several sets or regions, the probability of alteration of all of them doesn't have to be over the probability threshold; in other words p is computed for every region, not for all the sequence of regions.

Writing the files with the Vitterbi sequence to disk will be done by default if RJaCGH was run with the default "delete\_gzipped = TRUE" (which will happen if the global flag ".\_\_DELETE\_GZIPPED" is TRUE). To preserve disk space, as soon as the gzipped files are read into R (and incorporated into the RJaCGH object), by default they are deleted from disk. Sometimes, however, you might want not to delete them from disk; for instance, if you will continue working from this directory, and you want to save some CPU time. If the files exist in the directory when you call pREC there is no need to write them from R to disk, which allows you to save the time in the "writeBin" calls inside pREC. In this case, you would run RJaCGH with "delete\_gzipped = FALSE". Now, if for some reason those files are no longer available (you move directories, you delete them, etc), you should set "force.write.files = TRUE" (pREC will let you know if you need to do so).

delete.rewritten helps prevent cluttering the disk. Files with the Viterbi sequence will be written to disk, read by C, and then deleted. Again, no information is lost, since the sequences are stored as part of the RJaCGH object. Note, however, that if you run RJaCGH with ".\_\_DELETE\_GZIPPED <- FALSE" this option has no effect, because it is implicit that you wanted, from the start, to preserve the files. In other words, "delete.rewritten" only has any effect if you either used "force.write.files = TRUE" or if you originally run RJaCGH without preserving the files in disk.

Value

An object of class pREC_A.none or pREC_A.Chromosomes, depending on whether or not the original RJaCGH had, or not, a Chromosomes component (the later only when the original object was of neither "RJaCGH.Chrom" or "RJaCGH.Genome").

They are lists with a sublist for every region encountered and elements:

start

Start position of the region.

indexStart

index position of the start of the region.

indexEnd

index position of the end of the region.

end

End position of the region.

genes

Number of genes in the region.

prob

Joint probability of gain/loss of the region.

If there are chromosome information (that is, the object inputed is of class RJaCGH.Chrom, RJaCGH.Genome or RJaCGH.array with each array of any of these classes), then this information will be enclosed in a list for each chromosome.

Note

There have been major changes in how pREC is implemented. For details, see "Implementing\_pREC\_in\_C.pdf".

Author(s)

Oscar M. Rueda and Ramon Diaz Uriarte

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, states, modelAveraging, print.pREC_A pREC_S

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## MCR for a single array:
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.genome <- RJaCGH(y=y, Pos=Pos, Chrom=Chrom, model="Genome",
burnin=1000, TOT=1000, jump.parameters=jp, k.max = 4)
pREC_A(fit.genome, p=0.8, alteration="Gain")
pREC_A(fit.genome, p=0.8, alteration="Loss")

##MCR for two arrays:
z <- c(rnorm(110, 0, 1), rnorm(20, 3, 1),
       rnorm(100,0, 1)) 
fit.array.genome <- RJaCGH(y=cbind(y,z), Pos=Pos, Chrom=Chrom, model="Genome",
burnin=1000, TOT=1000, jump.parameters=jp, k.max = 4)
pREC_A(fit.array.genome, p=0.4, alteration="Gain")
pREC_A(fit.array.genome, p=0.4, alteration="Loss")

RJaCGH documentation built on May 2, 2019, 3:34 p.m.

Related to pREC_A in RJaCGH...