[Biopython-dev] about the SeqRecord and SeqFeature classes

Jose Blanca jblanca at btc.upv.es
Tue Sep 23 08:40:24 EDT 2008


Hi:
I'm still interested on the design of the Sequence and Alignment classes. For 
my work I need sequence classes with some extended features. I need a 
SequenceWithQuality class and a Seq class capable of holding information 
about features located in different regions of the sequence.
I could use SeqRecord for the sequence with features and extend Seq for the 
SequenceWithQuality, but I have found some problems with this approach.
SeqRecord still doesn't have a __getitem__ method. Also, SeqRecord exposes the 
implementation of the features collection, it's a public list. That I think 
is a limitation. For instance, we could be interested in controlling if a the 
feature added is inside the region covered by the sequence. We can't also ask 
for features by their name or type.
I understand that keeping compatibility is paramount for BioPython and I share 
that concern. I also understand that having two classes to do the same job is 
not a nice thing. Nevertheless I have been thinking about these issues and I 
have implemented a non-mutable sequence class with these ideas in mind. I 
plan to use this implementation to write an Alignment class capable of 
dealing with ESTs assemblies.
The most different aspect of this proposal and the code actually alive in 
BioPython are the LocatableFeature and Location classes. LocatableFeature is 
equivalent to SeqFeature, but while SeqFeature is mostly a struct with no 
methods LocatableFeature has a __getitem__, __len__ and complement. Location 
is inspired by the BioRange BioPerl class.
I would like to have equivalent functions in BioPython and I'm willing to help 
in the adaptation the actual BioPython classes. I would appreciate to hear 
your suggestions and criticisms about the classes that I'm sending.
Best regards,

Jose Blanca

P.D. In the tests files there is detailed information about how these classes 
would work.

-- 
Jose M. Blanca Postigo
Instituto Universitario de Conservacion y
Mejora de la Agrodiversidad Valenciana (COMAV)
Universidad Politecnica de Valencia (UPV)
Edificio CPI (Ciudad Politecnica de la Innovacion), 8E
46022 Valencia (SPAIN)
Tlf.:+34-96-3877000 (ext 88473)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: biolib.tar.gz
Type: application/x-tgz
Size: 9873 bytes
Desc: not available
URL: <http://lists.open-bio.org/pipermail/biopython-dev/attachments/20080923/081e944a/attachment-0001.bin>


More information about the Biopython-dev mailing list