This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Going from pubmed esearch to protein fasta sequences: Biopython

After I run my esearch in pubmed I return a list of IDs for publications. I found the following info by running einfo on pubmed"

# {'Name': 'pubmed_protein_weighted', 'Menu': 'Protein (Weighted) Links', 'Description': 'Links to protein', 'DbTo': 'protein'}
# {'Name': 'pubmed_snp', 'Menu': 'SNP Links', 'Description': 'PubMed to SNP links', 'DbTo': 'snp'}
# {'Name': 'pubmed_protein_refseq', 'Menu': 'Protein (RefSeq) Links', 'Description': 'Link to Protein RefSeqs', 'DbTo': 'protein'}
# {'Name': 'pubmed_dbvar', 'Menu': 'dbVar', 'Description': 'Link from PubMed to dbVar', 'DbTo': 'dbva

My question is how do I use biopython entrez to link out to respective DBs? Like

 {'Name': 'pubmed_protein_weighted', 'Menu': 'Protein (Weighted) Links', 'Description': 'Links to protein', 'DbTo': 'protein'}?
protein fasta biopython entrez

Can you provide an example of search terms? Looks like you are simply showing JOSN format link-out information above.

handle = Entrez.esearch(db ="pubmed", retmax = 25, term="gefitinib")

Something like this:

$ esearch -db pubmed -query "gefitinib" | elink -target protein -name pubmed_protein_refseq | esummary | xtract -pattern DocumentSummary -element Caption,Title 
NP_001403494    endothelin-1 isoform 1 preproprotein [Homo sapiens]
NP_001403492    endothelin-1 isoform 1 preproprotein [Homo sapiens]
NP_001403493    endothelin-1 isoform 1 preproprotein [Homo sapiens]
NP_001402068    forkhead box protein O3 isoform 2 [Homo sapiens]

Makes sense! I totally forgot about the 'pipe' to with 'elink'. Much appreciated!

This is good for working in UNIX, but I'm working on editing it for BioPython. Would you happen to have and example?

0 answers

No answers yet.

Log in to answer this question.