So I've been trying to work with Biopython and I'm fairly new. My code:
fasta_string = open("C:\\Users\\saeed\\Desktop\\dna2.fasta").read()
print('1')
result_handle = NCBIWWW.qblast("blastn", "nt", fasta_string)
print('2')
blast_record = NCBIXML.read(result_handle)
len(blast_record.alignments)
E_VALUE_THRESH = 0.01
for alignment in blast_record.alignments:
for hsp in alignment.hsps:
if hsp.expect < E_VALUE_THRESH:
print('*Alignment*')
print('sequence', alignment.title)
print('length', alignment.length)
print(' e value', hsp.expect)
print(hsp.query)
print(hsp.match)
print(hsp.sbjct)
Whenever I run this code, It prints 1 and just stops. Not stops as in exits, but keeps running and doesn't print anything else. I tried replacing the dna2.fasta file with just "myseq.fa", but that didn't seem to work either. It just said file does not exist. I want to know what I am doing wrong, and how to fix it. Any help?