loadBed: Load a BED formatted file.

View source: R/loadBed.R

loadBedR Documentation

Load a BED formatted file.

Description

The function reads BED formatted files. The BED file format defined by UCSC: http://genome.ucsc.edu/FAQ/FAQformat. First three columns ("chrom", "chromStart", "chromEnd") are mandatory. The file fields may be separated by tabs, spaces or commas. If the BED file contains a header, it will be ignored. If a genome mask dataframe is provided, only data intersected with the mask will be retained. Resulting data is ordered by "chromStart" columns.

Usage

loadBed(file, genome = NULL, name = NULL)

Arguments

file

Path to the BED file (string, mandatory)

genome

A mask dataframe to exclude data from the BED file (dataframe, optional). The genome dataframe must contain "chrom" column and may further contain "chromStart" and "chromEnd" columns in this order.

name

A string to replace the 'name' column of the loaded BED file with (string, optional).

Examples

W303_G2 <- loadBed(system.file("extdata/W303_G2.bed",package="Repliscope"), name='W303_G2')
W303_G2_chrI <- loadBed(system.file("extdata/W303_G2.bed",package="Repliscope"),
                       name='W303_G2',genome=sacCer3[["genome"]])

Repliscope documentation built on Sept. 13, 2022, 9:05 a.m.