[BioPython] Bio.SeqFeature.SeqFeature

Peter biopython at maubp.freeserve.co.uk
Wed Aug 6 09:03:54 UTC 2008


On Wed, Aug 6, 2008 at 1:36 AM, Cedar McKay <cmckay at u.washington.edu> wrote:
> Hello. I just upgraded from 1.44 to 1.47 and one of my home-brew classes
> stopped working. This used to work:
>
> class BetterSeqFeature(Bio.SeqFeature.SeqFeature, fastaTools):
>        """Extends the Bio.SeqFeature.SeqFeature class with several new
> methods and attributes.
>        The Bio.SeqFeature.SeqFeature represents individual features of a
> genbank record,
>        for example a CDS."""
>
>
> But now after the upgrade to 1.47 my script throws this:
>
>  File "/usr/local/python/Rocap.py", line 740, in <module>
>    class BetterSeqFeature(Bio.SeqFeature.SeqFeature, fastaTools):
> AttributeError: 'module' object has no attribute 'SeqFeature'
>
>
> FYI fastaTools is a class of my own.
>
> I looked at the changelog, and don't see anything obvious. Can anyone give
> me a pointer as to why this stopped working?

How are you importing the SeqFeature?  You would get that error
message if you didn't import the SeqFeature at all.  Perhaps something
subtle has changed there (i.e. you may have been relying on another
module importing it on your behalf).

You could try:

import Bio.SeqFeature
class BetterSeqFeature(Bio.SeqFeature.SeqFeature, fastaTools):
   #...

or,

from Bio.SeqFeature import SeqFeature
class BetterSeqFeature(SeqFeature, fastaTools):
    #...

Peter



More information about the Biopython mailing list