ksumngs / yavsap

Yet Another Viral Subspecies Analysis Pipeline
https://ksumngs.github.io/yavsap
MIT License
1 stars 1 forks source link

[Feature]: Add a one-click Visualizer setup script #28

Closed MillironX closed 2 years ago

MillironX commented 2 years ago

Summary

Create a script that goes from a clean install to fully functional Visualizer with just a double-click from the user that is output with the results.

More Info

Context

For many of our target users, installing npm and maintaining it is difficult. This would make it graphical and "easy."

Possible implementation

The script would do, in pseudocode:

nodeversion = Check for recent (>= 14) Node.js install
if ( nodeversion < Node.js LTS || nodeversion == null) {
    nbin = $(whereis n)
    if ( nbin == null ) {
        exec n-install-script.sh
        PATH += /path/to/n
    }
   $(n install lts)
}
npm install
npm start

A Windows version (batchfile) should also be included.

MillironX commented 2 years ago

Maybe it would be better to use a static site generator, instead. The workflow would look like:

  1. Pipeline compiles output filenames/metadata, creates datasheet (CSV/JSON/YAML/TOML)
  2. Pipeline passes datasheet to new process, SITE_GENERATOR
  3. SITE_GENERATOR uses a static site generator to create the visualizer webpages, with links to the proper output files
  4. SITE_GENERATOR has its publishDir directive and output: set to publish all the correct files to the results directory
flowchart TD
    subgraph Processes
    A[KRAKEN_CLASSIFICATION]
    B[FASTQC]
    C[MINIMAP_ALIGMENT]
    D[HAPLINK_HAPLOTYPES]
    E[RAXML_TREE]
    end
    subgraph Analysis
    X[MULTIQC]
    Y["Metadata compiler (Nextflow)"] -- CSV or YAML --> Z[STATIC_GENERATOR]
    end
    subgraph Output
    O[params.outdir]
    end
    A -- kreport --> X
    B -- zip --> X
    C -- "path(bam)" --> Y
    C -- bam --> O
    D -- YAML --> Y
    D -- YAML --> O
    E -- "path(newick)" --> Y
    E -- newick --> O
    X -- HTML --> O
    Z -- HTML --> O

Possible site generators:

Name Repo Pros Cons
Jekyll https://github.com/jekyll/jekyll Ubiquitous
Hugo https://github.com/gohugoio/hugo Powerful, includes optimization, integrates well with NPM Extending is hard (no sequence support)
Franklin.jl https://github.com/tlienart/Franklin.jl Easy extension with Julia (BioJulia support) Doesn't seem to support data files?
MillironX commented 2 years ago

A static site generator for the final product is out due to Cross origin resource sharing issues. However, a static site generator could still create individual pieces, namely

Then the server would simply serve up the remote resources, including

As much as I hate CDNs, I think they will be required for this page in the end. Then the only dependencies will be a web server (Node.js, Python, Julia even). CDN resources include

MillironX commented 2 years ago

Starting with #40, the output is mostly a static page, but it still needs a server. Linux and Mac users can use Python3's http.server. We should try to compile a binary from https://github.com/tlienart/LiveServer.jl for Windows users.