I am trying to follow the tutorial from from the Biopython website here and I am right at the beginning (2.4.1), where I am trying a Simple FASTA parsing example which is
from Bio import SeqIO
for seq_record in SeqIO.parse("ls_orchid.fasta", "fasta"):
print(seq_record.id)
print(repr(seq_record.seq))
print(len(seq_record))
For an unknown reason, I get the following error:
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-19-c64128d7dcfd> in <module>
1 from Bio import SeqIO
----> 2 for seq_record in SeqIO.parse("ls_orchid.fasta", "fasta"):
3 print(seq_record.id)
4 print(repr(seq_record.seq))
5 print(len(seq_record))
~\Anaconda3\lib\site-packages\Bio\SeqIO\__init__.py in parse(handle, format, alphabet)
605 iterator_generator = _FormatToIterator.get(format)
606 if iterator_generator:
--> 607 return iterator_generator(handle)
608 if format in AlignIO._FormatToIterator:
609 # Use Bio.AlignIO to read in the alignments
~\Anaconda3\lib\site-packages\Bio\SeqIO\FastaIO.py in __init__(self, source, alphabet, title2ids)
181 raise ValueError("The alphabet argument is no longer supported")
182 self.title2ids = title2ids
--> 183 super().__init__(source, mode="t", fmt="Fasta")
184
185 def parse(self, handle):
~\Anaconda3\lib\site-packages\Bio\SeqIO\Interfaces.py in __init__(self, source, alphabet, mode, fmt)
45 raise ValueError("The alphabet argument is no longer supported")
46 try:
---> 47 self.stream = open(source, "r" + mode)
48 self.should_close_stream = True
49 except TypeError: # not a path, assume we received a stream
FileNotFoundError: [Errno 2] No such file or directory: 'ls_orchid.fasta'
I am using a Jupyter Notebook.