Drawing (CLI)
This module allows you to draw plots using the command line.
Note
Draw is written primarily for Python. See the page Plots / Get started to use draw with Python. It contains more plots and more options.
Examples
# Plots mutation_fraction, mutation_fraction_identity, and base_coverage
dreem draw --inpt my_test_sample.json
# Plots only the mutation_fraction plot
dreem draw --inpt my_test_sample.json --mutation_fraction
# Plots only the specified regions for each reference
dreem draw --inpt my_test_sample.json -c reference_1 17 69 -c reference_2 18 21
# Get a structured output
dreem draw --inpt my_test_sample.json --flat 0
# Give name to the sections in the output names
dreem draw --inpt my_test_sample.json --flat 0 --library library.csv
API Reference
CLI cmds
dreem draw
dreem draw [OPTIONS]
Options
- --inpt <inpt>
Path to a dreem output format file. Can be specified multiple times.
- --out-dir <out_dir>
Where to output all finished files
- --flat, --no-flat
Flatten the output folder structure. This names your files [reference]__[section]__[plot_name].html
- -c, --coords <coords>
Reference name, 5’ end, and 3’ end of a section; coordinates are 1-indexed and include both ends
- --section <section>
Section to draw. Can be specified multiple times.
- -mf, --mutation_fraction
Plot mutation_fraction plot. See Plots/gallery.
- -mfi, --mutation_fraction_identity
Plot mutation_fraction_identity plot. See Plots/gallery.
- -bc, --base_coverage
Plot base_coverage plot. See Plots/gallery.
- -mib, --mutations_in_barcodes
Plot mutations_in_barcodes plot. See Plots/gallery.
- -mprps, --mutation_per_read_per_reference
Plot mutation_per_read_per_reference plot. See Plots/gallery.
Python args
- dreem.draw.run(inpt: tuple[str] = (), *, flat: list = True, out_dir: str = './output', coords: tuple = (), section: str = ('full',), mutation_fraction: bool = True, mutation_fraction_identity: bool = True, base_coverage: bool = True, mutations_in_barcodes: bool = False, mutation_per_read_per_reference: bool = True)
Run the draw command.
- Parameters
inpt (
tuple
) – Path to a dreem output format file. Can be specified multiple times. [positional or keyword, default: ()]flat (
list
) – Flatten the output folder structure. This names your files [reference]__[section]__[plot_name].html [keyword-only, default: True]out_dir (
str
) – Where to output all finished files [keyword-only, default: ‘./output’]coords (
tuple
) – Reference name, 5’ end, and 3’ end of a section; coordinates are 1-indexed and include both ends [keyword-only, default: ()]section (
str
) – Section to draw. Can be specified multiple times. [keyword-only, default: (‘full’,)]mutation_fraction (
bool
) – Plot mutation_fraction plot. See Plots/gallery. [keyword-only, default: True]mutation_fraction_identity (
bool
) – Plot mutation_fraction_identity plot. See Plots/gallery. [keyword-only, default: True]base_coverage (
bool
) – Plot base_coverage plot. See Plots/gallery. [keyword-only, default: True]mutations_in_barcodes (
bool
) – Plot mutations_in_barcodes plot. See Plots/gallery. [keyword-only, default: False]mutation_per_read_per_reference (
bool
) – Plot mutation_per_read_per_reference plot. See Plots/gallery. [keyword-only, default: True]
I/O files
Input
sample_1.json
sample_2.json
...
Output
sample_1/
|- construct_1/
|- 3_27/ # start and end position of the section, 1-based
|- mutation_fraction.html
|- mutation_fraction_identity.html
|- base_coverage.html
...
...
sample_2/
...
Note
Use the --flat
option to output the files in a flat structure:
sample_1/
|- construct_1__3_27__mutation_fraction.html
|- construct_1__3_27__mutation_fraction_identity.html
|- construct_1__3_27__base_coverage.html
...
sample_2/
...
Edge cases handling
To avoid handling too many arguments in the commandline, only the most simple plots are supported. If you want to do more complex plots, you can use the Python API.
Contributors: Yves Martin des Taillades