ag-computational-bio / bakrep-web

The user interface for bakrep
1 stars 0 forks source link

Add statistics to landing page #33

Closed lukasjelonek closed 9 months ago

lukasjelonek commented 11 months ago

The landing page should list some statistics about bakrep, e.g. dataset count, count of unique taxa, dataset size. This can be extended once it is clear which stats are relevant or not. For the beginning it should display some hard coded numbers.

lukasjelonek commented 11 months ago

The statistics page should server the following purpose:

  1. reduce the dataset to a few numbers
  2. show composition of genera/species in the dataset

To handle 1. it would be sufficient to have a component that displays the category and number:

grafik

To handle 2. there are multiple options:

grafik grafik

We already have precomputed krona plots in html format. They can easily be included as a separate page. See #34

Having the componenents we should find a good-enough layout for the landing page.

lukasjelonek commented 11 months ago

Example histogram data:

[
  {
    "key": "Salmonella enterica",
    "count": 178581
  },
  {
    "key": "Escherichia coli",
    "count": 89135
  },
  {
    "key": "Streptococcus pneumoniae",
    "count": 51433
  },
  {
    "key": "Mycobacterium tuberculosis",
    "count": 49007
  },
  {
    "key": "Staphylococcus aureus",
    "count": 47997
  },
  {
    "key": "Campylobacter_D jejuni",
    "count": 28335
  },
  {
    "key": "Neisseria meningitidis",
    "count": 17153
  },
  {
    "key": "Streptococcus pyogenes",
    "count": 16821
  },
  {
    "key": "Klebsiella pneumoniae",
    "count": 13637
  },
  {
    "key": "Clostridioides difficile",
    "count": 13579
  },
  {
    "key": "Listeria monocytogenes",
    "count": 12245
  },
  {
    "key": "Listeria monocytogenes_B",
    "count": 12244
  },
  {
    "key": "Streptococcus agalactiae",
    "count": 10359
  },
  {
    "key": "Neisseria gonorrhoeae",
    "count": 8904
  },
  {
    "key": "Campylobacter_D coli",
    "count": 8849
  },
  {
    "key": "Enterococcus_B faecium",
    "count": 8284
  },
  {
    "key": "Pseudomonas aeruginosa",
    "count": 6286
  },
  {
    "key": "Vibrio cholerae",
    "count": 5562
  },
  {
    "key": "Acinetobacter baumannii",
    "count": 5124
  },
  {
    "key": "Mycobacterium abscessus",
    "count": 2689
  },
  {
    "key": "Legionella pneumophila",
    "count": 2110
  },
  {
    "key": "Enterobacter hormaechei_A",
    "count": 1917
  },
  {
    "key": "Enterococcus faecalis",
    "count": 1906
  },
  {
    "key": "Burkholderia mallei",
    "count": 1826
  },
  {
    "key": "",
    "count": 1786
  },
  [...]
]
lukasjelonek commented 11 months ago

Example stats data:

{
  "datasets": 661383,
  "genera": 2467,
  "species": 8208
}
crsct commented 10 months ago

Some minor adjustments are still needed to finish this issue, namely the orientation of the plot and the positioning on the website.

lukasjelonek commented 10 months ago

The visualization is one part of this issue. The server has to provide the data.

Proposed server updates:

Add /stats/ Endpoints:

These endpoints provide the data in the format shown above.

lukasjelonek commented 10 months ago

The server stats endpoints are implemented and deployed.

Changes to the proposal: The /stats/genera endpoint is named /stats/genus.