Sheila the angel | 2 Jul 2012 14:21
Picon
Gravatar

[Biopython] searching homologene database

To search tp53 homolog in homologene database -

handle = Entrez.esearch(db="homologene", term="tp53[gene name] AND Homo
sapiens[orgn]")
record = Entrez.read(handle)
handle = Entrez.efetch(db="homologene", id=record['IdList'])
record = handle.read()
print record

I think record is asn.1 format !! how can I read or convert it in the genes
protein table (as we see in the web result)
http://www.ncbi.nlm.nih.gov/homologene/460

Thanks

--
Sheila
_______________________________________________
Biopython mailing list  -  Biopython <at> lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biopython

Wibowo Arindrarto | 2 Jul 2012 14:39
Picon
Gravatar

Re: [Biopython] searching homologene database

Hi Sheila,

You can set the 'retmode' parameter in order to specify your preferred
format. I'm not sure if NCBI provides an output format exactly like
the one you see on their site, but instead of ASN.1 you can specify a
more common
format like XML.

In your case, the call would be this (for XML, let's say):

handle = Entrez.efetch(db="homologene", id=record['IdList'], retmode="xml")

For a list of possible retmode values, you can look them up here:
http://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.EFetch (see the
explanation about 'retmode').

If you want to format the output further, you can use modules like the
built-in elementtree or 3rd party modules like lxml to extract the tag
values and feed them to your script / program.

Hope that helps,
Bow

On Mon, Jul 2, 2012 at 2:21 PM, Sheila the angel <from.d.putto <at> gmail.com> wrote:
> To search tp53 homolog in homologene database -
>
> handle = Entrez.esearch(db="homologene", term="tp53[gene name] AND Homo
> sapiens[orgn]")
> record = Entrez.read(handle)
> handle = Entrez.efetch(db="homologene", id=record['IdList'])
(Continue reading)


Gmane