granges2bed: granges2bed

View source: R/genomicRegions.R

granges2bedR Documentation

granges2bed

Description

Save a GRanges object to a bed file

Usage

granges2bed(
  gr,
  fn,
  score = NULL,
  addAnnotCols = FALSE,
  colNames = FALSE,
  doSort = TRUE,
  bedgraph = FALSE,
  bigBed = FALSE,
  tabix = FALSE,
  strandCharNA = ".",
  coordOnly = FALSE
)

Arguments

gr

GRanges object

fn

filename to save bed file to

addAnnotCols

add the columns stored in elementMetadata of GRanges

colNames

add column names

doSort

sort the regions before writing the output

bedgraph

export to bedgraph instead of bed

bigBed

also save as bigbed file. Requires that the GRanges object has chromosome sizes stored.

tabix

compress and index by tabix

strandCharNA

character to be used if strand is NA, '*' or '.'

coordOnly

output only the coordinates and strand information (only taken into account if addAnnotCols==FALSE). If all strand information is NA, it will be dropped as well.

sc

score vector or column in elementMetadata of GRanges

Value

(invisibly) the written results as a data.frame


demuellae/muRtools documentation built on Sept. 8, 2023, 4:32 p.m.