Skip to contents

Annotates CNV segments with cytoband and gene overlap information.

Usage

AnnotateSegments(input, out_dir, prefix, cytoband, whitelist_edge, gene)

Arguments

input

Path to merged segment file (TSV).

out_dir

Output directory.

prefix

Output file prefix.

cytoband

Path to cytoband annotation file (TSV).

whitelist_edge

Path to detectable edge file for cytoband annotation.

gene

Path to gene annotation file.

Value

Invisibly returns the annotated data frame with cytoband and gene annotation columns.

Details

For each segment, the function calculates the gaps between the segment boundaries and the detectable p and q arm region start/end sites (using cytoband and whitelist edge files). For acrocentric chromosomes, only the q arm boundaries are considered. Based on the size of these gaps, the function determines the event type and returns:

  • a cytoband range (combination of start and stop cytoband),

  • a p-arm or q-arm only event,

  • or, if the event spans the whole chromosome, just the chromosome name (chromosome-level event).

Gene overlap information is also added for each segment.

Examples

AnnotateSegments(
  input = "sample_CNV_final.tsv",
  out_dir = "results/",
  prefix = "Sample1",
  cytoband = "data/cytoBand.txt",
  whitelist_edge = "data/whitelist.txt",
  gene = "data/gene_anno.txt"
)
#> Warning: cannot open file 'data/whitelist.txt': No such file or directory
#> Error in file(file, "rt"): cannot open the connection