Entering edit mode
3.7 years ago
trejomarco6
•
0
hello = open("humanSeq.txt", "r")
l = []
for line in hello:
fields = line.split()
l.append(fields[0])
import Bio
from Bio import Entrez
Entrez.email = "trejomarco@test.edu"
handle = Bio.Entrez.efetch(db="nucleotide", id="NC_001643.1",rettype="gb",retmode="text")
gb_file_contents = handle.read()
handle.close()
from Bio import SeqIO
with open("NC_001643.1", "w") as out_handle:
out_handle.write(gb_file_contents)
with open("NC_001643.1", "r") as in_handle:
record = SeqIO.read(in_handle, format="gb")
print(record.seq[0:])
In my text file, I have a list of ids and I want to know how do I make my code input in all of my ids and record them all into a fasta file.