difference-uid-lists
Quick Start
- Command:
difference-uid-lists FILE1 FILE2 - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/difference-uid-lists - Full reference:
references/help.md
When To Use This Tool
- Keep only IDs that appear in exactly one of two UID files.
- Compare an older and newer search result to see which IDs were added or dropped.
- Audit drift between two snapshots of the same Entrez query.
- Use this instead of
exclude-uid-listswhen you need both sides' uniques, not just FILE1 minus FILE2.
Common Patterns
# 1) Find IDs that changed between two saved searches
difference-uid-lists old.ids new.ids > changed.ids
# 2) Count how many UIDs are unique to either cohort
difference-uid-lists case.ids control.ids | wc -l
# 3) Review the changed IDs before refetching records
difference-uid-lists baseline.ids rerun.ids | sed -n '1,20p'
Recommended Workflow
- Prepare exactly two one-UID-per-line files.
- Run
difference-uid-liststo compute the symmetric difference. - Inspect or count the output before feeding it into downstream fetch or QC steps.
- Switch to
exclude-uid-listsorintersect-uid-listsif you actually need a directional subtraction or shared set.
Guardrails
- The real implementation is
comm -3 <(sort "$1") <(sort "$2") | tr -d '\t' | sort -n, so it returns IDs unique to either file. - The wrapper sorts inputs internally; original input order is discarded.
- This command expects exactly two files and has no real built-in help/version path.
- Passing
--helpor--versiondoes not show clean custom docs; it leaks through tosortand can still emitcomm/ missing-file noise.