Description Usage Arguments Value Examples
View source: R/myBasicFunctions.R
Put the content of a bed file (with or without header gzip or not) in a dataframe
1 | readBed(fn)
|
fn |
the name of the bed file (tab delimited file with at least 3 columns with optionnally headers). Each row of the table appears as one line of the file. If it does not contain an absolute path, the file name is relative to the current working directory, getwd(). |
The dataframe with at least 3 columns (chr, start, end, name, score, strand, thickStart, thickEnd, itemRgb, blockCount, blockSizes, blockStarts) containing the values of the file fn
(the header is removed).
The bed format is 0-based half open and this remains true for the dataframe.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | tests_dir <- system.file("tests", package="usefulLDfunctions")
test_bed <- file.path(tests_dir, "test3colWithoutHeader.bed")
# Load the bed with no header in a dataframe
test_bed_as_df <- readBed(test_bed)
test_bed <- file.path(tests_dir, "test6colWithHeader.bed")
# Load the bed with 6 columns and a header in a dataframe
test_bed_as_df <- readBed(test_bed)
test_bed <- file.path(tests_dir, "test12colWithHeader.bed.gz")
# Load the bed with header with 12 columns gziped in a dataframe
test_bed_as_df <- readBed(test_bed)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.