andersen-lab / Freyja

Depth-weighted De-Mixing
BSD 2-Clause "Simplified" License
102 stars 29 forks source link

Replace `color` flag in the Plot module with the `config` flag #116

Closed gp201 closed 1 year ago

gp201 commented 1 year ago

Description

This PR does the following

  1. Replaces the color flag with the config flag. This allows users to group lineages and also assign colors to specific Variants of concern or lineages.
  2. Changes the default color for the plot option from plt.cm.tab20 to Plotly Dark24.

    Note
    If more than 24 lineages are present, then it will throw the following exception: Too many lineages to show. Use --config to group.

Proof of Changes

Used the following files for proof of changes:

Images

With Lineages With VOC
With time (W-SAT) image image
Without time image image

Commands run to get the above images

1) With time (W-SAT), with lineages

freyja plot freyja/data/aggregated_result.tsv --lineages --output plot.pdf --times freyja/data/times_metadata.csv --interval W-SAT --config freyja/data/plot_config.yml

2) With time (W-SAT), with VOC

freyja plot freyja/data/aggregated_result.tsv --output plot.pdf --times freyja/data/times_metadata.csv --interval W-SAT --config freyja/data/plot_config.yml

3) Without time, with lineages

freyja plot freyja/data/aggregated_result.tsv --lineages --output plot.pdf --config freyja/data/plot_config.yml

4) Without time, with VOC

freyja plot freyja/data/aggregated_result.tsv --output plot.pdf --config freyja/data/plot_config.yml
joshuailevy commented 1 year ago

Awesome. Thanks Praneeth! Looks good.