biopython.github.io
biopython.github.io copied to clipboard
AlignIO
I have tried to clean AlignIO but it needs some (minor) love from a module specialist:
- the PFAM database is no more
- one bugzilla reference
The bug link is here: https://redmine.open-bio.org/issues/2557
PFAM has moved here: http://pfam.xfam.org/ But the linked alignment is "dead": http://pfam.xfam.org/family/PF09395 And the new family is http://pfam.xfam.org/family/PF08702 The seed alignment now has 75 sequences. I'd recommend switching to RP15 because it only has 17 sequences.
I also noticed there is a rendered backslash in PF09395\_seed.sth
(in the paragraph right above the alignment example code).
I've fixed some of this, but @lennax is right - the example I choose could be replaced with something smaller like RP15.
Running following command in python:
>>> from Bio import AlignIO
>>> alignment = AlignIO.read("PF05371_seed.sth", "stockholm")
>>> print("Number of rows: %i" % len(alignment))
from" http://biopython.readthedocs.io/en/latest/Tutorial/chapter_align.html"
sends this message:
Traceback (most recent call last):
File "C:/Users/dell/AppData/Local/Programs/Python/Python36/test-3.py", line 2, in <module>
alignment = AlignIO.read("PF05371_seed.sth", "stockholm")
File "C:\Users\dell\AppData\Local\Programs\Python\Python36\lib\site-packages\Bio\AlignIO\__init__.py", line 429, in read
first = next(iterator)
File "C:\Users\dell\AppData\Local\Programs\Python\Python36\lib\site-packages\Bio\AlignIO\__init__.py", line 352, in parse
with as_handle(handle, 'rU') as fp:
File "C:\Users\dell\AppData\Local\Programs\Python\Python36\lib\contextlib.py", line 81, in __enter__
return next(self.gen)
File "C:\Users\dell\AppData\Local\Programs\Python\Python36\lib\site-packages\Bio\File.py", line 87, in as_handle
with open(handleish, mode, **kwargs) as fp:
FileNotFoundError: [Errno 2] No such file or directory: 'PF05371_seed.sth'
[Peter: Edited to use the triple back ticks to preserve the indentation]
Let me please know what is the problem? My Python is 3.6 and Biopython is 1.7. Thank you
@haerian your question is unrelated to this issue. Your problem is simply that the example input file PF05371_seed.sth
is not in the current directory.