[Biopython-dev] Bio.Motif Suggestions

Dave Bridges dave.bridges at gmail.com
Mon Apr 20 13:55:40 UTC 2009


 From an off-list conversation with Bartek

> > Is it possible to give a name to an instance, so that when you 
> print, say to
> > fasta it retains that info
>   

Yes and no... Motifs have a .name property which can be used for
storing names of motifs, but it is currently not used in fasta output.
BTW. fasta  (and other) output functions changed recently in CVS, but
I didn't have time to update my branch in git. Please have a look
at the .format method of Motif class in the main branch. There are
also some (minor) changes in the tutorial, so you may want to merge
them back into your branch. Bio.Motif got refactored quite a bit (on
Peter's request), so you should update the code, but the API didn't
change too much.

Currently, the fasta output prints only Instance 1, Instance 2 and so
on in the ID field but it would be a trivial improvement to add motif
name there.


> > Is there an alphabet that accepts spaces which might be necessary for
> > correct alignment of a motif, and if so will that work with the rest of
> > motif.py?
>   
That's a tougher one. It wasn't really needed so far (DNA motifs
rarely have spaces), but I guess that for protein motifs it's a very
important thing.
I have some code for doing that, but I will need to find it. I'll
write you later about it.


> > in to_horizontal_matrix/to_vertical_matrix is it possible to print 
> out a
> > legend for the matrices (for ex. the alphabet letters and the position)
> > along the top and side.
>   

No, not yet, but again, it would be a nice improvement (and easy to make).


cheers
Bartek



More information about the Biopython-dev mailing list