Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with tests/mouse/test_gene.py #201

Open
lonly7star opened this issue Oct 2, 2021 · 0 comments
Open

Bug with tests/mouse/test_gene.py #201

lonly7star opened this issue Oct 2, 2021 · 0 comments

Comments

@lonly7star
Copy link

the test on tests/mouse/test_gene.py could fail when retrieving the GENE data with a list contains 17943
The original test fails on the 36th run with the current random seed.

the fail happens on the second assertion
names = gene.get_gene_info(acronym=samples['acronym'], attributes='name')
assert sorted(names['name']) == sorted(samples['name'])

when the names are retrieved with "acronym": "9130019P16Rik"
the record from https://api.brain-map.org/api/v2/data/Gene/query.json gets 2 records back instead of one

here is the URL generated by your program with only "acronym": "9130019P16Rik":
https://api.brain-map.org/api/v2/data/Gene/query.json?criteria=%5Bacronym%24in%279130019P16Rik%27%5D%2Cproducts%5Bid%24eq1%5D&only=name%2Cacronym&

here is the response of from the website of that URL:
{"success": true, "id": 0, "start_row": 0, "num_rows": 2, "total_rows": 2, "msg": [{"acronym":"9130019P16Rik","name":"RIKEN cDNA 9130019P16 gene"},{"acronym":"9130019P16Rik","name":"RIKEN cDNA 9130019P16 gene"}]}

The full record from the website is the following:
info2
info1

it seems like the server has two different records with the key "9130019P16Rik" on the column acronym that causing this problem and it is not your code that causes this bug.

I propose the following:

  1. do you want to report to the server about this issue
  2. do you want to change your code to detect/remove the duplicate result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant