readGeneric {genomation} | R Documentation |
The function reads a tabular text file that contains location and other information
on genomic features and returns a GRanges
object.
The minimal information that the file has to have is chromosome,
start and end columns. Strand information is not compulsory.
readGeneric(file, chr = 1, start = 2, end = 3, strand = NULL, meta.cols = NULL, keep.all.metadata = FALSE, zero.based = FALSE, remove.unusual = FALSE, header = FALSE, skip = 0, sep = "\t")
file |
location of the file, a character string such as: "/home/user/my.bed" or the input itself as a string (containing at least one \n). |
chr |
number of the column that has chromsomes information in the table (Def:1) |
start |
number of the column that has start coordinates in the table (Def:2) |
end |
number of the column that has end coordinates in the table (Def:3) |
strand |
number of the column that has strand information, only -/+ is accepted (Default:NULL) |
meta.cols |
named |
keep.all.metadata |
|
zero.based |
a boolean which tells whether the ranges in the bed file are 0 or 1 base encoded. (Default: FALSE) |
remove.unusual |
if TRUE(default) remove the chromosomes with unsual names, such as chrX_random (Default:FALSE) |
header |
whether the original file contains a header line
which designates the column names. If |
skip |
number of lines to skip. If there is a header line(s) you do not wish to include you can use skip argument to skip that line. |
sep |
a single character which designates the separator in the file. The default value is tab. |
GRanges
object
my.file=system.file("extdata","chr21.refseq.hg19.bed",package="genomation") refseq = readGeneric(my.file,chr=1,start=2,end=3,strand=NULL, meta.cols=list(score=5,name=4), keep.all.metadata=FALSE, zero.based=TRUE) head(refseq)