[Biopython] PWM using gapped alignments

Chris Gowen gowencm at vcu.edu
Thu Jul 28 17:14:03 UTC 2011


Hi Peter,

Thanks for the response. We are initiating the alignments and motif as
Gapped(IUPAC.unambiguous_dna), so our letters are 'GATC-'. As far as I can
tell, there is no means for pwm() to know to skip the gaps, if that's even
the 'right' thing for it to do.

On Thu, Jul 28, 2011 at 12:54 PM, Peter Cock <p.j.a.cock at googlemail.com>wrote:

> On Thu, Jul 28, 2011 at 5:28 PM, Chris Gowen <gowencm at vcu.edu> wrote:
> > Hello all,
> >
> > We are trying to perform pwm calculations using the Motif.pwm() function,
> > and many of our alignments have gaps, which raise KeyError when it tries
> the
> > key '-'. I am fairly inexperienced with this analysis technique, but from
> > looking at the source, it seems the error itself may be avoided by adding
> a
> > line before line 97 to skip that letter in the calculation. Would this
> mess
> > up the calculation for the pwm scores? Has anyone dealt with this problem
> in
> > a more clever way?
> >
> > Thanks for any advise you can offer.
> >
> > Best,
> > Chris Gowen
>
> Which alphabet are you using? My guess is you didn't have a gapped
> alphabet.
>
> As an aside, making the Seq object test this has certain appeal but
> would impose a performance penalty.
>
> Peter
>



More information about the Biopython mailing list