seg2bins: convert .seg files to match a chromInfo matrix

View source: R/convert_seg_to_bins.R

seg2binsR Documentation

convert .seg files to match a chromInfo matrix

Description

convert .seg files to match a chromInfo matrix

Usage

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
)

Arguments

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

Examples

## 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)


SingerLab/gac documentation built on Oct. 14, 2022, 4:09 a.m.