**0**wrote:

Hi,

I am trying to find out length of Yeast ORF. Where is my mistake?

> sacCer3Length <- function(symbols) { require(TxDb.Scerevisiae.UCSC.sacCer3.sgdGene) require(org.Sc.sgd.db) exons.db = exonsBy(TxDb.Scerevisiae.UCSC.sacCer3.sgdGene, by='gene') egs = unlist( mget(symbols[ symbols %in% keys(org.Sc.sgd) ],org.Sc.sgd) ) sapply(egs,function(eg) { exons = exons.db[[eg]] exons = reduce(exons) sum( width(exons) ) }) } > sacCer3Length('YNL079C') Error in unlist(mget(symbols[symbols %in% keys(org.Sc.sgd)], org.Sc.sgd)) : error in evaluating the argument 'x' in selecting a method for function 'unlist': Error in mget(symbols[symbols %in% keys(org.Sc.sgd)], org.Sc.sgd) : error in evaluating the argument 'x' in selecting a method for function 'mget': Error in symbols %in% keys(org.Sc.sgd) : error in evaluating the argument 'table' in selecting a method for function '%in%': Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘keys’ for signature ‘"function"'

Regards,

Deepak