This function extracts genomic signal data for a specified region from either a data frame or a file. It filters the data to only include features within the specified region and optionally adds a track name.
Examples
if (FALSE) { # \dontrun{
# Extract data from a data frame
df <- data.frame(
seqnames = c("chr1", "chr1", "chr2"),
start = c(1, 100, 200),
end = c(50, 150, 250),
score = c(0.1, 0.5, 0.9)
)
region_data <- get_single_signal(df, "chr1:50-150", name = "track1")
# Extract data from a file
file_data <- get_single_signal("peaks.bed", "chr1:1000000-2000000", name = "peaks")
} # }