**40**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

Don't yeast have alternatively spliced genes? If so, getting exons by gene, reduce()ing that and then summing the exons won't work. Also, UTRs will mess that up.

92kShould I use:

exons.db = cdsBy(TxDb.Scerevisiae.UCSC.sacCer3.sgdGene, by='gene')

40That'll at least solve the UTR issue, though it'll still miss alternative splicing. The general idea is to pull out CDS for a gene and then calculate from that the ORF length of each transcript. You then return the longest ORF length (or the mean, or median, or...). Not calculating by transcript will often over-estimate things in cases where there's more than pure exon skipping.

92k> sacCer3Length <- function(symbols)

+ {

+ require(TxDb.Scerevisiae.UCSC.sacCer3.sgdGene)

+ require(org.Sc.sgd.db)

+ exons.db = transcriptsBy(TxDb.Scerevisiae.UCSC.sacCer3.sgdGene, by='gene')

+ egs = unlist(get(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(get(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 get(symbols[symbols %in% keys(org.Sc.sgd)], org.Sc.sgd) :

error in evaluating the argument 'x' in selecting a method for function 'get': 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"’

Problem is in code (I believe): *** egs = unlist(get(symbols[symbols %in% keys(org.Sc.sgd)],org.Sc.sgd))

40Yes, the problem in the code can be deduced from

You probably want org.Sc.sgdGENENAME or something like that rather than org.Sc.sgd.

Note that your ORFs are still wrong, though.

92kI have ORF. I want to make a function, that will return the length of these ORF.

40