<p>You can use <a href="https://www.ncbi.nlm.nih.gov/books/NBK179288/" rel="nofollow noreferrer">Entrez Direct</a> for this. The following returns Unique Identifiers which are just bare integers.</p>
<pre><code>$ geo_query='&quot;Expression profiling by high throughput sequencing&quot;[DataSet Type] AND (&quot;Homo sapiens&quot;[Organism] OR &quot;Mus musculus&quot;[Organism] OR &quot;rattus norvegicus&quot;[Organism]) AND (&quot;2020/01/01&quot;[PDAT] : &quot;3000&quot;[PDAT])'
$ esearch -db gds -query &quot;$geo_query&quot; | efetch -format uid &gt; gds_results.txt 
$ wc -l gds_results.txt 
9981 gds_results.txt
$ head -n2 gds_results.txt 
200134092
200120931
</code></pre>
<p>Instead, if you are looking for a way to get the GSE accessions, you can use the built-in <code>xtract</code> command to parse the XML returned by <code>esummary</code> as follows:</p>
<pre><code>$ esearch -db gds -query &quot;$geo_query&quot; | esummary | xtract -pattern DocumentSummary -first Accession &gt; gse_accs.txt &gt; gse_accs.txt
$ wc -l gse_accs.txt 
9981 gse_accs.txt
$ head -n2 gse_accs.txt 
GSE165829
GSE165824
</code></pre>

CC BY-SA 4.0
2021-01-31T01:56:28.673Z
2021-01-31T01:56:28.673Z
vkkodali
<p>I think I would just try to do this with GEOquery.</p>
<p><a href="https://bioconductor.org/packages/release/bioc/html/GEOquery.html" rel="nofollow noreferrer">https://bioconductor.org/packages/release/bioc/html/GEOquery.html</a></p>

CC BY-SA 4.0
2021-01-02T05:17:06.223Z
GEOquery would download datasets for a given accession ID. R provides a library https://www.bioconductor.org/packages/release/bioc/html/GEOmetadb.html which contains metadata for microarray studies. I couldn't find anything similar to this for RNASeq studies so had to resort to the GUI.
Pawan Verma
CC BY-SA 4.0
2021-01-06T00:03:56.263Z
Oh you're right, I did something similar before, i though it was GEOquery but i guess i don't remember... Ok, can you download the text file like:
"Send To" -> "File" -> "Format" Summary (text)

And then do something like:

cat gds_result.txt | grep 'Accession: GSE' | cut -f 3 | cut -f 2 -d ' ' | sort > gse.txt
k1sauce
CC BY-SA 4.0
2020-12-31T22:30:56.663Z
2020-12-31T22:30:56.663Z
k1sauce
<p><strong>AIM:</strong> Download &quot;Unique Identifier List&quot; for the following query from <a href="https://www-ncbi-nlm-nih-gov.ezproxy.u-pec.fr/gds" rel="nofollow noreferrer">GEO DataSets</a>.</p>
<p><strong>Query:</strong> <em>(&quot;Expression profiling by high throughput sequencing&quot;[DataSet Type] AND (&quot;Homo sapiens&quot;[Organism] OR &quot;Mus musculus&quot;[Organism] OR &quot;rattus norvegicus&quot;[Organism])) AND (&quot;2020/01/01&quot;[PDAT] : &quot;3000&quot;[PDAT])</em></p>
<p>which means, all RNASeq studies deposited on GEO in the year 2020 for humans, mice or rat.</p>
<p>Problem: I need the GSE ID list for ~9k datasets, but while trying to download the list of ids, it loads to a blank page and nothing happens. Also, clicking on &quot;Next Page&quot; gives error.
I have been trying for the last 3-4 days but it doesn't work.</p>
<p><strong>Steps to generate file:</strong></p>
<p><em>&quot;Send To&quot; -&gt; &quot;File&quot; -&gt; &quot;Format&quot; (Unique Identifier List) -&gt; &quot;Sort By&quot; (Default Order) -&gt; &quot;Create File&quot;</em></p>

<phylogenetics><geo>
Getting Unique Identifier List for GEO Datasets NCBI
# Getting Unique Identifier List for GEO Datasets NCBI

(Asked by: username_0 on 2020-12-31)

**AIM:** Download "Unique Identifier List" for the following query from [GEO DataSets](https://www-ncbi-nlm-nih-gov.ezproxy.u-pec.fr/gds).

**Query:** *("Expression profiling by high throughput sequencing"[DataSet Type] AND ("Homo sapiens"[Organism] OR "Mus musculus"[Organism] OR "rattus norvegicus"[Organism])) AND ("2020/01/01"[PDAT] : "3000"[PDAT])*

which means, all RNASeq studies deposited on GEO in the year 2020 for humans, mice or rat.

Problem: I need the GSE ID list for ~9k datasets, but while trying to download the list of ids, it loads to a blank page and nothing happens. Also, clicking on "Next Page" gives error.
I have been trying for the last 3-4 days but it doesn't work.

**Steps to generate file:**

*"Send To" -> "File" -> "Format" (Unique Identifier List) -> "Sort By" (Default Order) -> "Create File"*

**Tags:** phylogenetics, geo

---

## 2 answers

### Answer by username_1 on 2021-01-31. Score: 1 | Accepted answer

You can use Entrez Direct for this. The following returns Unique Identifiers which are just bare integers.
$ geo_query='"Expression profiling by high throughput sequencing"[DataSet Type] AND ("Homo sapiens"[Organism] OR "Mus musculus"[Organism] OR "rattus norvegicus"[Organism]) AND ("2020/01/01"[PDAT] : "3000"[PDAT])'
$ esearch -db gds -query "$geo_query" | efetch -format uid > gds_results.txt 
$ wc -l gds_results.txt 
9981 gds_results.txt
$ head -n2 gds_results.txt 
200134092
200120931

Instead, if you are looking for a way to get the GSE accessions, you can use the built-in xtract command to parse the XML returned by esummary as follows:
$ esearch -db gds -query "$geo_query" | esummary | xtract -pattern DocumentSummary -first Accession > gse_accs.txt > gse_accs.txt
$ wc -l gse_accs.txt 
9981 gse_accs.txt
$ head -n2 gse_accs.txt 
GSE165829
GSE165824


---

### Answer by username_2 on 2020-12-31. Score: 0

I think I would just try to do this with GEOquery.

<https://bioconductor.org/packages/release/bioc/html/GEOquery.html>

> **Comments:**
> **username_0**: GEOquery would download datasets for a given accession ID. R provides a library https://www.bioconductor.org/packages/release/bioc/html/GEOmetadb.html which contains metadata for microarray studies. I couldn't find anything similar to this for RNASeq studies so had to resort to the GUI.  
> **username_2**: Oh you're right, I did something similar before, i though it was GEOquery but i guess i don't remember... Ok, can you download the text file like: "Send To" -> "File" -> "Format" Summary (text)  And then do something like:  cat gds_result.txt | grep 'Accession: GSE' | cut -f 3 | cut -f 2 -d ' ' | sort > gse.txt  

---

