View source: R/dataprocessing_functions.R
| getCNbins.sample | R Documentation |
This is a helper function for transforming segment tables to bin tables
getCNbins.sample(s, cn)
s |
sample name |
cn |
matrix with copy numbers in a bin (row) in samples (columns) |
a vector with copy numbers of samples in one bin
posBins <- lapply(1,function(chr)
getBinsStartsEnds(window=1000000, chr, lengthChr[chr]))
pb=data.table::rbindlist(posBins)
samp=unique(cells_segcn$sample)[1]
data=cells_segcn[cells_segcn$sample==samp,]
data<-data.table::as.data.table(data[,c(5,4,1:3)])
data.table::setkey(pb, chromosome, start, end)
overlap=as.data.frame(data.table::foverlaps(data,pb))
cn=overlap[(overlap$chromosome=="1" & overlap$start==1 & overlap$end==500000),]
cell_bin=getCNbins.sample(s=samp,cn)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.