Description Usage Arguments Value Author(s) See Also Examples
Reads a file in GFF format and creates a data frame or DataFrame object from it. This is a low-level function that should not be called by user code.
1 2 3 4 5 |
filepath |
A single string containing the path or URL to the file to read. Alternatively can be a connection. |
version |
|
columns |
The standard GFF columns to load. All of them are loaded by default. |
tags |
The tags to load. All of them are loaded by default. |
filter |
|
nrows |
|
raw_data |
|
GFF1 |
A DataFrame with columns corresponding to those in the GFF.
H. Pages
import
for importing a GFF file as a
GRanges object.
makeGRangesFromDataFrame
in the
GenomicRanges package for making a
GRanges object from a data frame or
DataFrame object.
makeTxDbFromGFF
in the
GenomicFeatures package for importing a GFF file as a
TxDb object.
The DataFrame class in the S4Vectors package.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | ## Standard GFF columns.
GFFcolnames()
GFFcolnames(GFF1=TRUE) # "group" instead of "attributes"
tests_dir <- system.file("tests", package="rtracklayer")
test_gff3 <- file.path(tests_dir, "genes.gff3")
## Load everything.
df0 <- readGFF(test_gff3)
head(df0)
## Load some tags only (in addition to the standard GFF columns).
my_tags <- c("ID", "Parent", "Name", "Dbxref", "geneID")
df1 <- readGFF(test_gff3, tags=my_tags)
head(df1)
## Load no tags (in that case, the "attributes" standard column
## is loaded).
df2 <- readGFF(test_gff3, tags=character(0))
head(df2)
## Load some standard GFF columns only (in addition to all tags).
my_columns <- c("seqid", "start", "end", "strand", "type")
df3 <- readGFF(test_gff3, columns=my_columns)
df3
table(df3$seqid, df3$type)
makeGRangesFromDataFrame(df3, keep.extra.columns=TRUE)
## Combine use of 'columns' and 'tags' arguments.
readGFF(test_gff3, columns=my_columns, tags=c("ID", "Parent", "Name"))
readGFF(test_gff3, columns=my_columns, tags=character(0))
## Use the 'filter' argument to load only features of type "gene"
## or "mRNA" located on chr10.
my_filter <- list(type=c("gene", "mRNA"), seqid="chr10")
readGFF(test_gff3, filter=my_filter)
readGFF(test_gff3, columns=my_columns, tags=character(0), filter=my_filter)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.