ORF lengths using Yeast Annotation package
0
0
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

Bioconductor R • 2.5k views
ADD COMMENT
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

Should I use:

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

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode
> 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))

ADD REPLY
0
Entering edit mode

Yes, the problem in the code can be deduced from

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"’

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

Note that your ORFs are still wrong, though.

ADD REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 2729 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6