In the BioPython source code, the "Seq" class is located in the " Seq.py " file in the path /Seq/Seq.py
Meaning ... You need to import the Seq (file), which means its "Module", and then call the "Seq" class in the "Seq" module
So try the following:
from Bio.Alphabet import IUPAC from Bio import Seq my_prot=Seq.Seq("AGTACACTGGT",IUPAC.protein)
If you are ever confused in Python about what you import and what you call, you can do this:
import Bio.Seq print type(Bio.Seq) >>> <type 'module'> print type(Bio.Seq.Seq) >>> <type 'classobj'>
source share