## Not run:
# data(cnSetExample)
# all(isCurrent(cnSetExample)) ## is the cnSet object current?
#
# ## --------------------------------------------------
# ## calculating allele-specific copy number
# ## --------------------------------------------------
# ## copy number for allele A, first 5 markers, first 2 samples
# (ca <- CA(cnSetExample, i=1:5, j=1:2))
# ## copy number for allele B, first 5 markers, first 2 samples
# (cb <- CB(cnSetExample, i=1:5, j=1:2))
# ## total copy number for first 5 markers, first 2 samples
# (cn1 <- ca+cb)
#
# ## total copy number at first 5 nonpolymorphic loci
# index <- which(!isSnp(cnSetExample))[1:5]
# cn2 <- CA(cnSetExample, i=index, j=1:2)
# ## note, cb is NA at nonpolymorphic loci
# (cb <- CB(cnSetExample, i=index, j=1:2))
# ## note, ca+cb will give NAs at nonpolymorphic loci
# CA(cnSetExample, i=index, j=1:2) + cb
# ## A shortcut for total copy number
# cn3 <- totalCopynumber(cnSetExample, i=1:5, j=1:2)
# all.equal(cn3, cn1)
# cn4 <- totalCopynumber(cnSetExample, i=index, j=1:2)
# all.equal(cn4, cn2)
#
# ## markers 1-5, all samples
# cn5 <- totalCopynumber(cnSetExample, i=1:5)
# ## all markers, samples 1-5
# cn6 <- totalCopynumber(cnSetExample, j=1:2)
# ## End(Not run)
Run the code above in your browser using DataLab