View source: R/functions_fetch_bam.R
harmonize_seqlengths | R Documentation |
ensures compatibility between seqlength of gr and bam_file based on header
harmonize_seqlengths(query_gr, bam_file, force_fix = FALSE)
query_gr |
GRanges, object to harmonize seqlengths for |
bam_file |
character, a path to a valid bam file |
force_fix |
Logical, if TRUE incompatible seqnames are removed from the query_gr. Default is FALSE. |
GRanges with seqlengths matching bam_file
library(GenomicRanges)
query_gr = GRanges("chr1", IRanges(1, 100))
#seqlengths has not been set
seqlengths(query_gr)
bam = system.file("extdata/test.bam", package = "seqsetvis")
gr2 = harmonize_seqlengths(query_gr, bam)
#seqlengths now set
seqlengths(gr2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.