seermedical / seer-py

Python SDK for the Seer data platform
MIT License
27 stars 10 forks source link

msg data downloader not working #156

Open boyu-zhang-25 opened 1 year ago

boyu-zhang-25 commented 1 year ago

I have authenticated my account, and the NeuroVista download worked just fine. For MSG, the script does not seem to work.

BTW I can get access to MSG data from the Seer website UI (34 patients). Are they the same?

Thank you!

~/De/seer-py | on master ?1  python Examples/msg_data_downloader.py                  1 err | took 7s | seer-py py | at 00:23:25
2022-12-02 00:23:46,615 Login Successful
2022-12-02 00:23:47,137 >>> {"query": "query getStudyLabelGroups($study_id: String!, $limit: PaginationAmount, $offset: Int) {\n  study(id: $study_id) {\n    id\n    name\n    labelGroups(limit: $limit, offset: $offset) {\n      id\n      name\n      description\n      labelType\n      numberOfLabels\n    }\n  }\n}", "variables": {"study_id": "fff9aaa9-b104-46e8-9227-b1b76d6f333e", "limit": 50, "offset": 0}}
2022-12-02 00:23:48,467 <<< {"errors":[{"statusCode":400,"errorCode":"INVALID_PARAMETERS","message":"Cannot query field \"labelType\" on type \"StudyLabelGroup\". Did you mean \"labels\"?","locations":[{"line":9,"column":7}]}]}

