disjoinPafAlignments: Disjoin overlapping PAF alignments.

View source: R/disjoinPafAlignments.R

disjoinPafAlignmentsR Documentation

Disjoin overlapping PAF alignments.

Description

This function takes loaded PAF alignments using readPaf function and identify overlapping genomic ranges either in target or query coordinates and then split PAF alignments at the positions of these overlaps into a disjoined set of genomic ranges. Alternatively, user defined set of genomic ranges in parameter 'disjoin.gr' can be used to disjoin PAF alignments.

Usage

disjoinPafAlignments(
  paf.table,
  min.overlap = 1000,
  coordinates = "target",
  disjoin.gr = 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.

min.overlap

A minimum number of overlapping base pairs to disjoin PAF alignments.

coordinates

PAF coordinates to disjoin, either 'target' or 'query'.

disjoin.gr

A GRanges-class object containing genomic ranges where PAF alignments will be disjoined (must be in defined 'coordinates').

Value

A tibble of disjoined PAF alignments.

Author(s)

David Porubsky

Examples

## Get PAF to plot
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")
## Disjoin PAF at target coordinates
disj.paf.table <- disjoinPafAlignments(paf.table = paf.table, coordinates = 'target')
## Disjoin PAF at user defined coordinates
disj.gr <- GenomicRanges::GRanges(seqnames = 'query.region',
                                  ranges = IRanges::IRanges(start = 16300000, end = 16350000))
disj.paf.table <- disjoinPafAlignments(paf.table = paf.table,
                                       coordinates = 'query', disjoin.gr = disj.gr)


daewoooo/SVbyEye documentation built on March 31, 2024, 8:58 a.m.