color-chrs-pl
Quick Start
- Command:
color-chrs.pl -p output-prefix output.dat - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/color-chrs.pl - Help:
perl /home/vimalinx/miniforge3/envs/bio/bin/color-chrs.pl -h - Output: writes
<prefix>.svg
When To Use This Tool
- Plot
.datfiles produced bybcftools +color-chrs. - Build a chromosome-level SVG summary of haplotype assignments or painted regions.
- Apply a custom
chr hap colorpalette instead of the built-in red / green / blue / yellow defaults. - Combine multiple
.datfiles into one rendered figure when they belong in the same visualization.
Common Patterns
# 1) Render a basic plot from one plugin output file
color-chrs.pl -p sample sample.dat
# 2) Override the default haplotype colors
color-chrs.pl -c colors.txt -p sample sample.dat
# 3) Merge multiple .dat inputs into one SVG
color-chrs.pl -p cohort cohort_a.dat cohort_b.dat
Recommended Workflow
- Generate one or more
.datfiles withbcftools +color-chrs. - Decide whether the default colors are acceptable or whether you need an explicit color map file.
- Pick a unique
-pprefix for the output figure before running the plotter. - Open the resulting
<prefix>.svgand confirm the chromosome names and painted regions look sensible.
Guardrails
-pis mandatory; omitting it aborts withExpected -p option.- Help is available with
-h,-?, or--help; there is no--versionpath in this script. - File arguments are detected by existence, so typos are treated as unknown options while real existing paths are consumed as input files wherever they appear on the command line.
- The colors file must be whitespace-delimited
chr hap colorrows. - The plotter hard-codes chromosomes
1through22plusX, so it is not a natural fit for arbitrary contig naming or non-human assemblies.