Traceback (most recent call last):
  File "/Users/mac/Desktop/seer-py/Examples/msg_data_downloader.py", line 91, in <module>
    run(SeerConnect(), args.outpath)
  File "/Users/mac/Desktop/seer-py/Examples/msg_data_downloader.py", line 58, in run
    downloader = DataDownloader(client, study_id, output_dir)
  File "/Users/mac/Desktop/seer-py/Examples/downloader/downloader.py", line 23, in __init__
    self.label_groups = self.get_label_groups()
  File "/Users/mac/Desktop/seer-py/Examples/downloader/downloader.py", line 37, in get_label_groups
    return self.client.get_label_groups_for_studies([self.study_id])
  File "/Users/mac/Desktop/seer-py/seerpy/seerpy.py", line 984, in get_label_groups_for_studies
    _results = self.get_label_groups_for_study(study_id, limit=limit)
  File "/Users/mac/Desktop/seer-py/seerpy/seerpy.py", line 956, in get_label_groups_for_study
    results = self.get_paginated_response(graphql.GET_ALL_LABEL_GROUPS_FOR_STUDY_ID_PAGED,
  File "/Users/mac/Desktop/seer-py/seerpy/seerpy.py", line 232, in get_paginated_response
    response = self.execute_query(query_string, variable_values=variable_values,
  File "/Users/mac/Desktop/seer-py/seerpy/seerpy.py", line 142, in execute_query
    response = self.graphql_client(party_id).execute(gql(query_string),
  File "/Users/mac/Desktop/seer-py/venv/lib/python3.9/site-packages/gql/client.py", line 193, in execute
    return self.execute_sync(document, *args, **kwargs)
  File "/Users/mac/Desktop/seer-py/venv/lib/python3.9/site-packages/gql/client.py", line 137, in execute_sync
    return session.execute(document, *args, **kwargs)
  File "/Users/mac/Desktop/seer-py/venv/lib/python3.9/site-packages/gql/client.py", line 447, in execute
    raise TransportQueryError(
gql.transport.exceptions.TransportQueryError: {'statusCode': 400, 'errorCode': 'INVALID_PARAMETERS', 'message': 'Cannot query field "labelType" on type "StudyLabelGroup". Did you mean "labels"?', 'locations': [{'line': 9, 'column': 7}]}
SeymaYmn commented 1 year ago

Yes, i am getting a similar error for msg data.

dkeden commented 1 year ago

Hi all, thanks for flagging this.

If you checkout to remove-deprecated-labelType-from-queries branch, this should solve the issue. Merge to the main branch should be in next couple of days.

Otherwise yes, the MSG data on the Seer web app is the same.

Please reach out if you have any further issues.

Cheers,

D

SeymaYmn commented 1 year ago

Thank you for your help. But I think it didn't helpful. I changed branch, now my branch is remove-deprecated-labelType-from-queries (when I checked it with git branch --show-current), but I still got the same errors.

dkeden commented 1 year ago

That's surprising. Is it exactly the same error?

dkeden commented 1 year ago

Are you able to indicate what query is being run for GET_ALL_LABEL_GROUPS_FOR_STUDY_ID_PAGED on ln 195 of graphql.py?

SeymaYmn commented 1 year ago

Sorry, that's my fault. After changing the branch, I tried to download directly. I didn't install. Now it is working. Thank you.

dkeden commented 1 year ago

Not a problem at all! Glad it’s working.

Cheers,

Dom

On Sat, 17 Dec 2022 at 3:48 am, SeymaYmn @.***> wrote:

Sorry, that's my fault. After changing the branch, I tried to download directly. I didn't install. Now it is working. Thank you.

— Reply to this email directly, view it on GitHub https://github.com/seermedical/seer-py/issues/156#issuecomment-1355206937, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANRXWJXMQ5TL7G3FFEJHDMTWNSMOHANCNFSM6AAAAAASRQ6QV4 . You are receiving this because you were assigned.Message ID: @.***>

--

https://www.seermedical.com/

Dominique Eden Data Scientist Email @.*** Mobile Cell +61 415 323 632 <+61+415+323+632> +1 507 405 6720 <+1+507+405+6720>

motaIA commented 1 year ago

Hello @dkeden ,

I am having issues when running msg_data_downloader.py :

Am I missing an authorization? It succesfully logged into the Seer platform.

image

After checking out the remove-deprecated-labelType-from-queries branch, I ran "pip install ." once again before trying use msg_data_downloader.py. Am I missing something?

This is the query on ln 95 of graphql.py:

image

Appreciate the help.

dkeden commented 1 year ago

Hi @motaIA,

Apologies for the delay. It does look like there are auth issues - I'll have a look into this this week and get back to you ASAP.

Cheers, Dominique

motaIA commented 1 year ago

Hi @dkeden ,

Thanks for getting back to me.

It does look like an authorization issue. I have already registered a SeerGP account (username: @.***) and have also emailed Dr Levin Kuhlmann after watching the instructional video regarding the dataset.

Appreciate your help.

El El lun, 29 de may. de 2023 a la(s) 10:29 p. m., Dominique Eden < @.***> escribió:

Hi @motaIA https://github.com/motaIA, apologies for the delay. It does look like there are auth issues - I'll have a look into this this week and get back to you ASAP. Cheers, Dom

— Reply to this email directly, view it on GitHub https://github.com/seermedical/seer-py/issues/156#issuecomment-1567650314, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUFCFBW3VTBKVSZUTW2R3FLXIVEPZANCNFSM6AAAAAASRQ6QV4 . You are receiving this because you were mentioned.Message ID: @.***>

dkeden commented 1 year ago

Hi @motaIA,

Not a problem. It looks like you haven't been given access yet.

Unfortunately I am unable to see the provided email address. If you could reach out to Dr Levin Kuhlmann again, he should be able to assist you.

Let me know if I can be of any further assistance.

Best, Dominique

motaIA commented 1 year ago

Hi @dkeden,

I have sent another email and haven't heard back yet. I think my email address should now be public in Github (my seerGP account is mota-at-vt-dot-edu), I would appreaciate it if you can get in touch with me, so that we can resolve the authorization.

I am working on a university project on surveying different Seizure Detection algorithms, and I am very interested in using the MSG dataset.

Thanks in advance for you help.

dkeden commented 1 year ago

Hi @motaIA, apologies for the delayed response. Absolutely, sounds great! Good to hear of the project.

I reached out to Dr Kuhlmann on Thu, 8 Jun. He should authorise your access.

Let me know if I can assist further.

dkeden commented 1 year ago

Hi @motaIA, are you able to contact me on dominique@seermedical.com with the email address associated with your Seer account?

I should be able to authorise your access internally if not already given.

Best, Dominique

motaIA commented 1 year ago

Hi Dominique,

I have just emailed you. Thank you!

On Tue, Jun 13, 2023 at 9:56 PM Dominique Eden @.***> wrote:

Hi @motaIA https://github.com/motaIA, are you able to contact me on @.*** with the email address associated with your Seer account?

I should be able to authorise your access internally if not already given.

Best, Dominique

— Reply to this email directly, view it on GitHub https://github.com/seermedical/seer-py/issues/156#issuecomment-1590265586, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUFCFBUG7PP2OIKKNNJJJWLXLED2ZANCNFSM6AAAAAASRQ6QV4 . You are receiving this because you were mentioned.Message ID: @.***>

dkeden commented 1 year ago

Done! Let me know if you continue to have issues.

On Wed, 14 Jun 2023 at 11:24, motaIA @.***> wrote:

Hi Dominique,

I have just emailed you. Thank you!

On Tue, Jun 13, 2023 at 9:56 PM Dominique Eden @.***> wrote:

Hi @motaIA https://github.com/motaIA, are you able to contact me on @.*** with the email address associated with your Seer account?

I should be able to authorise your access internally if not already given.

Best, Dominique

— Reply to this email directly, view it on GitHub < https://github.com/seermedical/seer-py/issues/156#issuecomment-1590265586>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AUFCFBUG7PP2OIKKNNJJJWLXLED2ZANCNFSM6AAAAAASRQ6QV4>

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/seermedical/seer-py/issues/156#issuecomment-1590294622, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANRXWJQCFINPM7XQXJTQR5DXLEHFZANCNFSM6AAAAAASRQ6QV4 . You are receiving this because you were mentioned.Message ID: @.***>

--

https://www.seermedical.com/

Dominique Eden Data Scientist Email @.*** Mobile +61 415 323 632 <+61+415+323+632>