adamewing / methylartist

Tools for plotting methylation data in various ways
MIT License
128 stars 10 forks source link

Highlight in `locus` with different colors #92

Open skranz0 opened 1 week ago

skranz0 commented 1 week ago

The option to highlight regions in the locus plots is really nice, however, I think a nice enhancement would be to allow the user to set custom colors for each highlight. With the current way to state the regions as a comma separated list, this would be kinda hard, but I could imagine a function call where you just set the -l flag multiple times, e.g.

methylartist locus -b alignment.bam -r reference.fasta \
  --motif CG \
  -m m \
  -i chr7:1072064-1101499 \
  -l 1072120-1073043,blue -l 1072344-1072421,red -l 1098425-1099628,#0F627A
adamewing commented 1 week ago

That's a good suggesting regarding syntax. Per-highlight colours are currently possible through --highlight_bed which to quote the help text: BED3+1 format (chrom, start, end, optional_colour) where colour (optional) must be intelligible to matplotlib