I'm following this Biopython tutorial. Where the tutorial uses DNA "instances" to create a motif, I need to use an aligned fasta.
I tried
alphabet = Gapped(IUPAC.protein)
alignment = AlignIO.read("my_seqs.afa", "fasta", alphabet=alphabet)
m = motifs.create(alignment)
but that results in
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/m/.local/lib/python2.7/site-packages/Bio/motifs/__init__.py", line 24,
in create
return Motif(instances=instances, alphabet=alphabet)
File "/home/m/.local/lib/python2.7/site-packages/Bio/motifs/__init__.py", line 273
, in __init__
counts = self.instances.count()
File "/home/m/.local/lib/python2.7/site-packages/Bio/motifs/__init__.py", line 220
, in count
for letter in self.alphabet:
TypeError: 'NoneType' object is not iterable
I looked through the documentation, but I can't find anything that specifies the expected input for motifs.create
. Does it not work with aligned sequences or am I just reading them in incorrectly?