Answers.Body: <p>The answer to this really depends on the type of data you're retrieving from GEO. Microarray data sets should have a normalised matrix of expression values uploaded as part of the entry. <code>getGEO()</code> from the <code>GEOquery</code> package will return a list of ExpressionSets - in many cases this list will have a length of 1. An ExpressionSet has an <code>exprs()</code> accessor for retrieving the expression matrix. An example (<a href="https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE76510" rel="nofollow noreferrer">GSE76510</a>, an Illumina HT12 v4 BeadArray dataset):</p>
  
  <pre><code>&gt; library(GEOquery)
  &gt; gse76510 &lt;- getGEO('GSE76510')
  &gt; names(gse76510)
  [1] "GSE76510_series_matrix.txt.gz"
  &gt; class(gse76510$GSE76510_series_matrix.txt.gz)
  [1] "ExpressionSet"
  attr(,"package")
  [1] "Biobase"
  &gt; exprs(gse76510$GSE76510_series_matrix.txt.gz) %&gt;% head
               GSM2027280 GSM2027281 GSM2027282 GSM2027283 GSM2027284 GSM2027285 GSM2027286
  ILMN_1343291  14.936287  14.983927  15.008199  14.830549  15.008199  14.789385  14.891532
  ILMN_1343295  13.404168  13.329903  13.289727  13.222221  13.386299  13.240755  13.125056
  ILMN_1651199   6.779805   7.189868   7.046952   6.962957   6.697924   6.850950   6.792647
  ILMN_1651209   6.983803   6.769702   7.016746   6.954751   6.890472   6.982947   6.915671
  ILMN_1651210   6.837042   6.999098   6.895225   6.944250   6.955914   6.917959   6.837368
  ILMN_1651221   7.034363   7.025626   6.606457   6.977622   7.051120   6.971884   7.066445
               GSM2027287 GSM2027288 GSM2027289 GSM2027290 GSM2027291
  ILMN_1343291  14.891532  14.983927  14.848452  14.913474  15.008199
  ILMN_1343295  13.240755  13.010757  13.525999  13.009661  12.998406
  ILMN_1651199   6.786784   6.820451   6.851160   7.013586   6.864316
  ILMN_1651209   6.983701   6.995199   7.270760   6.901377   6.950876
  ILMN_1651210   6.804955   7.033074   6.894117   6.770691   7.000786
  ILMN_1651221   7.003035   6.995199   7.050040   6.923861   6.929933
  </code></pre>
  
  <p>You will be able to filter out a list of required genes using the probe annotation (available in the appropriate annotation.db - in this case, for example, <code>illuminaHumanv4.db</code>).</p>
  
  <p>If the dataset you're interested in is RNA-Seq, you're probably out of luck. There's currently no requirement on data submitters to provide expression estimates with an RNA-Seq dataset, so the <code>ExpressionSet</code> that <code>GEOquery</code> returns will most likely have an empty <code>exprs</code> slot.</p>
  
  <p>Again, an example (<a href="https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE117133" rel="nofollow noreferrer">GSE117133</a>): </p>
  
  <pre><code>&gt; gse117133 &lt;- getGEO('GSE117133')
  &gt; exprs(gse117133$GSE117133_series_matrix.txt.gz)
   GSM3271892 GSM3271893 GSM3271894 GSM3271895 GSM3271896 GSM3271897
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-19T10:54:59.627Z
Answers.Text: Sir, I am confused which dataset should I use that contains the list of my interest and  help me in my model to predict relation between genes and diseases. Do you suggest to use GSE76510 (MY list is human proteins that included in DrugBank DB)?? Thanks in advance.
Answers.UserDisplayName: Eman Ismail
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-19T11:17:43.093Z
Answers.Text: @EmanIsmail I’m not suggesting any specific dataset here - they are merely to illustrate how the functions work in R. You need to find a dataset in GEO that assays gene expression in your system of interest.
Answers.UserDisplayName: sjcockell
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-18T11:23:56.210Z
Answers.LastActivityDate: 2018-07-18T11:37:14.067Z
Answers.LastEditDate: 2018-07-18T11:37:14.067Z
Answers.UserDisplayName: sjcockell
Body: <p>I am trying to get gene expression matrix for a list of genes
  I have for my list: Gene ID, Gene Symbol
  How can I get for each gene corresponding expression as array??
  I suppose that I will have 
  GENE_ID GENE_NAME SAMPLE_1 SAMPLE_2 .....
  I am new in that, I don't know more details
  I am trying to study relation between diseases and genes(human) using gene expression as features.
  Thanks in advance.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-07-17T09:15:19.687Z
