Getting Unique Identifier List for GEO Datasets NCBI AIM: Download &quot;Unique Identifier List&quot; for the following query from GEO DataSets.
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])
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 &quot;Next Page&quot; gives error.
I have been trying for the last 3-4 days but it doesn't work.
Steps to generate file:
&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;
You can use Entrez Direct for this. The following returns Unique Identifiers which are just bare integers.
$ 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

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 &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