1

I have proteins for which I would like to find their corresponding nucleotide sequences. I also have the genome in which the protein is found. In the genome, I have found the corresponding Gene ID for the protein. However, I am having trouble getting the nucleotide sequence with the Gene ID. I have tried using Entrez Efetch:

Entrez.email = "dddd@gmail.com"
with open("genome.gb", "w") as out_handle:
    request = Entrez.efetch(db="gene", id="2703488", rettype="gb", retmode="text")
    out_handle.write(request.read())
    request.close()

but this only returns the following:

1. G
tail component [Escherichia virus Lambda]
Other Aliases: lambdap14
Other Designations: tail component
Annotation:  NC_001416.1 (9711..10133)
ID: 2703488

Is there anyway to get the actual nucleotide sequence using Efetch? Thanks in advance!

Jean-François Fabre
  • 137,073
  • 23
  • 153
  • 219
Cindy Fang
  • 41
  • 5

1 Answers1

3

You can obtain the sequence from NCBI nucleotide using the information in the Annotation: line:

>>> from Bio import Entrez, SeqIO
>>> Entrez.email = ''
>>> request = Entrez.efetch(db="nuccore", id="NC_001416.1", rettype="fasta", seq_start="9711", seq_stop="10133")
>>> seq_record = SeqIO.read(request, "fasta")
>>> seq_record
SeqRecord(seq=Seq('ATGTTCCTGAAAACCGAATCATTTGAACATAACGGTGTGACCGTCACGCTTTCT...TGA', SingleLetterAlphabet()), id='NC_001416.1:9711-10133', name='NC_001416.1:9711-10133', description='NC_001416.1:9711-10133 Enterobacteria phage lambda, complete genome', dbxrefs=[])
>>> print(seq_record.seq)
ATGTTCCTGAAAACCGAATCATTTGAACATAACGGTGTGACCGTCACGCTTTCTGAACTGTCAGCCCTGCAGCGCATTGAGCATCTCGCCCTGATGAAACGGCAGGCAGAACAGGCGGAGTCAGACAGCAACCGGAAGTTTACTGTGGAAGACGCCATCAGAACCGGCGCGTTTCTGGTGGCGATGTCCCTGTGGCATAACCATCCGCAGAAGACGCAGATGCCGTCCATGAATGAAGCCGTTAAACAGATTGAGCAGGAAGTGCTTACCACCTGGCCCACGGAGGCAATTTCTCATGCTGAAAACGTGGTGTACCGGCTGTCTGGTATGTATGAGTTTGTGGTGAATAATGCCCCTGAACAGACAGAGGACGCCGGGCCCGCAGAGCCTGTTTCTGCGGGAAAGTGTTCGACGGTGAGCTGA
Chris_Rands
  • 38,994
  • 14
  • 83
  • 119