np-core / nanopath

Python package and command line interface - entry point for the repository :snake:
Other
5 stars 0 forks source link

Kraken plots for report in app #10

Closed esteinig closed 4 years ago

esteinig commented 4 years ago

Purpose

Create a selection of D3 donut plots (https://github.com/mbhall88/streamformatics) adopted as Vue components in np-core/app/app/client/src/assets/d3-taxcomp-plugin.js.

Link to server

Server utilities class from nanopath.server.ServerUtilities are imported in np-core/app/app/server/app.py and simply parse a JSON file with the plot data for visualization with the get_analysis_results(pipeline='sepsis') method.

Vue format

Current layout in four different plots in format:

{
"bacteria_plot": [
     {"species": "Staphylococcus aureus", "percent": 10, "reads": 20}
],
"virus_plot": null,
"contamination_plot": null,
"summary_plot": null
}

Server data is generated by the nanopath.processors.KrakenProcessor method KrakenProcessor.get_server_data which returns the server data for visualization.

Report example:

snip6

snip3

snip5

snip4

Contaminant filtering will be discussed in another issue.

esteinig commented 4 years ago

Report format in the metagenome report is updated to:

{
        tags: {
          ont: true,
          illumina: false,
          dna: true,
          rna: true,
          controls: true,
        },
        meta: {
          request: "96ddcaa6-c1ff-41aa-81da-f99a2cb757b2",
          pipeline: "np-dummy v0.0.0",
          completed: "20-20-2020 20:20:20",
          patient: "TSV-001",
          sample: "Whole Blood",
          protocol: "qg-dummy v0.0.0"
        },
        data: {
          reads: {
            summary: null,
            bacteria: null,
            viruses: null,
            contamination: null

          },
          genotypes:  {},
          assemblies: {},
          viruses: {},
          controls: {},
        }
      },
esteinig commented 4 years ago

If one species dominates the plots and other read assignments are < 1% (and > 1 read) the plot annotations overlay.

snip

esteinig commented 4 years ago

I might resolve this by splitting low proportional assignments not considered contamination (i.e. > 1 read assignment and other to be determined) into a second plot.

esteinig commented 4 years ago

In addition when no data available this should be shown.

esteinig commented 4 years ago

No data available now shows a warning alert, added switches to table format to show reads, percent and species instead of additional plots, because it would get too crowded.

nodata

esteinig commented 4 years ago

I'm pretty happy with this for now. Need another section for eukaryotic pathogens - currently only viral and bacterial agents included.

Closing this issue and will open new one for Eukaryots