man/copynumberAccessors.Rd
69ec8644
 \name{copynumberAccessors}
 \alias{CA}
 \alias{CB}
6a6b67c5
 \alias{nuA}
 \alias{nuB}
 \alias{phiA}
 \alias{phiB}
df2226f0
 \alias{totalCopynumber}
0621b63a
 \alias{rawCopynumber}
69ec8644
 
 \title{
 
 	Accessors for allele-specific or total copy number
 
 }
 
 
 \description{
 
 These methods can be applied after an object of class \code{CNSet} has
 been generated by the \code{crlmmCopynumber} function.
 
 }
 \usage{
 CA(object, ...)
 CB(object, ...)
96479df0
 nuA(object)
 nuB(object)
 phiA(object)
 phiB(object)
df2226f0
 totalCopynumber(object,...)
0621b63a
 rawCopynumber(object,...)
69ec8644
 }
 
 \arguments{
df2226f0
   \item{object}{  An object of class \code{CNSet}.}
69ec8644
   \item{\dots}{
   An additional argument named 'i' can be passed to subset the markers
   and an argument 'j' can be passed to subset the samples.  Other
   arguments are ignored.
df2226f0
   }
69ec8644
 }
 
 \details{
 
96479df0
 	At polymorphic markers, nuA and nuB provide the intercept
 	coefficient (the estimated background intensity) for the A and
 	B alleles, respectively. phiA and phiB provide the slope
 	coefficients for the A and B alleles, respectively.
 
 	At nonpolymorphic markers, nuB and phiB are 'NA'.
 
69ec8644
 	These functions can be used to tranlate the normalized
 	intensities to the copy number scale.  Plotting the copy
 	number estimates as a function of physical position can be
 	used to guide downstream algorithms that smooth, as well as to
 	assess possible mosaicism.
 
96479df0
 
69ec8644
 }
96479df0
 
69ec8644
 \value{
96479df0
 
 	nu[A/B] and phi[A/B] return matrices of the intercept and
6dc7b945
 	slope coefficients, respectively.
96479df0
 
6dc7b945
 	CA and CB return matrices of allele-specific copy number.
96479df0
 
0621b63a
 	totalCopynumber (or rawCopynumber) returns a matrix of CA+CB.
96479df0
 
f8f2b803
       }
 
 \note{
 
 Subsetting the \code{CNSet} object before extracting copy number can be
 very inefficient when the data set is very large, particularly if using
8be0a109
 ff objects.  The \code{[} method will subset all of the assay data
f8f2b803
 elements and all of the elements in the LinearModelParameter slot.
 
69ec8644
 }
 
8be0a109
 
69ec8644
 \seealso{
df2226f0
 
 	\code{\link{crlmmCopynumber}}, \code{\link{CNSet-class}}
 
69ec8644
 }
df2226f0
 
69ec8644
 \examples{
7c0c9ac5
 \dontrun{
cceffc9c
 data(cnSetExample)
 all(isCurrent(cnSetExample)) ## is the cnSet object current?
69ec8644
 
 ## --------------------------------------------------
 ## calculating allele-specific copy number
 ## --------------------------------------------------
 ## copy number for allele A, first 5 markers, first 2 samples
cceffc9c
 (ca <- CA(cnSetExample, i=1:5, j=1:2))
69ec8644
 ## copy number for allele B, first 5 markers, first 2 samples
cceffc9c
 (cb <- CB(cnSetExample, i=1:5, j=1:2))
69ec8644
 ## total copy number for first 5 markers, first 2 samples
 (cn1 <- ca+cb)
 
 ## total copy number at first 5 nonpolymorphic loci
cceffc9c
 index <- which(!isSnp(cnSetExample))[1:5]
 cn2 <- CA(cnSetExample, i=index, j=1:2)
69ec8644
 ## note, cb is NA at nonpolymorphic loci
cceffc9c
 (cb <- CB(cnSetExample, i=index, j=1:2))
69ec8644
 ## note, ca+cb will give NAs at nonpolymorphic loci
cceffc9c
 CA(cnSetExample, i=index, j=1:2) + cb
69ec8644
 ## A shortcut for total copy number
cceffc9c
 cn3 <- totalCopynumber(cnSetExample, i=1:5, j=1:2)
69ec8644
 all.equal(cn3, cn1)
cceffc9c
 cn4 <- totalCopynumber(cnSetExample, i=index, j=1:2)
69ec8644
 all.equal(cn4, cn2)
 
 ## markers 1-5, all samples
cceffc9c
 cn5 <- totalCopynumber(cnSetExample, i=1:5)
69ec8644
 ## all markers, samples 1-5
cceffc9c
 cn6 <- totalCopynumber(cnSetExample, j=1:2)
7c0c9ac5
 }
69ec8644
 }
 \keyword{manip}