Skill Tracer
Skills › Scientific Agent Skills › database-lookup › sra.md

sra.md

150 lines · skills/database-lookup/references/sra.md at 5f2bc03

Open on GitHub
1# SRA (Sequence Read Archive) API Reference
2

SRA (Sequence Read Archive) API Reference

Raw lines 1 to 2
3## Overview
4Sequencing run metadata: experiments, samples, studies, and runs. Accessible via E-utilities with `db=sra`. Returns XML metadata describing sequencing experiments, platforms, library strategies, and sample attributes.
5

Overview

Sequencing run metadata: experiments, samples, studies, and runs. Accessible via E-utilities with db=sra. Returns XML metadata describing sequencing experiments, platforms, library strategies, and sample attributes.

Raw lines 3 to 5
6## Base URL
7```
8https://eutils.ncbi.nlm.nih.gov/entrez/eutils/
9```

Base URL

https://eutils.ncbi.nlm.nih.gov/entrez/eutils/
Raw lines 6 to 10
11## Authentication
12- **API key** (recommended): Append `&api_key=YOUR_KEY`.
13- Without key: 3 req/sec. With key: 10 req/sec.
14- Provide `tool` and `email` parameters.

Authentication

  • API key (recommended): Append &api_key=YOUR_KEY.
  • Without key: 3 req/sec. With key: 10 req/sec.
  • Provide tool and email parameters.
Raw lines 11 to 15
16## Key Endpoints

Key Endpoints

Raw lines 16 to 17
18### 1. ESearch -- Search SRA records
19```
20GET esearch.fcgi?db=sra&term=QUERY&retmax=N&retmode=json
21```
23**Example -- search RNA-seq experiments in human:**
24```
25GET esearch.fcgi?db=sra&term=RNA-seq[Strategy] AND Homo sapiens[Organism]&retmax=5&retmode=json
26```
27Response:
28```json
30 "esearchresult": {
31 "count": "584231",
32 "retmax": "5",
33 "idlist": ["28574913", "28574912", "28574911", ...]
34 }
36```
38**Example -- search by accession:**
39```
40GET esearch.fcgi?db=sra&term=SRP123456[Accession] OR SRR123456[Accession]&retmode=json
41```

1. ESearch -- Search SRA records

GET esearch.fcgi?db=sra&term=QUERY&retmax=N&retmode=json

Example -- search RNA-seq experiments in human:

GET esearch.fcgi?db=sra&term=RNA-seq[Strategy] AND Homo sapiens[Organism]&retmax=5&retmode=json

Response:

{
  "esearchresult": {
    "count": "584231",
    "retmax": "5",
    "idlist": ["28574913", "28574912", "28574911", ...]
  }
}

Example -- search by accession:

