The official website of the HHMI Science Education Alliance-Phage Hunters Advancing Genomics and Evolutionary Science program.

Welcome to the forums at Please feel free to ask any questions related to the SEA-PHAGES program. Any logged-in user may post new topics and reply to existing topics. If you'd like to see a new forum created, please contact us using our form or email us at

PhagesDB Data API Question

| posted 26 Sep, 2019 18:04
Is there a way to download specific genes in FASTA format (i.e. all major tail proteins) from the entire PhagesDB data base? The API seems to suggest that it is possible but I've been unable to figure it out.

Any help would be appreciated!
| posted 01 Oct, 2019 14:53
You can get the translations of any gene using /api/genes/{GeneID}/ but the API returns everything in JSON format not FASTA format and you would have to do them one at a time.
As an example if you want the info on gene 1 of phage Dori call this URL:

in the results you will get the amino acid sequence in the "translation".

Another alternative, although more manual, would be to use the "Download all sequences" button on the pham page of phagesdb. This will give you all the protein sequences of all members of the pham in FASTA format. Depending on your exact goal this might be good enough, you just need to figure out which phams you want and decide if all pham members are appropriate for your purpose.

Finally, if you have a specific gene list and you want all the sequences programmatically, you could consider using the phamerator database and use mysql to query the database based on gene names; the data you want is in the gene table in the translation field. You could get to that data by either using a graphical user interface or the command line.
Edited 01 Oct, 2019 14:55
| posted 01 Oct, 2019 15:30
As Chris says, there's not really a great way to acquire sequences in that way via the API. He's given a few options that would likely work. If you have just a request or two, however, you can email me ( and I can send them back to you.

Login to post a reply.