Comments.Text: Are you working with a particular dataset?
Comments.UserDisplayName: sjcockell
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-07-17T11:46:50.433Z
Comments.Text: I am using GEOquery library
Comments.UserDisplayName: Eman Ismail
Tags: <gene><gene-expression><geoquery>
Title: Get Gene Expression Matrix from GEOquery
ThreadText: # Get Gene Expression Matrix from GEOquery
  
  (Asked by: username_0 on 2018-07-16)
  
  I am trying to get gene expression matrix for a list of genes
  I have for my list: Gene ID, Gene Symbol
  How can I get for each gene corresponding expression as array??
  I suppose that I will have
  GENE\_ID GENE\_NAME SAMPLE\_1 SAMPLE\_2 .....
  I am new in that, I don't know more details
  I am trying to study relation between diseases and genes(human) using gene expression as features.
  Thanks in advance.
  
  **Tags:** gene, gene-expression, geoquery
  
  > **Comments:**
  > **username_1**: Are you working with a particular dataset?  
  > **username_0**: I am using GEOquery library  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-07-18. Score: 3 | Accepted answer
  
  The answer to this really depends on the type of data you're retrieving from GEO. Microarray data sets should have a normalised matrix of expression values uploaded as part of the entry. `getGEO()` from the `GEOquery` package will return a list of ExpressionSets - in many cases this list will have a length of 1. An ExpressionSet has an `exprs()` accessor for retrieving the expression matrix. An example ([GSE76510](https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE76510), an Illumina HT12 v4 BeadArray dataset):
  
  ```
  > library(GEOquery)
  > gse76510 <- getGEO('GSE76510')
  > names(gse76510)
  [1] "GSE76510_series_matrix.txt.gz"
  > class(gse76510$GSE76510_series_matrix.txt.gz)
  [1] "ExpressionSet"
  attr(,"package")
  [1] "Biobase"
  > exprs(gse76510$GSE76510_series_matrix.txt.gz) %>% head
               GSM2027280 GSM2027281 GSM2027282 GSM2027283 GSM2027284 GSM2027285 GSM2027286
  ILMN_1343291  14.936287  14.983927  15.008199  14.830549  15.008199  14.789385  14.891532
  ILMN_1343295  13.404168  13.329903  13.289727  13.222221  13.386299  13.240755  13.125056
  ILMN_1651199   6.779805   7.189868   7.046952   6.962957   6.697924   6.850950   6.792647
  ILMN_1651209   6.983803   6.769702   7.016746   6.954751   6.890472   6.982947   6.915671
  ILMN_1651210   6.837042   6.999098   6.895225   6.944250   6.955914   6.917959   6.837368
  ILMN_1651221   7.034363   7.025626   6.606457   6.977622   7.051120   6.971884   7.066445
               GSM2027287 GSM2027288 GSM2027289 GSM2027290 GSM2027291
  ILMN_1343291  14.891532  14.983927  14.848452  14.913474  15.008199
  ILMN_1343295  13.240755  13.010757  13.525999  13.009661  12.998406
  ILMN_1651199   6.786784   6.820451   6.851160   7.013586   6.864316
  ILMN_1651209   6.983701   6.995199   7.270760   6.901377   6.950876
  ILMN_1651210   6.804955   7.033074   6.894117   6.770691   7.000786
  ILMN_1651221   7.003035   6.995199   7.050040   6.923861   6.929933
  
  ```
  
  You will be able to filter out a list of required genes using the probe annotation (available in the appropriate annotation.db - in this case, for example, `illuminaHumanv4.db`).
  
  If the dataset you're interested in is RNA-Seq, you're probably out of luck. There's currently no requirement on data submitters to provide expression estimates with an RNA-Seq dataset, so the `ExpressionSet` that `GEOquery` returns will most likely have an empty `exprs` slot.
  
  Again, an example ([GSE117133](https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE117133)):
  
  ```
  > gse117133 <- getGEO('GSE117133')
  > exprs(gse117133$GSE117133_series_matrix.txt.gz)
   GSM3271892 GSM3271893 GSM3271894 GSM3271895 GSM3271896 GSM3271897
  
  ```
  
  > **Comments:**
  > **username_0**: Sir, I am confused which dataset should I use that contains the list of my interest and  help me in my model to predict relation between genes and diseases. Do you suggest to use GSE76510 (MY list is human proteins that included in DrugBank DB)?? Thanks in advance.  
  > **username_1**: @username_0 I’m not suggesting any specific dataset here - they are merely to illustrate how the functions work in R. You need to find a dataset in GEO that assays gene expression in your system of interest.  
  
  ---
  
  