[Biopython-dev] syntax of indices for future Alignment object

Michiel de Hoon mdehoon at c2b2.columbia.edu
Sat Jul 28 04:11:03 UTC 2007


Peter wrote:
> I've got a working bit of code put together now which I'll attached to 
> bug 1944 soon.
> 
> http://bugzilla.open-bio.org/show_bug.cgi?id=1944
> 
For the most part, I agree with the functionality in this patch. I have 
three suggestions though:

 >>> aln = Alignment(alphabet)
# Suggestion 1: We should allow creating an Alignment without specifying 
an alphabet

 >>> aln.add_sequence("seq1", "ATCGTTGC")
 >>> aln.add_sequence("seq2", "ATCCTTGC")
 >>> aln.add_sequence("seq3", "ATCCGTGC")
 >>> aln[0]
SeqRecord(seq=Seq('ATCGTTGC', Alphabet()), id='<unknown id>', 
name='<unknown name>', description='seq1', dbxrefs=[])
# Suggestion 2: I would expect "seq1" as the id rather than the description

 >>> aln[:2]
<Bio.Align.Generic.Alignment instance at 0x10aaeb8>
# OK
 >>> aln[:,4]
'TTG'
# OK
 >>> aln[2,:]
<Bio.Align.Generic.Alignment instance at 0x105efd0>
# Suggestion 3: Here, I would expect "ATCCGTGC" instead. An alignment 
consisting of a single sequence doesn't make much sense.

--Michiel.



More information about the Biopython-dev mailing list