harmonize_seqlengths: harmonize_seqlengths

Description Usage Arguments Value Examples

View source: R/functions_fetch_bam.R

Description

ensures compatibility between seqlength of gr and bam_file based on header

Usage

1
harmonize_seqlengths(gr, bam_file)

Arguments

gr

GRanges, object to harmonize seqlengths for

bam_file

character, a path to a valid bam file

Value

gr with seqlengths matching bam_file

Examples

1
2
3
4
5
6
7
8
library(GenomicRanges)
gr = GRanges("chr1", IRanges(1, 100))
#seqlengths has not been set
seqlengths(gr)
bam = system.file("extdata/test.bam", package = "seqsetvis")
gr2 = harmonize_seqlengths(gr, bam)
#seqlengths now set
seqlengths(gr2)

seqsetvis documentation built on Nov. 8, 2020, 5:57 p.m.