expand-cols
Quick Start
- Command:
expandCols -i <input> -c <cols> - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/expandCols - Full reference:
references/help.md
When To Use This Tool
- Expand comma-separated values in one or more columns into one row per element.
- Normalize bedtools or annotation outputs where a single field stores multiple values.
- Convert compact list-like cells into row-wise tabular form for downstream joins, filters, or summaries.
- Expand multiple columns in parallel when their comma-separated entries are aligned by position.
Common Patterns
# 1) Expand one comma-separated column into multiple rows
expandCols \
-i test.txt \
-c 5
# 2) Expand two aligned comma-separated columns in lockstep
expandCols \
-i test.txt \
-c 4,5
# 3) Read from stdin and expand a list-valued annotation column
cat annotations.tsv | expandCols \
-c 7
Recommended Workflow
- Identify which 1-based columns contain comma-separated payloads that should be expanded.
- If expanding more than one column, confirm the comma-separated lists are aligned positionally within each row.
- Run
expandColson the file or stdin and redirect the normalized output into downstream processing. - Spot-check a few rows to confirm the replicated row count matches the number of values you expected to unpack.
Guardrails
-cis required.- If multiple columns are expanded together, they should have the same number of comma-separated values per row.
- Non-expanded columns are simply replicated across the emitted rows.
- If
-iis omitted, input is read from stdin. - Prefer
-hfor help; GNU-style--helpand--versionemit wrapper errors before usage text.