[Bioperl-l] Bio::SeqIO::fasta id printing

Hilmar Lapp lapp@gnf.org
Thu, 07 Jun 2001 15:53:25 -0700


Jason Stajich wrote:
> 
> [ Warning: Boring bioperl sequence objects internals ]
> 
> Bio::SeqIO::fasta prints a sequence using $seq->id() which is mapped to
> display_id in bioperl.  However in ensembl, which uses the PrimarySeqI.pm
> model, they have an id() method which refers to their internal id for the
> sequence object.  I would propose we change Bio::SeqIO::fasta to print
> the id with $seq->display_id() unless there is a fundamental reason for
> using the id() call in fasta.pm.

Replace by display_id(). It think it's the most sensible here of the
id attributes. I thought there was a possibility to supply a
id_generating_function, but apparently this was in another module.

> 
> In looking at these methods I'm also confused why there is implementation
> in PrimarySeqI and PrimarySeq for the id() method since it is just
> aliased to display_id in both modules.
> 
> References:
>   Bio::SeqIO::fasta.pm v1.23 line:168
>   Bio::PrimarySeqI v1.29 line 629
>   Bio::Seq.pm v1.38 line 480
> 

Not sure what your problem here is. PrimarySeqI maps id() to
display_id(), and Seq.pm and PrimarySeq.pm do the same again. Of
course they didn't have to, but then you cannot expect an interface to
implement methods (even though some bioperl interfaces do for
convenience).

	Hilmar
-- 
-------------------------------------------------------------
Hilmar Lapp                            email: lapp@gnf.org
GNF, San Diego, Ca. 92121              phone: +1-858-812-1757
-------------------------------------------------------------