[Biopython] codon bias

Chris Mitchell chris.mit7 at gmail.com
Fri Oct 25 18:22:56 UTC 2013


Hi Jessica,

Could you be somewhat more descriptive of your goals? Are you trying to do
something like determine the coding likelihood of a sequence?

You can just take the known coding sequences to empirically derive the
codon usage frequency.  That would be a simple script like:

from collections import Counter
fdict = Counter()
for i in xrange(0,len(sequence),3):
 fdict[sequence[i:i+3]] += 1

Which would give you a dictionary of the counts, from which you can derive
the frequencies.


Chris


On Fri, Oct 25, 2013 at 1:44 PM, Jessica Grant <jgrant at smith.edu> wrote:

> Hello,
>
> I was wondering if anyone had some code to determine effective number of
> codons in a sequence.  I'm working with an organism with a non-canonical
> genetic code, so I don't think I can use any of the standard packages.
>
> Thanks,
>
> Jessica
> _______________________________________________
> Biopython mailing list  -  Biopython at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biopython
>



More information about the Biopython mailing list