biothings / mygeneset.info

Apache License 2.0
5 stars 3 forks source link

Add more geneset stats in the metadata #83

Closed newgene closed 1 year ago

newgene commented 1 year ago

The metadata endpoint, https://mygeneset.info/v1/metadata, currently returns only the total number of genesets (both curated + user genesets):

"stats": {
  "total": 180825
}

we can add more detailed stats numbers for curated, user and anonymous genesets, something like this:

"stats": {
  "total": 180825,
  "curated": 180809,
  "user": 16,
  "anonymous": 2
}

All these numbers can be obtained on the fly by querying the ES indices.

vincerubinetti commented 1 year ago

This would be really great, because I'm doing a bunch of ugly stuff (multiple queries, mapping, math, etc) in the frontend to get these counts:

https://github.com/biothings/mygeneset.info-website/blob/main/src/api/metadata.ts

when it'd be more trivial for the backend to get with its proper querying ability (I think).