intersect-uid-lists
Quick Start
- Command:
intersect-uid-lists FILE1 FILE2 - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/intersect-uid-lists - Reference:
references/help.md
When To Use This Tool
- Keep only IDs shared by two independent Entrez result sets.
- Build overlap cohorts, for example records matching both a disease query and a species query.
- Confirm which previously processed IDs are still present in a refreshed search.
- Use this instead of
exclude-uid-listsordifference-uid-listswhen you want the shared core set.
Common Patterns
# 1) Keep only UIDs that appear in both searches
intersect-uid-lists disease.ids species.ids > overlap.ids
# 2) Count the shared UID set between two snapshots
intersect-uid-lists old.ids new.ids | wc -l
# 3) Preview the first overlapping IDs before refetching
intersect-uid-lists query_a.ids query_b.ids | sed -n '1,20p'
Recommended Workflow
- Save the two UID sets you want to compare as one-UID-per-line files.
- Run
intersect-uid-liststo compute the shared set. - Inspect or count the overlap before feeding it into expensive downstream steps.
- Use the resulting list with
efetch,xtract, or other local archive utilities.
Guardrails
- The real implementation is
comm -12 <(sort "$1") <(sort "$2") | sort -n, so it returns only the shared IDs. - The wrapper sorts inputs internally, so output order reflects numeric sorting rather than input order.
- This command expects exactly two files and has no real built-in help/version interface.
- Passing
--helpor--versioncan still producesort/commnoise instead of clean documentation output.