[Biopython-dev] [Bug 1944] Align.Generic adding iterator and more

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Thu Aug 16 21:33:51 UTC 2007


http://bugzilla.open-bio.org/show_bug.cgi?id=1944


biopython-bugzilla at maubp.freeserve.co.uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #721 is|0                           |1
           obsolete|                            |




------- Comment #5 from biopython-bugzilla at maubp.freeserve.co.uk  2007-08-16 17:33 EST -------
Created an attachment (id=730)
 --> (http://bugzilla.open-bio.org/attachment.cgi?id=730&action=view)
Patch for Bio/Align/Generic.py to add __getitem__ method (v2)

Updated patch, two changes:

- requesting all/part of a single row returns a Seq, not an alignment object
- returns Seq objects for all/part of a single row or column (not strings)

Recap:

align[r,c] gives a single character as a string
align[r] gives a row as a SeqRecord
align[r,:] or align[r,c1:c2] gives all or part of a row as a Seq
align[:,c] or align[r1:r2,c] gives all or part of a column as a Seq
align[:] and align[:,:] give a copy of the alignment

Anything else gives a sub alignment, e.g.
align[0:2] or align[0:2,:] uses only row 0 and 1
align[:,1:3] uses only columns 1 and 2
align[0:2,1:3] uses only rows 0 & 1 and only cols 1 & 2

NOTE - I am deliberately not attempting to implement __setslice__ at this
point. 


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list