cBioPortal / oncotree

Creative Commons Attribution 4.0 International
35 stars 26 forks source link

API search endpoint has bad default argument for levels on swagger page #145

Open caaespin opened 5 years ago

caaespin commented 5 years ago

Hi,

I don't know where else to reach out to, but hopefully this is the right place. Today I started getting 404s on queries that used to work with no issues. For example,

http://oncotree.mskcc.org/api/tumorTypes/search/code/GCB?version=oncotree_latest_stable&exactMatch=true&levels=1%2C2%2C3%2C4%2C5

does not work as of this moment. Is the database down or something?

I see GCB on the Tree diagram on the website, so I'm puzzled why it's not working all of a sudden.

caaespin commented 5 years ago

@sheridancbio have you been able to take a look at this by any chance?

sheridancbio commented 5 years ago

Yes .. I think I figured this out.

The query does work correctly, but our default value for the "levels" argument is incorrect.

You queried for http://oncotree.mskcc.org/api/tumorTypes/search/code/GCB?version=oncotree_latest_stable&exactMatch=true&levels=1%2C2%2C3%2C4%2C5 --- notice that the "levels" parameter which comes last specifies that it is looking on levels "1,2,3,4,5"

however, the GCB node is on level 6 down from the root node. The current tree goes to depth 7, so we should change the default argument for levels to "1,2,3,4,5,6,7" ... or make it so that when the levels argument is not supplied, all levels are searched.

For now, the you would be able to get correct answers from the api by giving a more complete levels range in the query, so http://oncotree.mskcc.org/api/tumorTypes/search/code/GCB?version=oncotree_latest_stable&exactMatch=true&levels=1%2C2%2C3%2C4%2C5%2C6%2C7 will return this result: [{"code":"GCB","color":"LimeGreen","name":"Germinal Center B-Cell Type","mainType":"Mature B-Cell Neoplasms","externalReferences":{},"tissue":"Lymphoid","children":{},"parent":"DLBCLNOS","history":[],"level":6}]

We have added a card to our scrum planning board and will correct this behavior in the near future.

sheridancbio commented 5 years ago

Thank you for reporting this issue @caaespin cc: @ritikakundra