This is my first stop here. It looks surprisingly active!
I need to cross-ref protein coding genes from ncbi genomes to uniprot. After trying many other angles I now want to use PICR programmatically. This is my first reluctant exposure to SOAP and the python package suds. I found it straightforward to query for a single accession per request but need to do many at once for efficiency. Multiple accessions can be queried per request via SOAP, as the PICR REST instructions say:
"The methods available in the REST service are very similar to those available via SOAP, save for one major difference: only one accession or sequence can be mapped per request."
More likely than not I am missing something simple.
Here is a working example suds msg as a string (eg str(msg) ) :
my_test_str = '<SOAP-ENV:Envelope xmlns:ns0="<a href=" http:="" www.ebi.ac.uk="" picr="" AccessionMappingService"="" rel="nofollow">http://www.ebi.ac.uk/picr/AccessionMappingService" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP ENV="http://schemas.xmlsoap.org/soap/envelope/">\n <SOAP-ENV:Header/>\n <ns1:Body>\n <ns0:getUPIForAccession>\n <ns0:accession>BAI16447</ns0:accession>\n <ns0:ac_version/>\n <ns0:searchDatabases>TrEMBL</ns0:searchDatabases>\n <ns0:searchDatabases>REFSEQ</ns0:searchDatabases>\n <ns0:taxonId/>\n <ns0:onlyActive/>\n </ns0:getUPIForAccession>\n </ns1:Body>\n</SOAP-ENV:Envelope>'
The wsdl is here: http://www.ebi.ac.uk/Tools/picr/service?wsdl
I've tried manipulating this string by hacking the suds SoapClient.send method directly, eg. by including a second getUPIForAccession element after the first in the body. The query runs without visible error but only returns the result for the first accession.
I've resorted to testing by hack because I haven't figured out how to tell suds I want to include more than one query per request. I think suds may not support this, as I've found this bit of advice in the Document Class source:
"""The document/literal style. Literal is the only (@use) supported since document/encoded is pretty much dead. Although the soap specification supports multiple documents within the soap <body/>, it is very uncommon. As such, suds presents an RPC view of service methods defined with a single document parameter. This is done so that the user can pass individual parameters instead of one, single document. To support the complete specification, service methods defined with multiple documents (multiple message parts), must present a document view for that method."""
I don't really grok all of that. But my direct hack bypasses the document class, so I should be getting multiple results if I have formed the request correctly.
Any happy picrs out there that can advise?