| read_bed {pafr} | R Documentation |
Read genomic intervals in bed format
Description
The first three columns of the file specified by file_name must
contain data in the standard bed format (i.e., a genomic interval
represented by 0-based half-open interval with seq-id, start and end position).
These columns will be renamed to 'chrom', 'start' and 'end', respectively. Any
other columns present in the data will be left unmodified.
Usage
read_bed(file_name, tibble = FALSE, ...)
Arguments
file_name |
Path to the bed file to be read in |
tibble |
logical If TRUE, the genomic intervals are returned as
a tidy |
... |
Other arguments passed to |
Details
The file is read into memory with read.table, with the
argument sep set to '\t' and stringsAsFactors set to
FALSE. All other arguments are left as default, but arguments can be passed
from read_bed to read.table.
Value
Either a data.frame or a tbl_df with at least three
columns named 'chrom', 'start' and 'end'
Examples
bed_path <- system.file("extdata", "Q_centro.bed", package="pafr")
centro <- read_bed(bed_path)
centro
# Can pass arguments to read.table
miss_two <- read_bed(bed_path, skip=2)
miss_two