<p>Well, if you use a SOFT formatted files:</p>

<pre><code>#You can read your file 
gds &lt;- getGEO(filename="GSE9838_family.soft.gz")

# and check it
class(gds)
show(gds)

#then you usually would try to use  an exprs() accessor to retrieve the expression matrix:
exprs (gds[[1]])

# but in this case you will get an error revealing that it is a GSE datastructure
# eg. is composite structure having GSM and GPL object lists: 
names(GSMList(gds))
names(GPLList(gds))

# now GPLList is probably not interesting in this case
# but you can look at the GSM-objects from GSMList:
first &lt;- GSMList(gds)[[1]]
first
class(first)
Meta(first)

# at this point if you read the results you´ll notice that 
#    title 
#    [1] "X_intercept"

# and 
#   An object of class "GEODataTable"
#   ****** Column Descriptions ******
#   [1] Column      Description
#   &lt;0 rows&gt; (or 0-length row.names)
#   ****** Data Table ******
#   data frame with 0 columns and 0 rows
</code></pre>

<p>So here you would probably wonder if the data you want is these objects. If you go back go GEO page for GSE9838, you can find that <em>"Raw data provided as supplementary file. Processed data is available on Series record"</em>. So one may want to check series record instead:</p>

<pre><code># you can query the GSE9838 like this: 
data = getGEO("GSE9838")    

# then you can check what you´ve got
names(data)
#[1] "GSE9838_series_matrix.txt.gz"
class(data$GSE9838_series_matrix.txt.gz)

# and check what´s inside:
exprs(data$GSE9838_series_matrix.txt.gz)
# but apparently it just shows one header row. 
</code></pre>

<p>So it wasn´t there either. And if you check the size of the file, you´ll find that it is just 4.8 kb. My educated guess would be that the expression values are not in the dataset itself but probably in some of the supplementary files?</p>

<p>If you want to download them, you can:</p>

<pre><code>filePaths = getGEOSuppFiles("GSE9838")
filePaths
untar("GSE9838/GSE9838_RAW.tar", exdir = "GSE9838/CEL")
list.files("GSE9838/CEL")
</code></pre>

<p>...what will allow you to see all the CEL files with the data. </p>

CC BY-SA 4.0
2019-03-29T18:48:26.853Z
Thank you so much! I will try to open the raw data.
Qiran
CC BY-SA 4.0
2019-03-28T19:06:35.613Z
2019-03-29T19:00:58.187Z
2019-03-29T19:00:58.187Z
Oka
<p>I want to open the expression data GSE9838 dataset from GEO using GEOquery R package.</p>

<pre><code>gset &lt;- getGEO(filename="GSE9838_family.soft.gz")
</code></pre>

<p>The result of this code said it's S4 object of class GSE.</p>

<p>How can I get the expression data of GSE9838?</p>

