xlink
Local link resolver built on xcommon.sh, xlink.ini, and rchive -link. It reads UIDs from stdin, -id, -input, or an upstream ENTREZ_DIRECT message, follows a named link target, and emits either raw linked UIDs or a wrapped local result set for the destination database.
Quick Start
- Command:
xlink -target <link-name> - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/xlink - Critical environment:
EDIRECT_LOCAL_ARCHIVE
When To Use This Tool
- Traversing record-to-record links inside a prepared local EDirect archive
- Moving from one UID set to another after
xsearch,xfilter, or manual ID input - Translating link targets into the destination database defined in
xlink.ini - Working with PubMed citation or PubMed Central link-outs in the
x*local stack
Common Patterns
# Follow PubMed citation links in the local archive
export EDIRECT_LOCAL_ARCHIVE=/path/to/local/archive
xsearch -db pubmed -query 'Havran W* [AUTH]' | xlink -target CITED
# Jump from PubMed IDs to linked PMC IDs
export EDIRECT_LOCAL_ARCHIVE=/path/to/local/archive
printf '2539356\n' | xlink -db pubmed -target PMCID -raw
# Feed linked IDs into the next local step
export EDIRECT_LOCAL_ARCHIVE=/path/to/local/archive
xsearch -query 'dna repair' | xlink -target CITED | xfetch
Recommended Workflow
- Set
EDIRECT_LOCAL_ARCHIVEand make sure the upstream step is producing valid local UIDs or anENTREZ_DIRECTmessage. - Supply the source database with
-dbwhen it is not already encoded in the incoming message; otherwise the script falls back topubmed. - Choose a link target such as
CITED,CITES, orPMCID. - Keep wrapped output for downstream
x*stages, or add-rawif the next command wants plain UIDs.
Guardrails
- This is a local link-following tool, not a remote Entrez elink client.
-targetis mandatory; the script exits withERROR: Insufficient arguments given to xlinkif you do not supply it.- Source inspection shows
xlink.inicurrently maps[pubmed] CITED=pubmed,CITES=pubmed, andPMCID=pmc. - Without
-raw, linked UIDs are wrapped inENTREZ_DIRECTXML using the destination database fromxlink.ini; with-raw, plain linked UIDs are sent to stdout. - The script accepts input from
-id,-input, stdin, or an upstreamENTREZ_DIRECTmessage parsed by sharedxcommon.shhelpers. - A configured local postings/archive installation is still required before link traversal works.