I want to download in fasta format all the peptide sequences in the NCBI protein database (i.e. > and the peptide name, followed by the peptide sequence), I saw there is a MESH term describing what a peptide is here, but I can't work out how to incorporate it.
I wrote this:
import Bio from Bio import Entrez Entrez.email = 'firstname.lastname@example.org' handle = Entrez.esearch(db="protein", term="peptide") record = handle.read() out_handle = open('myfasta.fasta', 'w') out_handle.write(record.rstrip('\n'))
but it only prints out 995 IDs, no sequences to file, I'm wondering if someone could demonstrate where I'm going wrong.