CAVEconnectome / CAVEclient

This is the python client for accessing REST APIs within the Connectome Annotation Versioning Engine.
https://caveconnectome.github.io/CAVEclient/
MIT License
21 stars 11 forks source link

Querying like I would do in the `codex.flywire.ai/app/search`? #134

Open IanQS opened 10 months ago

IanQS commented 10 months ago

Hey all!

I've got a query that looks like: input_neuropils {equal} PVLP_R {or} input_neuropils {equal} SAD and I'd like to download all the resulting data. In the past my lab has downloaded the data via flywire.ai/app/search, but it seems like I'm now unable to download all the data through this interface. My options seem to be manually downloading the various .gz files I need from flywire.ai/api/download or programmatically doing it.

I'm exploring the programmatic method and I'm unfortunately running into an issue wherein I don't know what "stack" or "table" to look into? I've tried doing

from caveclient import CAVEclient

client = CAVEclient("flywire_fafb_public")
client.info.get_datastacks()

but I run into an authentication issue

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/anaconda3/envs/proj/lib/python3.10/site-packages/caveclient/annotationengine.py", line 162, in get_tables
    return handle_response(response)
  File "/opt/homebrew/anaconda3/envs/proj/lib/python3.10/site-packages/caveclient/base.py", line 88, in handle_response
    _raise_for_status(response, log_warning=log_warning)
  File "/opt/homebrew/anaconda3/envs/proj/lib/python3.10/site-packages/caveclient/base.py", line 79, in _raise_for_status
    raise requests.HTTPError(http_error_msg, response=r)
requests.exceptions.HTTPError: 403 Client Error: FORBIDDEN for url: https://prod.flywire-daf.com/annotation/api/v2/aligned_volume/fafb_seung_alignment_v0/table content: b'{"data":{"auth_dataset":"fafb","required_permission"
:"view"},"error":"missing_permission","message":"Missing permission: view for dataset fafb"}\n'

Interestingly enough, I'm able to download data just fine when I try something like client.materialize.synapse_query(post_ids=segID)

Thanks for your help!