flipQueryAnnotation: Flip query annotation ranges

View source: R/addAnnotation.R

flipQueryAnnotationR Documentation

Flip query annotation ranges

Description

This function takes loaded PAF alignments using readPaf function and postprocessed using flipPaf function. In case the PAF alignments were flipped ranges defined in 'query.annot.gr' will be flipped accordingly to match query coordinates defined in 'paf.table'.

Usage

flipQueryAnnotation(paf.table, query.annot.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.

query.annot.gr

A GRanges-class object with a set of ranges in query coordinates. See function liftRangesToAlignment if coordinates need to be lifted from target space.

Value

A GRanges-class object.

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")
## Flip PAF alignments
paf.table <- flipPaf(paf.table = paf.table, force = TRUE)
## Load query annotation file
query.annot <- system.file("extdata", "test1_query_annot.txt", package = "SVbyEye")
query.annot.df <- read.table(query.annot, header = TRUE, sep = "\t", stringsAsFactors = FALSE)
query.annot.gr <- GenomicRanges::makeGRangesFromDataFrame(query.annot.df)
## Synchronize orientation of query annotation file with flipped PAF alignments
flipQueryAnnotation(paf.table = paf.table, query.annot.gr = query.annot.gr)


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