View source: R/convert_seg_to_bins.R
seg2bins | R Documentation |
convert .seg files to match a chromInfo matrix
seg2bins( cnr, seg, sample.id = "ID", bin.id = NULL, coordinates.a = c("bin.chrom", "bin.start", "bin.end"), coordinates.b = c("chrom", "loc.start", "loc.end"), seg.mean.b = "seg.mean", multipcf = TRUE )
cnr |
a cnr bundle |
seg |
a table in .seg format |
sample.id |
column name of sample ID in the .seg dat, default is "ID" |
bin.id |
column name containing a bin.id, defalt NULL, bin.id will be taken as the rownames of the data |
coordinates.a |
names of the columns containing chromosome, start, and end coordinates in the cnr |
coordinates.b |
names of the columns containing chromosome, start, and end coordinates in the seg data |
seg.mean.b |
name of column containg segment means default "seg.mean" |
multipcf |
weather to create a multi sample matrix of the .seg data or keep as run length encoding, akin to copynumber::multipcf, and copynumber::pcf, respectively. This function requires tidyr::pivot_wider |
## Not run: data(cnr) seg.data <- read.delim("path/to/data.seg") binned.seg <- seg2bins(cnr, seg.data, sample.id = "sampleID", bin.id = "bin.id") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.