View source: R/dataprocessing_functions.R
getCNbins.bin | R Documentation |
This is a helper function for transforming segment tables to bin tables
getCNbins.bin(b, pb, overlap, samples)
b |
bin number |
pb |
matrix with genomic positions of bins |
overlap |
table with overlaps between bin and segment table |
samples |
vector with sample names |
a list of copy-number values per 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_bin <- getCNbins.bin(b=2,pb,overlap,samples=samp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.