0

please let me know what is the issue with the below code. It is not showing result but the same code is showing result in vscode

from Bio import SeqIO
import os, glob
folder_path = 'D:/MAJU/Sem3/Thesis-I/DataSet/536_stentrophomonas_maltophilia-Copy2'
fasta_paths = glob.glob(os.path.join(folder_path, '*.fasta'))
for fasta_path in fasta_paths:
    print(fasta_path)
    for seq_record in SeqIO.parse(fasta_path, "fasta"):
        print(seq_record.id)
        print(seq_record.seq)
  • This example is not reproducible as the data source is not available. Did you check seq_record type? maybe there is NULL result which is the reason of not displaying a result. – PeCaDe Sep 23 '22 at 08:12

2 Answers2

0

You are trying to read from your file system while using colab, you have to upload your files there and use the correct path. If you upload by drag and drop the files will be listed under the /content/ directory

Lorenzo Bonetti
  • 530
  • 3
  • 12
0

As Lorenzo has suggested, you have to upload your file/files/folder to Google Drive and read it from there because CoLab can't read your local files. You can find out how to attach your google drive to CoLab here: https://stackoverflow.com/a/52300696/15443747

Cheers!