CC BY-SA 4.0
2019-03-28T12:42:23.050Z
Welcome to the site. Have you looked for the tutorial of GEOquery? You can see them with `vignette(package="GEOquery") `. Also have you looked around on this site and in [support.bioconductor.org](https://support.bioconductor.org/) for how have other people done this?
llrs
CC BY-SA 4.0
2019-03-28T12:43:01.217Z
Possible duplicate of [Extracting expression data from GSE dataset downloaded from GEO](https://bioinformatics.stackexchange.com/questions/2408/extracting-expression-data-from-gse-dataset-downloaded-from-geo)
llrs
CC BY-SA 4.0
2019-03-28T19:15:56.723Z
Not sure if that method works in this case
Oka
CC BY-SA 4.0
2019-03-29T09:38:36.860Z
@Oka Why shouldn't it work? Have Qiran tested it? At least mentioning that it didn't work it would help the people trying to answer the question (and future readers)
llrs
CC BY-SA 4.0
2019-03-29T13:00:49.657Z
@llrs I´ve checked if it would, and it didn´t (at least on the first trial). The method worked fine with GSE used in the example, but didn´t seem to work in this case for some reason..
Oka
CC BY-SA 4.0
2019-03-29T13:08:31.700Z
Ok, how it didn't work, could you post the code so I could see what is the error message and the options you used?
llrs
CC BY-SA 4.0
2019-03-29T13:50:33.733Z
`datExpr = exprs (data[[1]])` will just give an object with one header line (      GSM248431 GSM248432 GSM248433 GSM248434 GSM248435 GSM248436 GSM248437 GSM248438 GSM248439 GSM248440 GSM248441 GSM248442)
Oka
<r><bioconductor><microarray><geoquery>
Extracting expression data in r from GEO and got a S4 object
# Extracting expression data in r from GEO and got a S4 object

(Asked by: username_0 on 2019-03-28)

I want to open the expression data GSE9838 dataset from GEO using GEOquery R package.
gset <- getGEO(filename="GSE9838_family.soft.gz")

The result of this code said it's S4 object of class GSE.
How can I get the expression data of GSE9838?

**Tags:** r, bioconductor, microarray, geoquery
> **Comments:**
> **username_1**: Welcome to the site. Have you looked for the tutorial of GEOquery? You can see them with `vignette(package="GEOquery") `. Also have you looked around on this site and in [support.bioconductor.org](https://support.bioconductor.org/) for how have other people done this?  
> **username_1**: Possible duplicate of [Extracting expression data from GSE dataset downloaded from GEO](https://bioinformatics.stackexchange.com/questions/2408/extracting-expression-data-from-gse-dataset-downloaded-from-geo)  
> **username_2**: Not sure if that method works in this case  
> **username_1**: @Oka Why shouldn't it work? Have Qiran tested it? At least mentioning that it didn't work it would help the people trying to answer the question (and future readers)  
> **username_2**: @llrs I´ve checked if it would, and it didn´t (at least on the first trial). The method worked fine with GSE used in the example, but didn´t seem to work in this case for some reason..  
> **username_1**: Ok, how it didn't work, could you post the code so I could see what is the error message and the options you used?  
> **username_2**: `datExpr = exprs (data[[1]])` will just give an object with one header line (      GSM248431 GSM248432 GSM248433 GSM248434 GSM248435 GSM248436 GSM248437 GSM248438 GSM248439 GSM248440 GSM248441 GSM248442)  

---

## 1 answers

### Answer by username_2 on 2019-03-28. Score: 1

Well, if you use a SOFT formatted files:
#You can read your file 
gds <- getGEO(filename="GSE9838_family.soft.gz")

# and check it
class(gds)
show(gds)

#then you usually would try to use  an exprs() accessor to retrieve the expression matrix:
exprs (gds[[1]])

# but in this case you will get an error revealing that it is a GSE datastructure
# eg. is composite structure having GSM and GPL object lists: 
names(GSMList(gds))
names(GPLList(gds))

# now GPLList is probably not interesting in this case
# but you can look at the GSM-objects from GSMList:
first <- GSMList(gds)[[1]]
first
class(first)
Meta(first)

# at this point if you read the results you´ll notice that 
#    title 
#    [1] "X_intercept"

# and 
#   An object of class "GEODataTable"
#   ****** Column Descriptions ******
#   [1] Column      Description
#   <0 rows> (or 0-length row.names)
#   ****** Data Table ******
#   data frame with 0 columns and 0 rows

So here you would probably wonder if the data you want is these objects. If you go back go GEO page for GSE9838, you can find that "Raw data provided as supplementary file. Processed data is available on Series record". So one may want to check series record instead:
# you can query the GSE9838 like this: 
data = getGEO("GSE9838")    

# then you can check what you´ve got
names(data)
#[1] "GSE9838_series_matrix.txt.gz"
class(data$GSE9838_series_matrix.txt.gz)

# and check what´s inside:
exprs(data$GSE9838_series_matrix.txt.gz)
# but apparently it just shows one header row. 

So it wasn´t there either. And if you check the size of the file, you´ll find that it is just 4.8 kb. My educated guess would be that the expression values are not in the dataset itself but probably in some of the supplementary files?
If you want to download them, you can:
filePaths = getGEOSuppFiles("GSE9838")
filePaths
untar("GSE9838/GSE9838_RAW.tar", exdir = "GSE9838/CEL")
list.files("GSE9838/CEL")

...what will allow you to see all the CEL files with the data.

> **Comments:**
> **username_0**: Thank you so much! I will try to open the raw data.  

---

