<p>Install package</p>

<pre><code>if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("GEOquery")
</code></pre>

<p>Use function getGEO to download the files.</p>

<pre><code>expressionSet &lt;- getGEO("GSE138651")
expressionSet &lt;- expressionSet[[1]]
</code></pre>

<p>You can then look at the info of the samples:</p>

<pre><code>pData(expressionSet)
</code></pre>

<p>And the assay data itself</p>

<pre><code>exprs(expressionSet)
</code></pre>

CC BY-SA 4.0
2020-05-07T14:51:48.490Z
This is useful because of the very specific instructions but I think it would be even more helpful to also include a brief introductory explanation and links to BioConductor and the GEOquery package to provide context for newcomers.
Geraldine_VdAuwera
CC BY-SA 4.0
2023-08-17T23:06:15.057Z
I am sorry but I have to flag this for removal since it's wrong. getGEO only returns expression data for arrays, not for NGS. Output of `exprs(expressionSet)` is empty and this is expected.
ATpoint
CC BY-SA 4.0
2020-05-07T12:44:55.373Z
2020-05-07T12:44:55.373Z
geom_na
<p>The simplest would be using a count matrix (at the end of the link you have shared, section "Supplementary file"). For example <code>GSE138651_Vagal_WholeNodoseSeq_raw.mtx.gz</code> corresponds to "raw" count matrices obtained after mapping and counting the reads. This file, along with the <code>GSE138651_barcodes.tsv.gz</code> and <code>GSE138651_genes.tsv.gz</code> can be used to "read" the data into <code>R</code>; to that end there are many options in the form of packages, <a href="https://satijalab.org/seurat/" rel="noreferrer">Seurat</a> is one of the best documented and hence is beginner-friendly.</p>

CC BY-SA 4.0
2020-04-13T21:28:34.963Z
Thanks Haci. I am learning Seurat as well. So many things!! 
I am actually the most interested in the file GSE138651_NGTall_Reads_cap.csv.gz. Do you know if this file type can be "read" into R?
Diana at Duke
CC BY-SA 4.0
2020-04-13T21:57:02.107Z
Yes, it is a `csv` file and once again there are many options to read such files into `R`. `read.csv()` is one option. Personally, I use `fread()` of `data.table` to read in tabular files.
haci
CC BY-SA 4.0
2020-04-14T13:31:40.277Z
I will try that then. Thank you again!
Diana at Duke
CC BY-SA 4.0
2020-04-13T21:21:15.620Z
2020-04-13T21:21:15.620Z
haci
<p>You might want to check out the <a href="https://bioconductor.org/packages/release/bioc/html/GEOquery.html" rel="nofollow noreferrer">BioConductor <em><code>GEOquery</code></em> package</a>.</p>

<p>Install using </p>

<pre class="lang-r prettyprint-override"><code>if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("GEOquery")
</code></pre>

<p>More information on how to use this package and read in data from GEO can be found in the <a href="https://bioconductor.org/packages/release/bioc/vignettes/GEOquery/inst/doc/GEOquery.html" rel="nofollow noreferrer">vignette</a></p>

CC BY-SA 4.0
2023-08-17T23:06:50.543Z
I am sorry but I have to flag this for removal since it's wrong. getGEO only returns expression data for arrays, not for NGS. This package does not apply here.
ATpoint
CC BY-SA 4.0
2020-05-06T19:00:40.243Z
2020-05-06T19:00:40.243Z
milanmlft
<p>I am new to R and computational biology. I am trying to look through a published data set to check for gene expression for my own project. I am having trouble finding materials to teach me how to analyze single cell RNA sequencing data on R from the GEO NCBI database.</p>

<p>This is the data that I am trying to access <a href="https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE138651" rel="nofollow noreferrer">https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE138651</a></p>

<p>I would appreciate any directions or suggestions for tutorials.</p>

<p>Thanks!</p>

<r><scrnaseq><phylogenetics><geoquery>
How do I pull singe cell RNA sequencing data from GEO database?
# How do I pull singe cell RNA sequencing data from GEO database?

(Asked by: username_0 on 2020-04-13)

I am new to R and computational biology. I am trying to look through a published data set to check for gene expression for my own project. I am having trouble finding materials to teach me how to analyze single cell RNA sequencing data on R from the GEO NCBI database.

This is the data that I am trying to access <https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE138651>

I would appreciate any directions or suggestions for tutorials.

Thanks!

**Tags:** r, scrnaseq, phylogenetics, geoquery

---

## 3 answers

### Answer by username_1 on 2020-05-07. Score: -1 | Accepted answer

Install package
if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("GEOquery")

Use function getGEO to download the files.
expressionSet <- getGEO("GSE138651")
expressionSet <- expressionSet[[1]]

You can then look at the info of the samples:
pData(expressionSet)

And the assay data itself
exprs(expressionSet)

> **Comments:**
> **username_2**: This is useful because of the very specific instructions but I think it would be even more helpful to also include a brief introductory explanation and links to BioConductor and the GEOquery package to provide context for newcomers.  
> **username_3**: I am sorry but I have to flag this for removal since it's wrong. getGEO only returns expression data for arrays, not for NGS. Output of `exprs(expressionSet)` is empty and this is expected.  

---

### Answer by username_4 on 2020-04-13. Score: 5

The simplest would be using a count matrix (at the end of the link you have shared, section "Supplementary file"). For example `GSE138651_Vagal_WholeNodoseSeq_raw.mtx.gz` corresponds to "raw" count matrices obtained after mapping and counting the reads. This file, along with the `GSE138651_barcodes.tsv.gz` and `GSE138651_genes.tsv.gz` can be used to "read" the data into `R`; to that end there are many options in the form of packages, [Seurat](https://satijalab.org/seurat/) is one of the best documented and hence is beginner-friendly.

> **Comments:**
> **username_0**: Thanks Haci. I am learning Seurat as well. So many things!!  I am actually the most interested in the file GSE138651_NGTall_Reads_cap.csv.gz. Do you know if this file type can be "read" into R?  
> **username_4**: Yes, it is a `csv` file and once again there are many options to read such files into `R`. `read.csv()` is one option. Personally, I use `fread()` of `data.table` to read in tabular files.  
> **username_0**: I will try that then. Thank you again!  

---

### Answer by username_5 on 2020-05-06. Score: -1

You might want to check out the BioConductor GEOquery package.
Install using 
if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("GEOquery")

More information on how to use this package and read in data from GEO can be found in the vignette

> **Comments:**
> **username_3**: I am sorry but I have to flag this for removal since it's wrong. getGEO only returns expression data for arrays, not for NGS. This package does not apply here.  

---

