<p>UPDATE: I found the solution. I was using normalized values and GEO was using raw beta values.</p>

<p>I'm trying to link GEOquery and minfi. </p>

<p>Specifically I want to obtain beta values from the idat files on GEOquery. I was following this guide: <a href="https://kasperdanielhansen.github.io/genbioconductor/html/minfi.html" rel="nofollow noreferrer">https://kasperdanielhansen.github.io/genbioconductor/html/minfi.html</a>, up until the preprocessing part. Meaning that I was able to obtain the RGset. Then I used my own preprocessing code to obtain the beta values. However, I cross checked them with the beta values that were on GEO and they weren't consistent.</p>

<p>For example, the accession number I used was GSE68777. So I went to that study on GEO and clicked on the first sample: <a href="https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSM1681154" rel="nofollow noreferrer">https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSM1681154</a>. Then I scrolled down and clicked "Download full table" to download the samples and beta values in a text file. </p>

<p>Then I typed head(beta) and chose the first sample. Then I did command F in the text file for that sample and it's value there wasn't the same as the value from the beta data table. Hopefully you can help find the error.</p>

<p>Here is the code I'm using:</p>

<pre><code>library(GEOquery)
library(minfi)
library("IlluminaHumanMethylation450kanno.ilmn12.hg19")
library("IlluminaHumanMethylation450kmanifest")

######## Code copied from 450k Guide ########

getGEOSuppFiles("GSE68777")
untar("GSE68777/GSE68777_RAW.tar", exdir = "GSE68777/idat")
head(list.files("GSE68777/idat", pattern = "idat"))
idatFiles &lt;- list.files("GSE68777/idat", pattern = "idat.gz$", full = TRUE)
sapply(idatFiles, gunzip, overwrite = TRUE)
rgSet &lt;- read.metharray.exp("GSE68777/idat")
geoMat &lt;- getGEO("GSE68777")
pD.all &lt;- pData(geoMat[[1]])
pD &lt;- pD.all[, c("title", "geo_accession", "characteristics_ch1.1", "characteristics_ch1.2")]
names(pD)[c(3,4)] &lt;- c("group", "sex")
pD$group &lt;- sub("^diagnosis: ", "", pD$group)
pD$sex &lt;- sub("^Sex: ", "", pD$sex)
sampleNames(rgSet) &lt;- sub(".*_5", "5", sampleNames(rgSet))
rownames(pD) &lt;- pD$title
pD &lt;- pD[sampleNames(rgSet),]
pData(rgSet) &lt;- pD
</code></pre>

CC BY-SA 3.0
2017-07-12T09:47:10.690Z
Could you actually post the numeric values, so I don't have to rerun and do all again? Did you check if for the same position do you have the same beta value? Maybe you weren't comparing the same positions
llrs
CC BY-SA 3.0
2017-07-12T21:54:45.790Z
Presumably the authors used a specific `preprocess*()` function. Since they didn't put it in the paper, you'll need to ask them.
Devon Ryan
CC BY-SA 3.0
2017-07-12T22:45:52.917Z
You really need to show us the exact value you’re getting, and where you think you’re getting it from (which probe). This sounds like it’s just normal floating point imprecision. Meaning the value is present in the text file but with different rounding.
Konrad Rudolph
CC BY-SA 3.0
2017-07-13T01:05:30.510Z
I figured it out. They used the raw beta values but I was using normalized values. Thanks for the comments though
Ezra Bekele
CC BY-SA 3.0
2017-07-17T12:26:42.747Z
@EzraBekele Could you write a short answer stating this? It makes it more easily findable for other users.
Konrad Rudolph
<r><bioconductor><normalization><methylation><data-mining>
Minfi returning incorrect beta values
# Minfi returning incorrect beta values

(Asked by: username_0 on 2017-07-11)

UPDATE: I found the solution. I was using normalized values and GEO was using raw beta values.
I'm trying to link GEOquery and minfi. 
Specifically I want to obtain beta values from the idat files on GEOquery. I was following this guide: https://kasperdanielhansen.github.io/genbioconductor/html/minfi.html, up until the preprocessing part. Meaning that I was able to obtain the RGset. Then I used my own preprocessing code to obtain the beta values. However, I cross checked them with the beta values that were on GEO and they weren't consistent.
For example, the accession number I used was GSE68777. So I went to that study on GEO and clicked on the first sample: https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSM1681154. Then I scrolled down and clicked "Download full table" to download the samples and beta values in a text file. 
Then I typed head(beta) and chose the first sample. Then I did command F in the text file for that sample and it's value there wasn't the same as the value from the beta data table. Hopefully you can help find the error.
Here is the code I'm using:
library(GEOquery)
library(minfi)
library("IlluminaHumanMethylation450kanno.ilmn12.hg19")
library("IlluminaHumanMethylation450kmanifest")

######## Code copied from 450k Guide ########

getGEOSuppFiles("GSE68777")
untar("GSE68777/GSE68777_RAW.tar", exdir = "GSE68777/idat")
head(list.files("GSE68777/idat", pattern = "idat"))
idatFiles <- list.files("GSE68777/idat", pattern = "idat.gz$", full = TRUE)
sapply(idatFiles, gunzip, overwrite = TRUE)
rgSet <- read.metharray.exp("GSE68777/idat")
geoMat <- getGEO("GSE68777")
pD.all <- pData(geoMat[[1]])
pD <- pD.all[, c("title", "geo_accession", "characteristics_ch1.1", "characteristics_ch1.2")]
names(pD)[c(3,4)] <- c("group", "sex")
pD$group <- sub("^diagnosis: ", "", pD$group)
pD$sex <- sub("^Sex: ", "", pD$sex)
sampleNames(rgSet) <- sub(".*_5", "5", sampleNames(rgSet))
rownames(pD) <- pD$title
pD <- pD[sampleNames(rgSet),]
pData(rgSet) <- pD

**Tags:** r, bioconductor, normalization, methylation, data-mining
> **Comments:**
> **username_1**: Could you actually post the numeric values, so I don't have to rerun and do all again? Did you check if for the same position do you have the same beta value? Maybe you weren't comparing the same positions  
> **username_2**: Presumably the authors used a specific `preprocess*()` function. Since they didn't put it in the paper, you'll need to ask them.  
> **username_3**: You really need to show us the exact value you’re getting, and where you think you’re getting it from (which probe). This sounds like it’s just normal floating point imprecision. Meaning the value is present in the text file but with different rounding.  
> **username_0**: I figured it out. They used the raw beta values but I was using normalized values. Thanks for the comments though  
> **username_3**: @EzraBekele Could you write a short answer stating this? It makes it more easily findable for other users.  

---

## 0 answers

