[Biopython-dev] Calculating motif scores

Michiel de Hoon mjldehoon at yahoo.com
Thu Jul 16 08:50:35 UTC 2009

Hi everybody,

I was looking for a way to calculate the position-weight matrix score for a given sequence. Motif.score_hit(sequence,position,normalized=0,masked=0) in Bio/Motif/_Motif.py does what I need, but it calculates the score at only one position. For speed reasons, I am looking for a function that can calculate the scores at all positions in a sequence. Something like

score(pwm, sequence)

returning a Numerical Python array of length len(sequence) - len(pwm) + 1, with the "score" function implemented in a C extension. Perhaps the position-weight matrix should be its own class, with "score" as one of its methods.

Is there perhaps some other function that I can use for this?
If not, I can contribute a C extension implementing this functionality. If so, are there any preferences on how this should be integrated with Bio.Motif?



More information about the Biopython-dev mailing list