How to scan NCBI database using Biopython and save information as a fasta file?
1
0
Entering edit mode
2.5 years ago
Makayla • 0

Hello, I am attempting to use Entrez to search the keyword “covid” in the nucleotide database and write the top 5 sequence records to a fasta file.

I completed the code for question 1, but I am having trouble with saving the sequences in a fasta file. Any advice would be much appreciated, thank you.

enter image description here

entrez ncbi biopython • 765 views
ADD COMMENT
0
Entering edit mode

Makayla : Deleting questions which are solved is not appropriate. Consider accepting the answer (green check mark) since it solved your issue.

ADD REPLY
1
Entering edit mode
2.5 years ago
GenoMax 141k

Is the image above your own code or simply a screen grab from somewhere (it is always best to actually post code by pasting and using 101010 button to format).

If this is your code then you are retrieving data as XML and not fasta. So change to (retmode="fasta") and that should get you fasta sequence. Following is Entrezdirect equivalent:

$ efetch -db nuccore -id NM_001283041 -format fasta | head -5
>NM_001283041.3 Homo sapiens ubiquitin specific peptidase 25 (USP25), transcript variant 1, mRNA
ATTCCGGGCGGCCGCTCCCTCCGTCCCCTCTCTCCCTTCCCCAAAGCAGCCCGCGGACCGGCAGCAAAGG
AACGTGCGAACGCGTGACGCCGCCCGACTGGCTCGCGCTCTCCCGTGCCCCGGCGTCCTCCGCCCGCTCA
TGGCCCGGGCCGCCGCGGACGAGCGGCGCTGAGGCGGGCCGCGTGGAGACGTGAGGCGGCCGCCGTGGCC
ADD COMMENT
0
Entering edit mode

Thank you, that worked.

ADD REPLY

Login before adding your answer.

Traffic: 1610 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6