Skip to content

Create CLI tool to generate svg from input files #54

@jcha40

Description

@jcha40

The CLI tool should be a python script that generates an identical-looking svg to what locus plotter outputs. Some points:

  • All arguments should be flag arguments (no positional arguments).
  • One flag should take a variable-length list of composites. Composites should be separated by spaces and composites themselves should be represented as a dash-separated list of composite files.
    • Should also have corresponding flags for name, color (optionally two dash separated hex codes for separate sense-anti colors), scale, shift occupancy, show forward/reverse (this makes it so we probably don't need hide), and swap strands. These flags should also take in lists of the same length as the composite list.
    • Flags for smoothing, opacity, and bp shift should have the option of being a list of the same length as the composite list, or a single global value.
  • There should also be flags for the global values (title, axis labels, axis limits, combined, color trace, show legend, reference lines).
  • Alternatively, there should be a flag that takes in a single config file that includes all the information above.
    • This should be similar to the import json, but it doesn't need to include the composite data, since the script will read the file paths anyway. It also doesn't need to include settings like "Enable tooltips" or any of the metadata table.
  • The defaults for any missing values should be the same as the defaults in locus plotter.

Helpful libraries:

  • argparse
  • xml - Here is an example of how I used this to create svgs from scratch
    • I would advise against using matplotlib, since it tends to format svgs with extraneous elements, and there would also be issues with fonts.
  • numpy for vectorized math operations
  • json for the config file

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions