biocLite("crlmm") biocLite("genomewidesnp6Crlmm") biocLite("hapmapsnp6") if (require(genomewidesnp6Crlmm) & require(hapmapsnp6)){ path <- system.file("celFiles", package="hapmapsnp6") ## the filenames with full path... ## very useful when genotyping samples not in the working directory cels <- list.celfiles(path, full.names=TRUE) (crlmmOutput <- crlmm(cels)) } ## accessors ##genotype calls str(calls(crlmmOutput)) ## smoothing copy number with CBS biocLite("DNAcopy") ## follow the vignette library(DNAcopy) ## load in data and explore data(coriell) head(coriell) ## number of clones on each chromosome table(coriell$Chromosome) ## make a CNA object and smooth CNA.object <- CNA(cbind(coriell$Coriell.05296), coriell$Chromosome, coriell$Position, data.type = "logratio", sampleid = "c05296") smoothed.CNA.object <- smooth.CNA(CNA.object) ## segmentation segment.smoothed.CNA.object <- segment(smoothed.CNA.object, verbose = 1) ## plot it plot(segment.smoothed.CNA.object, plot.type = "w") ## plot by chromosome plot(segment.smoothed.CNA.object, plot.type = "s") plot(segment.smoothed.CNA.object, plot.type = "p") ## remove small change points sdundo.CNA.object <- segment(smoothed.CNA.object, undo.splits = "sdundo", undo.SD = 3, verbose = 1) plot(sdundo.CNA.object, plot.type = "s") ## change points in chr4 and 21 are removed