run-roh-pl
Perl convenience wrapper around bcftools roh. It scans an input directory of variant files, normalizes chromosome names, optionally injects allele-frequency annotations, runs bcftools roh per sample file, appends genotype rows with bcftools query, and finally merges surviving ROH regions into one summary table.
Quick Start
- Command:
run-roh.pl -i <indir> -o <outdir> - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/run-roh.pl - Downstream visualizer:
plot-roh.py
When To Use This Tool
- Running the same ROH-calling workflow across many per-sample VCF, VCF.GZ, or BCF files in one directory
- Producing merged cross-sample ROH presence/absence summaries without hand-writing bcftools loops
- Applying consistent ROH length, marker-count, and quality filters before cross-sample merging
- Augmenting the batch run with allele-frequency annotations or IMPUTE2-style genetic maps
Common Patterns
# Basic batch ROH run
run-roh.pl -i cohort-vcfs -o roh-out
# Add allele frequencies and a genetic map directory
run-roh.pl -i cohort-vcfs -o roh-out -a af-tags.bcf -m genetic-maps
# Forward extra options directly to bcftools roh
run-roh.pl -i cohort-vcfs -o roh-out --roh-args '--buffer-size 200000,200000'
Recommended Workflow
- Put only
.vcf,.vcf.gz, or.bcfsample files in the input directory. - If using
-a, make sure the annotation file exists alongside both its.tbiindex and.hdrheader sidecar. - Run the wrapper and inspect the output directory for per-sample
.bcf,.txt.gz, and.logfiles plus the finalmerged.txt. - Use
plot-roh.pyor your own downstream logic on the generated*.txt.gzandmerged.txtoutputs.
Guardrails
--helpprints real usage text, but--versionis not implemented; locally it failed withUnknown parameter "--version". Run -h for help.-i/--indirand-o/--outdirare mandatory.- The wrapper enforces extra sidecars for
-a/--af-annots: it refuses to run unless<file>,<file>.tbi, and<file>.hdrall exist. - Source inspection shows the output directory also gets
chr-names.txt, and the merge phase writesmerged.txtwith one row per merged region and one indicator column per sample. - Existing per-sample
.bcfor.txt.gzoutputs are skipped on rerun, so the wrapper is partially restart-friendly. - The ROH phase always appends
bcftools query -f 'GT\t%CHROM\t%POS[\t%SAMPLE\t%GT]\n'output to each.txt.gz, which is whyplot-roh.pycan later consume the files.