#!/usr/bin/python # Description: Use eFetch to retrieve a protein sequence given it's id # Author: Francisco Roque # Email: chico@cbs.dtu.dk # Version: eFetch 1.5b # Date: 2008-01-23 import sys from SOAPpy import WSDL # Receive the protein id from the command line protid = sys.argv[1] # Define wsdl locations wsdlFile = 'http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/efetch.wsdl' # Establish the endpoint for the eFetch wsdl EUtilsProxy = WSDL.Proxy(wsdlFile) # Define the input data to eFetch eFetchIn = { 'db' : 'protein', 'id' : protid} # Run the run_eFetch service with the input data eFetchOut = EUtilsProxy.run_eFetch(eFetchIn) # print the results #print eFetchOut['GBSeq']['GBSeq_primary-accession'] #print eFetchOut['GBSeq']['GBSeq_sequence'].upper()