Comments (4)
@lionel-spinelli thanks for using bioservices status is not ok with Server Error is indeed an error on psiciquic server.
Do you have a workable snippet to provide so I can test myself ? could be that the length of the final query is too long. There are limitations indeed regarding the length of the URL but this is a general issue. I have not update this service for a long time. Thera are maybe some new interface based on the POST request (rather than GET) that I can check out for you. If you provide an example this will help me to start with this issue and give more feedback. best
from bioservices.
Hello @cokelaer ,
thanks a lot for your response. Here is an extraction/modification of my code as example (you may have to simplify it for testing). Let me know if it is clear enough :
self.psicquicDatabase = "InnateDB"
self.speciesName = "Homo_Sapiens"
self.speciesCodeDict ={}
self.speciesCodeDict[ self.speciesName ] = "9606"
self.DOWNLOAD_BATCH_SIZE = 100
database_interactions_count = (the number of interaction in the queried database retrieved previously through the PSICQUIC service)
# Divide the quantity of interactions in different batches
batch_number = ( database_interactions_count // self.DOWNLOAD_BATCH_SIZE) + 1
# Loop over query batches to get all interactions since a single query is not authorized
for batch_id in range( batch_number ):
# get the list of interaction in the current batch
interaction_list = psicquic_service.query( service=self.psicquicDatabase.lower(),
query="species:" + str( self.speciesCodeDict[ self.speciesName ]),
output="xml25",
version="current",
firstResult=1 + batch_id * self.DOWNLOAD_BATCH_SIZE,
maxResults=min( (batch_id+1) * self.DOWNLOAD_BATCH_SIZE, database_interactions_count)
)
# save the list of the interactions to XML file
print( "|-- writing XML file...")
with open( os.path.join( self.output_path, self.speciesName + "_" + self.psicquicDatabase + "_batch" + str( batch_id) + ".xml" ),
"wb" ) as output_file:
pickle.dump( interaction_list, output_file )
# wait before new request to avoid black listing from psicquic servers
print( "|-- waiting before new request..." )
time.sleep( 3)
from bioservices.
I see that you are using xml25 as output. I tried a simple example on another database nad got a 500 error. Using the default output set to tab25 worked. This example retrieves 100 results but fails:
p.query("intact", "species:9606", output="xml25",firstResult=1000, maxResults=1100)
while this one works:
p.query("intact", "species:9606", output="xml25",firstResult=1000, maxResults=1100)
extended to 1000 queries, it works as well:
p.query("intact", "species:9606", output="tab25",firstResult=1000, maxResults=1100)
Not sure why but looks like an issue on the server side. Using tab25 is easier to parse but you may miss some information.
from bioservices.
Hello,
thanks for your test. You are perfectly right : the tab25 output works while the xml25 does not. I am even able to query the whole databse at once. I would never have though it could be a format issue... Unfortunatly, the XML structure is largely better to parse because it is highly structured...
I will go and check on the Psicquic side if they have some clue about this output format issue.
Thanks again for your test and for finding me the reason of theses issues..
Lionel
from bioservices.
Related Issues (20)
- KEGG 'MEMBER' keyword without special parsing & T/nt numbers HOT 3
- When importing UniProt from bioservices I get this TypeError: __init__() got an unexpected keyword argument 'text_color' HOT 2
- pip install throws an OSError for version 1.10.1 HOT 6
- Could not build wheels for gseapy HOT 1
- Include Uniprot secondary accessions in DataFrame columns HOT 1
- ChEMBL Service cannot be reached HOT 1
- pip install gives FileNotFoundError for version 1.10.3 HOT 10
- Failing for UniProt examples HOT 1
- Debugging flag? HOT 3
- Limit of 25 proteins for UniProt mapping. HOT 3
- [Bug in v1.11.0] Need to check for the presence of `failedIds` key in uniprot.mapping HOT 3
- error in PDBe module or just in the example? HOT 1
- Is there plan to update Pubchem API?
- UniChem example from docs fails HOT 1
- Error in bioservices/uniprot.py HOT 1
- bioservics Panther HOT 1
- Unable to reach BioDBNet URL HOT 1
- BioMart filter input
- parse_kgml_pathway HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bioservices.