Hi all,

I've made some progress on the seq_frame branch, which adds
a 'translation' method to DNA sequences; for example, you can do

        frame1 = dna_seq.translation(1)
        frame2 = dna_seq.translation(2)
        frame3 = dna_seq.translation(3)

to get the three-frame translation of dna_seq.

I've finished the positive-frame translation code & tests, as of the
latest commit; see sequence_test.py.  The math was tricky ;).  The only
complication I've run into is that the returned amino acid sequence
object (which is an Annotation, really) always returns the frame of its
full-length parent amino acid translation.  For example, in this code:

        x = s[1:4].translation(1) # frame 1 @ nt 1
        y = s.translation(2)[:1] # == frame 2, aa 0
        assert str(x) == str(y)
        assert y.frame == 2

'x.frame' here is 2, rather than 1, because it's a translation in frame
1 of a slice starting at position 1, hence equal to frame 2... I did
think of a way to get the frame to properly reflect the frame relative
to the DNA slice, but it's ugly and potentially leaky, and I haven't
decided if it's a good idea.

Does anyone have thoughts on this?  It's OK to say "I have no idea what
you're talking about", too ;).  I find silence ominous...

You can check it out from git://github.com/ctb/pygr.git, branch
'seq_frame'.  Comments welcome.

thanks,
--titus
-- 
C. Titus Brown, [email protected]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pygr-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pygr-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to