expandCircularFeatures: Splits genome features spanning annotated ends of circular...

View source: R/coor2index.R

expandCircularFeaturesR Documentation

Splits genome features spanning annotated ends of circular chromosomes.

Description

Splits genome features that span start/end coordinates of circular chromosomes, and adds the downstream half with optional modification of ID, and type values. Circular features are recognized here by start > end, in left->right direction of genome annotation. Strand information MUST NOT BE ENCODED IN start/end coordinate direction, but explicitly provided via a strand column! Note that only the upstream half retains all column information (exceptions: see argument copyCols), the downstream half will only carry information on coordinates, and optionally updated feature type and ID. The update will only happen if the passed table contains type and ID information (see argument idCols. The split can be reversed by function removeCircularFeatures.

Usage

expandCircularFeatures(
  features,
  chrL,
  coorCols = c("chr", "start", "end", "strand"),
  reverse = c("-", -1),
  idTag = "-circ2",
  idCols = c(ID = "ID", type = "type", parent = "parent"),
  copyCols = FALSE,
  insertRows = TRUE
)

Arguments

features

a list of genomic features with coordinates

chrL

obligatory list of chromosome lengths, in order used in chromosome column in features (see argument coorCols

coorCols

ordered string vector providing the column names of coordinate columns to be used; must be of length 4 and provide in order: chromosome number (refering to argument chrL), start, end, and strand (see argument reverse)

reverse

allowed indicators of reverse strand features in strand column (see argument coorCols)

idTag

tag to add to downstream ID and type

idCols

named vector of column names for feature ID, type, and feature parent; note that a "parent" column will be added if not present to refer the downstream half to its upstream feature, which retains all other information

copyCols

copy values to circular feature copy; either logical TRUE to copy all columns, or a vector of column indices or names

insertRows

insert the circular features below their parent, if set to FALSE circular features will just be appended; this saves a lot of time for large datasets

See Also

removeCircularFeatures


raim/segmenTools documentation built on Sept. 9, 2024, 5:24 p.m.