GET esearch.fcgi?db=sra&term=SRP123456[Accession] OR SRR123456[Accession]&retmode=json
Raw lines 18 to 42
43### 2. EFetch -- Retrieve full SRA metadata (XML only)
44```
45GET efetch.fcgi?db=sra&id=IDS&rettype=full&retmode=xml
46```
48**Example -- fetch metadata for an SRA record:**
49```
50GET efetch.fcgi?db=sra&id=28574913&rettype=full&retmode=xml
51```
52Response (abbreviated XML):
53```xml
54<EXPERIMENT_PACKAGE_SET>
55 <EXPERIMENT_PACKAGE>
56 <EXPERIMENT accession="SRX12345" alias="...">
57 <TITLE>RNA-seq of human liver tissue</TITLE>
58 <STUDY_REF accession="SRP12345"/>
59 <DESIGN>
60 <LIBRARY_DESCRIPTOR>
61 <LIBRARY_STRATEGY>RNA-Seq</LIBRARY_STRATEGY>
62 <LIBRARY_SOURCE>TRANSCRIPTOMIC</LIBRARY_SOURCE>
63 <LIBRARY_SELECTION>cDNA</LIBRARY_SELECTION>
64 <LIBRARY_LAYOUT><PAIRED/></LIBRARY_LAYOUT>
65 </LIBRARY_DESCRIPTOR>
66 </DESIGN>
67 <PLATFORM>
68 <ILLUMINA><INSTRUMENT_MODEL>Illumina NovaSeq 6000</INSTRUMENT_MODEL></ILLUMINA>
69 </PLATFORM>
70 </EXPERIMENT>
71 <SUBMISSION accession="SRA12345" center_name="GEO"/>
72 <Organization><Name>Some Institute</Name></Organization>
73 <STUDY accession="SRP12345">
74 <DESCRIPTOR>
75 <STUDY_TITLE>Transcriptomic analysis of human tissues</STUDY_TITLE>
76 <STUDY_TYPE existing_study_type="Transcriptome Analysis"/>
77 </DESCRIPTOR>
78 </STUDY>
79 <SAMPLE accession="SRS12345">
80 <TITLE>Human liver RNA</TITLE>
81 <SAMPLE_ATTRIBUTES>
82 <SAMPLE_ATTRIBUTE><TAG>tissue</TAG><VALUE>liver</VALUE></SAMPLE_ATTRIBUTE>
83 <SAMPLE_ATTRIBUTE><TAG>cell_type</TAG><VALUE>hepatocyte</VALUE></SAMPLE_ATTRIBUTE>
84 </SAMPLE_ATTRIBUTES>
85 </SAMPLE>
86 <RUN_SET>
87 <RUN accession="SRR12345" total_spots="45000000" total_bases="9000000000">
88 <Statistics nreads="2">
89 <Read average="150" count="45000000"/>
90 </Statistics>
91 </RUN>
92 </RUN_SET>
93 </EXPERIMENT_PACKAGE>
94</EXPERIMENT_PACKAGE_SET>
95```

2. EFetch -- Retrieve full SRA metadata (XML only)

GET efetch.fcgi?db=sra&id=IDS&rettype=full&retmode=xml

Example -- fetch metadata for an SRA record:

GET efetch.fcgi?db=sra&id=28574913&rettype=full&retmode=xml

Response (abbreviated XML):

<EXPERIMENT_PACKAGE_SET>
  <EXPERIMENT_PACKAGE>
    <EXPERIMENT accession="SRX12345" alias="...">
      <TITLE>RNA-seq of human liver tissue</TITLE>
      <STUDY_REF accession="SRP12345"/>
      <DESIGN>
        <LIBRARY_DESCRIPTOR>
          <LIBRARY_STRATEGY>RNA-Seq</LIBRARY_STRATEGY>
          <LIBRARY_SOURCE>TRANSCRIPTOMIC</LIBRARY_SOURCE>
          <LIBRARY_SELECTION>cDNA</LIBRARY_SELECTION>
          <LIBRARY_LAYOUT><PAIRED/></LIBRARY_LAYOUT>
        </LIBRARY_DESCRIPTOR>
      </DESIGN>
      <PLATFORM>
        <ILLUMINA><INSTRUMENT_MODEL>Illumina NovaSeq 6000</INSTRUMENT_MODEL></ILLUMINA>
      </PLATFORM>
    </EXPERIMENT>
    <SUBMISSION accession="SRA12345" center_name="GEO"/>
    <Organization><Name>Some Institute</Name></Organization>
    <STUDY accession="SRP12345">
      <DESCRIPTOR>
        <STUDY_TITLE>Transcriptomic analysis of human tissues</STUDY_TITLE>
        <STUDY_TYPE existing_study_type="Transcriptome Analysis"/>
      </DESCRIPTOR>
    </STUDY>
    <SAMPLE accession="SRS12345">
      <TITLE>Human liver RNA</TITLE>
      <SAMPLE_ATTRIBUTES>
        <SAMPLE_ATTRIBUTE><TAG>tissue</TAG><VALUE>liver</VALUE></SAMPLE_ATTRIBUTE>
        <SAMPLE_ATTRIBUTE><TAG>cell_type</TAG><VALUE>hepatocyte</VALUE></SAMPLE_ATTRIBUTE>
      </SAMPLE_ATTRIBUTES>
    </SAMPLE>
    <RUN_SET>
      <RUN accession="SRR12345" total_spots="45000000" total_bases="9000000000">
        <Statistics nreads="2">
          <Read average="150" count="45000000"/>
        </Statistics>
      </RUN>
    </RUN_SET>
  </EXPERIMENT_PACKAGE>
