From Clicking to Scripting · Subtopic 2 of 7 · 10 min
Batch Retrieval Without Code
Some jobs need one record; some need three hundred. This lesson shows you how to pull dozens or thousands of records at once — a full BRCA1 ortholog set, every transcript on a gene list — using nothing but forms and export buttons.
When bulk beats one-at-a-time
Searching Web UIs Well is fine when you want one answer. It stops scaling the moment you have a list: fifty gene symbols from a differential-expression result, every RefSeq transcript for a gene family, or a spreadsheet of accessions a collaborator emailed you. Clicking into each record, copying its sequence, and pasting it into a file is slow and error-prone — you will eventually mistype an accession or grab the wrong .version.
Batch tools solve a narrower problem than a script would: they retrieve records you can already identify by ID or by a simple filter, in one export, with no programming. Reach for code once you need loops, conditionals, or repeated queries against changing inputs. Reach for these tools when the shape of the job is "here is a list, give me a file back."
NCBI: History Server and Batch Entrez
NCBI's History Server is where a multi-step Entrez search keeps its results between requests. Run an ESearch with usehistory=y and NCBI stores the matching UID list server-side under a WebEnv token and a query_key, instead of returning them all inline. You then hand that pair to EFetch to pull the actual records — in batches, without re-sending thousands of IDs by hand. In the web interface this happens automatically: search Nucleotide for BRCA1[gene] AND Homo sapiens[orgn] AND RefSeq[filter], and the result set behind the scenes is already sitting on the History Server, ready for the "Send to" step below.
For that step, every Entrez results page has a Send to dropdown. Choose File, pick a format (FASTA, GenBank, XML, or accession list), and NCBI streams the whole result set — not just the page you're looking at — into one download. This is the no-code sibling of EFetch.
If you already have a list of accessions rather than a search, Batch Entrez (www.ncbi.nlm.nih.gov/sites/batchentrez) is the more direct tool: paste or upload a text file of IDs — say NM_007294 (BRCA1), NM_000059 (BRCA2), and a dozen ortholog accessions — pick the database, and it fetches every matching record as one FASTA or GenBank file. No query syntax, no WebEnv juggling; you supply the exact list and NCBI resolves it.
Ensembl BioMart: filters and attributes at scale
BioMart is Ensembl's query-builder for pulling structured data across many genes at once, reachable from ensembl.org/biomart. It works in three steps: pick a dataset (for example "Human genes GRCh38"), narrow it with filters (a list of gene IDs, a chromosome region, a biotype), and choose attributes — the columns you want back, such as Gene stable ID, Transcript stable ID, Gene name, or % GC content.
Feed BioMart a filter list containing ENSG00000012048 (BRCA1) alongside other DNA-repair genes, ask for attributes Gene stable ID, Transcript stable ID, Transcript type, and MANE Select, and export as TSV. You get one row per transcript, ready to open in a spreadsheet — the same information the MANE lesson discussed for ENST00000357654, but for as many genes as your filter list holds, in a single request.
Try it yourself: open BioMart, choose the Human genes dataset, set a "Gene name" filter to a short gene list including BRCA1, and add "UniProtKB Gene Name" as an attribute. Export as TSV and check that the BRCA1 row resolves to P38398.
UniProt: columns and format, chosen once
UniProt's search results carry a Customize columns control and a Download button that work together for batch export. Run a search — gene:BRCA1 AND organism_id:9606, or upload a list of accessions including P38398 — then use Customize columns to pick exactly the fields you want (Entry, Entry name, Length, Protein existence, Gene ontology), and Download to choose the output: TSV, Excel, FASTA, XML, GFF, or plain accession lists. The column choice and the format choice are independent, so you can export the same search as a lean two-column TSV for a script or a wide spreadsheet for review, without changing the search itself.
Choosing the right no-code tool
| You have | Reach for | Typical output |
|---|---|---|
| A search you'd normally scroll through | NCBI "Send to" File | FASTA / GenBank / XML |
| A ready list of accessions | NCBI Batch Entrez | FASTA / GenBank |
| Genes needing structured, per-transcript metadata | Ensembl BioMart | TSV / CSV |
| Protein records needing specific columns | UniProt Customize + Download | TSV / FASTA / GFF |
All four sit on the same principle as EFetch and ELink under the hood: search once, then let the server materialize the full result set rather than paging through it by hand. The db_xref lesson showed these databases point at each other; batch tools are how you pull the pointed-to records back in bulk instead of one click at a time. Once your batches involve conditional logic — "only if this gene lacks a MANE transcript" — that's the signal to reach for a script instead of a form.