LinuxCommandLibrary

elink

Create hard links between files

TLDR

Search pubmed then find related sequences

$ esearch -db pubmed -query "[selective serotonin reuptake inhibitor]" | elink -target nuccore
copy

Search nucleotide then find related biosamples
$ esearch -db nuccore -query "[insulin [PROT] AND rodents [ORGN]]" | elink -target biosample
copy

SYNOPSIS

elink -dbfrom DBFROM -dbto DBTO -id UIDLIST [options]

PARAMETERS

-dbfrom DB
    Source database for input UIDs (default: pubmed)

-dbto DB
    Target database to link to

-id UIDLIST
    Comma-separated input UIDs

-linkname NAME
    Specific link relationship (e.g., pubmed_pubmed_citedin)

-target DB
    Intermediate database for indirect links

-all
    Retrieve all available links

-neighbor
    Links to neighbors (similar to cmd=neighbor)

-aneighbor
    Links to all neighbors

-reldate N
    Links updated in last N days

-email EMAIL
    User email for rate limit compliance

-retmode xml|json
    Output format (default: xml)

DESCRIPTION

Elink is part of NCBI's Entrez Direct (EDirect) toolkit for command-line access to Entrez databases. It queries the E-Link utility to retrieve UIDs from a target database (-dbto) linked to input UIDs (-id) in a source database (-dbfrom). Supports specific relationships via -linkname, like pubmed_pubmed_citedin for citations or gene_gene2refseq for gene-to-sequence links. Output defaults to XML LinkSet format, parseable with xtract or xpath. Ideal for bioinformatics pipelines navigating PubMed, Gene, Protein, Taxonomy, and more. Handles batch UIDs and reports link counts. Use -all for all possible links or -neighbor for related records.

CAVEATS

Subject to NCBI rate limits (3/sec without API key). Requires internet; output is XML needing parsing for UIDs. Not for production without key.

COMMON EXAMPLE

elink -dbfrom pubmed -dbto pmc -id 26925127
Links PubMed ID to PMC full-text articles.

PARSE OUTPUT

Pipe to xtract -pattern LinkSet -element IdList to extract target UIDs.

HISTORY

Introduced in NCBI Entrez Direct (2012), based on E-Utilities web service (2005). Actively maintained for high-throughput queries.

SEE ALSO

esearch(1), efetch(1), egquery(1), curl(1)

Copied to clipboard