Hi,
I' m trying to get annotation data from a gff file using rtracklayer, and got some errors that I can't figure out:
library(rtracklayer)
library(GenomicRanges)
library(Rsamtools)
egff <- import.gff("./data/NC_016810.gff", asRangedData=FALSE)
seqlengths(gff) <- end(ranges(gff[which(elementMetadata(gff)[,"type"]=="region"),]))
Errors:
Error in .normargSeqlengths(value, seqnames(x)) :
length of supplied 'seqlengths' must equal the number of sequences
Can anyone please help me understand the reason for the errors?
what's the output of
length(which(elementMetadata(gff)$type=="region"))
andlength(seqlengths(gff))
? They're apparently not the same.typo? s/egff/gff/