readGff3 {genomeIntervals}R Documentation

Make a Genome_intervals_stranded object from a GFF file

Description

Make a Genome_intervals_stranded object from a gff file in gff3 format.

Usage

readGff3(file, isRightOpen=TRUE)

Arguments

file The name of the gff file to read.
isRightOpen Although a proper GFF3 file follows the convention of right-open intervals, improper GFF files following the right-closed convention are frequently found. Set isRightOpen = FALSE in this case.

Details

The file must follow gff3 format specifications as in http://www.sequenceontology.org/gff3.shtml. The file is read as a table. Meta-information (lines starting with ###) are not parsed. A “.” in, for example, the gff file's score or frame field will be converted to NA. When the GFF file follows the right-open interval convention (isRightOpen is TRUE), then GFF entries for which end base equals first base are recognized as zero-length features and loaded as inter_base intervals.

Value

A Genome_intervals_stranded object image of the gff file. The GFF3 fields seqid, source, type, score, strand, phase and attributes are stored in the annotation slot and renamed as seq_name, source, type, score, strand, phase and gffAttributes respectively.

Note

Potential FASTA entries at the end of the file are ignored.

See Also

The functions getGffAttribute and parseGffAttributes for parsing GFF attributes.

Examples


# Get file path
libPath <- installed.packages()["genomeIntervals", "LibPath"]
filePath <- file.path(
                      libPath,
                      "genomeIntervals",
                      "example_files"
                      )

# Load SGD gff
# SGD does not comply to the GFF3 right-open interval convention
gff <- readGff3( file.path( filePath, "sgd_simple.gff"), isRightOpen = FALSE)

head(gff,10)

head(annotation(gff),10)


[Package genomeIntervals version 1.0.1 Index]