Skip to contents

This function imports genomic data from various file formats (BED, bigWig, GFF, etc.) using rtracklayer and converts it to a tidy data frame suitable for ggplot2.

Usage

import_genomic_data(file, which = NULL)

Arguments

file

Path to the genomic data file

which

GRanges object specifying the genomic region to import (default: NULL, import all)

format

File format (default: NULL, auto-detected from file extension)

Value

A tidy data frame

Examples

if (FALSE) { # \dontrun{
# Import a BED file
peaks_df <- import_genomic_data("peaks.bed")

# Import a specific region from a bigWig file
library(GenomicRanges)
region <- GRanges("chr1", IRanges(1000000, 2000000))
signal_df <- import_genomic_data("signal.bw", which = region)
} # }