paf2coords: Prepare PAF alignments for plotting.

View source: R/pafToCoords.R

paf2coordsR Documentation

Prepare PAF alignments for plotting.

Description

This function takes loaded PAF alignments using readPaf function. Such alignment could be post-processed using filterPaf, breakPaf and flipPaf functions. Subsequently such alignments are expanded in a set of x and y coordinates ready to be plotted by geom_miropeats function.

Usage

paf2coords(
  paf.table,
  offset.alignments = FALSE,
  sync.x.coordinates = TRUE,
  q.range = NULL,
  t.range = NULL,
  add.col = NULL
)

Arguments

paf.table

A data.frame or tibble containing a single or multiple PAF record(s) with 12 mandatory columns along with CIGAR string defined in 'cg' column.

offset.alignments

Set to TRUE if subsequent target alignments should be offsetted below and above the midline.

sync.x.coordinates

If set to TRUE query coordinates will be adjusted to the limits of target coordinates. (Default : 'TRUE')

q.range

A vector containing min and max value for a query range.

t.range

A vector containing min and max value for a target range.

add.col

A user defined column name present in 'paf.table' to be added in returned coordinates table.

Value

A tibble of PAF alignments reported as x and y coordinate values.

Author(s)

David Porubsky

Examples

## Get PAF to process ##
paf.file <- system.file("extdata", "test1.paf", package = "SVbyEye")
## Read in PAF
paf.table <- readPaf(paf.file = paf.file, include.paf.tags = TRUE, restrict.paf.tags = "cg")
## Convert PAF alignments to x and y coordinates needed for plotting
paf2coords(paf.table = paf.table)
## Include optional an column to be exported as well (e.g. alignment specific GC content)
paf.table$GC.content <- round(runif(nrow(paf.table), min = 30, max = 60), digits = 2)
paf2coords(paf.table = paf.table, add.col = "GC.content")


daewoooo/SVbyEye documentation built on Oct. 15, 2024, 6:12 a.m.