Skip to contents

Generates GenomicHistogram objects from the coverage of a bigWig file

Usage

bigWig_to_histogram(
  filename,
  strand = c("*", "+", "-"),
  score_threshold = 0,
  regions = NULL,
  gtf = NULL,
  histogram_bin_size = 50,
  gene_or_transcript = c("gene", "transcript"),
  select_chrs = NULL,
  select_ids = NULL
)

Arguments

filename

Name of bigwig file for import

strand

The strand of bigwig file from which the data originates. Default "*". If strand is "+" or "-", the strand will also be used to select regions of matching strand.

score_threshold

A hard threshold for the score of the bigwig file. Scores higher than the threshold will be used in the computation of the histogram.

regions

A GRanges or GRangesList object representing regions of interest defining histograms, a GRangesList object allows for the specification of non-continuous segments, default NULL - regions are taken as the set of elements with nonzero coverage

gtf

A GTF file to select regions of interest. Default NULL

histogram_bin_size

The bin size (base-pairs) to bin signal into a histogram. Default 50

gene_or_transcript

Whether histograms should be computed on gene annotations or transcript annotations. Default gene

select_chrs

Select elements on specific chromosomes. Default NULL

select_ids

Select elements by matching ids to genes or transcripts (depending on gene_or_transcript). Default NULL

Value

a list of GenomicHistogram objects

Examples

if (FALSE) {
filename <- system.file("extdata", "bigwigs",  "S1.bw", package = "HistogramZoo")
regions <- GenomicRanges::GRanges(
seqnames = "chr1",
IRanges::IRanges(start = c(17950, 19350),
                 end = c(18000, 19600)),
strand = "*")

histograms <- bigWig_to_histogram(
filename = filename,
regions = regions,
histogram_bin_size = 10)
}