Description Usage Arguments Value Examples
View source: R/myBasicFunctions.R
Put the content of a bedGraph (with or without header gzip or not) in a dataframe
1 | readBedGraph(fn)
|
fn |
the name of the bedgraph file (tab delimited file with 4 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 4 columns (chr, start, end, score) containing the values of the file fn
(the header is removed).
The bedgraph 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_bedgraph <- file.path(tests_dir, "testNoHeader.bedgraph")
# Load the bedgraph with no header in a dataframe
test_bedgraph_as_df <- readBedGraph(test_bedgraph)
test_bedgraph <- file.path(tests_dir, "test1lineHeader.bedgraph")
# Load the bedgraph with 1 line header in a dataframe
test_bedgraph_as_df <- readBedGraph(test_bedgraph)
test_bedgraph <- file.path(tests_dir, "testmultiplelineHeader.bedgraph")
# Load the bedgraph with multiple lines header in a dataframe
test_bedgraph_as_df <- readBedGraph(test_bedgraph)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.