Entering edit mode
10.1 years ago
dktarathym
▴
40
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.
Should I use:
exons.db = cdsBy(TxDb.Scerevisiae.UCSC.sacCer3.sgdGene, by='gene')
That'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.
Problem is in code (I believe):
egs = unlist(get(symbols[symbols %in% keys(org.Sc.sgd)],org.Sc.sgd))
Yes, 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.
I have ORF. I want to make a function, that will return the length of these ORF.