</EXPERIMENT_PACKAGE_SET>
Raw lines 43 to 96
97### 3. ESummary -- Brief SRA summaries
98```
99GET esummary.fcgi?db=sra&id=IDS&retmode=json
100```
101Returns: experiment title, platform, total runs/spots/bases, create date, study/sample accessions as an XML string in the `expxml` and `runs` fields.

3. ESummary -- Brief SRA summaries

GET esummary.fcgi?db=sra&id=IDS&retmode=json

Returns: experiment title, platform, total runs/spots/bases, create date, study/sample accessions as an XML string in the expxml and runs fields.

Raw lines 97 to 102
103### 4. ELink -- Cross-link to other NCBI databases
104```
105GET elink.fcgi?dbfrom=sra&db=biosample&id=SRA_UID
106GET elink.fcgi?dbfrom=sra&db=gds&id=SRA_UID
107```

4. ELink -- Cross-link to other NCBI databases

GET elink.fcgi?dbfrom=sra&db=biosample&id=SRA_UID
GET elink.fcgi?dbfrom=sra&db=gds&id=SRA_UID
Raw lines 103 to 108
109## SRA Accession Types
110| Prefix | Entity |
111|--------|--------|
112| `SRP` / `ERP` / `DRP` | Study |
113| `SRX` / `ERX` / `DRX` | Experiment |
114| `SRS` / `ERS` / `DRS` | Sample |
115| `SRR` / `ERR` / `DRR` | Run |
116| `SRA` | Submission |

SRA Accession Types

PrefixEntity
SRP / ERP / DRPStudy
SRX / ERX / DRXExperiment
SRS / ERS / DRSSample
SRR / ERR / DRRRun
SRASubmission
Raw lines 109 to 117
118## Common Search Patterns
119```
120# By organism and strategy
121term=Mus musculus[Organism] AND WGS[Strategy]
123# By platform
124term=Illumina[Platform] AND ATAC-seq[Strategy] AND human[Organism]
126# By study accession
127term=SRP123456[Accession]
129# By BioProject
130term=PRJNA123456[BioProject]
132# By date range
133term=("2024/01/01"[Publication Date] : "2024/12/31"[Publication Date])
135# By library source
136term=GENOMIC[Source] AND ChIP-Seq[Strategy] AND cancer[Text Word]
138# By read count range
139# Download run metadata, then filter the reported read_count field locally.
140# Read length and number of reads are different quantities.
142# Combined complex query
143term=(RNA-Seq[Strategy] AND paired[Layout] AND Homo sapiens[Organism] AND Illumina[Platform])
144```

Common Search Patterns

# By organism and strategy
term=Mus musculus[Organism] AND WGS[Strategy]

# By platform
term=Illumina[Platform] AND ATAC-seq[Strategy] AND human[Organism]

# By study accession
term=SRP123456[Accession]

# By BioProject
term=PRJNA123456[BioProject]

# By date range
term=("2024/01/01"[Publication Date] : "2024/12/31"[Publication Date])

# By library source
term=GENOMIC[Source] AND ChIP-Seq[Strategy] AND cancer[Text Word]

# By read count range
# Download run metadata, then filter the reported read_count field locally.
# Read length and number of reads are different quantities.

# Combined complex query
term=(RNA-Seq[Strategy] AND paired[Layout] AND Homo sapiens[Organism] AND Illumina[Platform])
Raw lines 118 to 145
146## Rate Limits
147- Without API key: 3 requests/second
148- With API key: 10 requests/second
149- For bulk metadata: use `usehistory=y` with `WebEnv`/`query_key`, fetch in batches
150- Actual sequence data (FASTQ) is NOT available via E-utilities; use SRA Toolkit (`fastq-dump`/`fasterq-dump`) or the SRA cloud URLs

Rate Limits

  • Without API key: 3 requests/second
  • With API key: 10 requests/second
  • For bulk metadata: use usehistory=y with WebEnv/query_key, fetch in batches
  • Actual sequence data (FASTQ) is NOT available via E-utilities; use SRA Toolkit (fastq-dump/fasterq-dump) or the SRA cloud URLs
Raw lines 146 to 150