BioPython SeqIO fails with Invalid Alphabet found

52 Views Asked by At

I am trying to store a GenBank file that could be read by Geneious later. I found an example how to create the GenBank file here

But now I run into Alphabet issues. I tried all protein classes from the documentation, but all fail with the same error:

TypeError: Invalid alphabet found, <class 'Bio.Alphabet.ProteinAlphabet'>.

I dont know what else to do here? Using biopython==1.73

    record = SeqRecord.SeqRecord(
        Seq.Seq("MIRQALAVAALLLAGTAQADGLIDN", alphabet=Alphabet.ProteinAlphabet),
        id="FooBar",
    )

    with NamedTemporaryFile(mode="w") as genbank:
        SeqIO.write(record, genbank, "genbank")
        pass
0

There are 0 best solutions below