pairs2breakpointgr: Converts a breakpoint GRanges object to a Pairs object

Description Usage Arguments Details Value Examples

View source: R/BreakpointGRanges.R

Description

Converts a breakpoint GRanges object to a Pairs object

Converts a BEDPE Pairs containing pairs of GRanges loaded using to a breakpoint GRanges object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
breakpointgr2pairs(
  bpgr,
  writeQualAsScore = TRUE,
  writeName = TRUE,
  bedpeName = NULL,
  firstInPair = NULL
)

pairs2breakpointgr(
  pairs,
  placeholderName = "bedpe",
  firstSuffix = "_1",
  secondSuffix = "_2",
  nameField = "name",
  renameScoreToQUAL = TRUE
)

Arguments

bpgr

breakpoint GRanges object

writeQualAsScore

write the breakpoint GRanges QUAL field as the score fields for compatibility with BEDPE rtracklayer export

writeName

write the breakpoint GRanges QUAL field as the score fields for compatibility with BEDPE rtracklayer export

bedpeName

function that returns the name to use for the breakpoint. Defaults to the sourceId, name column, or row names (in that priority) of the first breakend of each pair.

firstInPair

function that returns TRUE for breakends that are considered the first in the pair, and FALSE for the second in pair breakend. By default, the first in the pair is the breakend with the lower ordinal in the breakpoint GRanges object.

pairs

a Pairs object consisting of two parallel genomic loci.

placeholderName

prefix to use to ensure each entry has a unique ID.

firstSuffix

first in pair name suffix to ensure breakend name uniqueness

secondSuffix

second in pair name suffix to ensure breakend name uniqueness

nameField

Fallback field for row names if the Pairs object does not contain any names. BEDPE files loaded using rtracklayer use the "name" field.

renameScoreToQUAL

renames the 'score' column to 'QUAL'. Performing this rename results in a consistent variant quality score column name for variant loaded from BEDPE and VCF.

Details

Breakpoint-level column names will override breakend-level column names.

Value

Pairs GRanges object suitable for export to BEDPE by rtracklayer

Breakpoint GRanges object.

Examples

1
2
3
4
5
6
7
vcf.file <- system.file("extdata", "gridss.vcf", package = "StructuralVariantAnnotation")
bpgr <- breakpointRanges(VariantAnnotation::readVcf(vcf.file))
pairgr <- breakpointgr2pairs(bpgr)
#rtracklayer::export(pairgr, con="example.bedpe")
bedpe.file <- system.file("extdata", "gridss.bedpe", package = "StructuralVariantAnnotation")
bedpe.pairs <- rtracklayer::import(bedpe.file)
bedpe.bpgr <- pairs2breakpointgr(bedpe.pairs)

d-cameron/StructuralVariantAnnotation documentation built on Dec. 26, 2021, 6:14 p.m.