fuse-ranges
CLI tool from the Entrez Direct (EDirect) package for fusing overlapping or adjacent ranges.
Quick Start
- Command:
printf '5\t1\t+\t3..8,8..10,15..13\n' | PATH=/home/vimalinx/miniforge3/envs/bio/bin:$PATH /home/vimalinx/miniforge3/envs/bio/bin/fuse-ranges - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/fuse-ranges - Reference: See references/help.md for full documentation
When To Use This Tool
- Expand comma-separated
start..endrange lists and fuse overlaps per strand. - Collapse adjacent intervals too, not just strict overlaps.
- Turn EDirect-style alignment summaries into strand / start / end / length blocks for later filtering or reporting.
Common Patterns
# 1) Fuse a single row containing multiple strand-specific ranges
printf '5\t1\t+\t3..8,8..10,15..13\n' | \
PATH=/home/vimalinx/miniforge3/envs/bio/bin:$PATH \
/home/vimalinx/miniforge3/envs/bio/bin/fuse-ranges
+ 3 10 8
+ 13 15 3
# 2) Use in a larger EDirect table pipeline
some_edirect_command | \
PATH=/home/vimalinx/miniforge3/envs/bio/bin:$PATH \
/home/vimalinx/miniforge3/envs/bio/bin/fuse-ranges \
> fused.tsv
Recommended Workflow
- Generate a four-column table where column 3 is strand and column 4 is a comma-separated range list like
3..8,8..10,15..13. - Put the EDirect bin directory on
PATHsosort-tableis available to the wrapper. - Pipe the table through
fuse-rangesand capture the merged strand / start / end / length output. - Spot-check that adjacent intervals were merged the way you expect.
Guardrails
- This wrapper depends on sibling EDirect tools such as
sort-table; calling the absolute path alone can still fail withcommand not found. - It prefilters with
grep '^[1-9]', so rows starting with0, whitespace, or non-digits are silently dropped. - After that filter, only the strand column and the comma-separated range-list column are used; the first two fields are effectively ignored.
- Empty or non-matching input can yield a bogus
0 0 1row instead of a clean error, so validate outputs before using them downstream.