This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Entrez e-link Puchem compound

Hello everyone

I am trying to set entrez e-link for pubchem compound but ı couldnot find right parameter for the print name for structure name. I use this e-link

record = Entrez.read(Entrez.elink(dbfrom="Pubmed", db="pccompound",   ıd="6UFO"))
print(record)

and it print as

[{'LinkSetDbHistory': [], 'ERROR': [], 'LinkSetDb': [], 'DbFrom': 'Pubmed', 'IdList': ['6']}]

but I would like to print compound name and I cant do it.

Thank you for any help

pubchem elink entrez

1 answer

Is this what you are looking to get?

$ efetch -db pccompound -id 6UFO

1. 1-chloro-2,4-dinitrobenzene; 2,4-Dinitrochlorobenzene; 97-00-7 ...
MW: 202.550 g/mol MF: C6H3ClN2O4
IUPAC name: 1-chloro-2,4-dinitrobenzene
Create Date: 2005-03-26
CID: 6

But I will use it for cgi and I am tried to create e-link

#!/usr/bin/env python3
import cgi;
import cgitb;cgitb.enable()
from Bio import Entrez
print("Content-Type: text/html")
print()
form = cgi.FieldStorage()
Entrez.email = '---@posta.mu.edu.tr'
record = Entrez.read(Entrez.elink(dbfrom="Pubmed", db="pccompound", id="6UFO"))
print(record)

as like this I will for id get id as id=form.getvalue and I will print as form

Log in to answer this question.