harmonize_seqlengths: Forces seqlengths in GRanges to be that in header of bam_file

View source: R/functions_scc.R

harmonize_seqlengthsR Documentation

Forces seqlengths in GRanges to be that in header of bam_file

Description

This is important to avoid errors while using the gr to query the bam_file.

Usage

harmonize_seqlengths(gr, bam_file)

Arguments

gr

GRanges

bam_file

bam_file

Value

GRanges with seqlengths matching bam_file

Examples

peak_files = dir(system.file("extdata", package = "seqqc"), pattern = "Peak$", full.names = TRUE)
peak_grs = seqsetvis::easyLoad_narrowPeak(peak_files)
query_gr = resize(seqsetvis::ssvOverlapIntervalSets(peak_grs), 6e2, fix = "center")

bam_files = dir(system.file("extdata", package = "seqqc"), pattern = "^M.+bam$", full.names = TRUE)

query_gr.harmonized = seqqc:::harmonize_seqlengths(query_gr, bam_files[1])
seqlengths(query_gr.harmonized)


FrietzeLabUVM/ssvQC documentation built on March 25, 2024, 12:24 a.m.