Question: Combining .idat and GEO data sets in minfi
0
3.2 years ago by
matts0
matts0 wrote:

Hi,

I am trying to combine raw (.idat) and GEO (intensity matrix) Illumina 450K data sets using minfi.

library(minfi)

geo.data <- getGenomicRatioSetFromGEO(GSE="")

my.data.raw <- preprocessRaw(my.data)

my.data.RG <- ratioConvert(my.data.raw, what = "both")

my.data.mset <- mapToGenome(my.data.RG)

At this point, is there a way I can combine the two GenomicRatioSets to form a single data set for downstream analysis? Sorry if this is a basic question, but I havn't been able to figure it out.

Thank you

Matt

minfi • 686 views
modified 3.2 years ago • written 3.2 years ago by matts0

Hi,

Do you have any idea about "TableControl data GSnormalisation HM450" and "TableControl annotations HM450" in illumina HM 450 k data?

I thought they are control probe tables (~700-800 probes?).  I am not 100% sure, but I believe those are integrated in the minfi package. So you shouldn't worry about these files when you are using minfi. Ask Kasper the author to double check. I am not 100% certain.

Answer: Combining .idat and GEO data sets in minfi
1
3.2 years ago by
USA/Seattle/Fred Hutchinson Cancer Research Center
Chao-Jen Wong30 wrote:

Below is a reproducible example for combing two MethylSet instances :

library(minfiData)
## creating two different sets
a <- MsetEx[1:100, ]
b <- MsetEx[50:120, ]
sampleNames(b) <- paste0("set", 1:6)
p <- intersect(featureNames(b), featureNames(a))
## found 51 overlapping featureNames then combine the sets
com <- combine(a[p, ], b[p, ])

Hi Chao-Jen,

Thank you so much for your response.

p <- intersect(featureNames(geo.data), featureNames(my.data.mset))
com_set <- combine(geo.data[p, ], my.data.mset[p, ])

However, I get this error:

Error in (function (classes, fdef, mtable)  :
unable to find an inherited method for function ‘combine’ for signature ‘"GenomicRatioSet", "GenomicRatioSet"’

Is there a similar function to combine that works on GenomicRatioSets?

Matt

Hi, Matt,

I just realize, by using showMethod("combine"), that the method only for "MethylSet".  My mistake. So it gets a little bit complicated here. I would manually construct a GenomicRatioSet to combine two GenomicRatioSet instances. Below is an example:

library(minfiData)
## 1. creating two different GenomicRatioSets
a <- MsetEx[1:100, ]
b <- MsetEx[50:120, ]
sampleNames(b) <- paste0("set", 1:6)
a_gr <- mapToGenome(ratioConvert(a, what="beta"))
b_gr <- mapToGenome(ratioConvert(b, what="beta"))

## 2. finding the common probe and subsetting the sets
p <- intersect(featureNames(b), featureNames(a))
a_sub <- a_gr[p, ]
b_sub <- b_gr[p, ]

## Combine the phenotype data and beta or M-values
## Note that the phenotype data (pData) is a data
## frame (or DataFrame) with samples as rows, variables as columns
pdata <- rbind(pData(a_sub), pData(b_sub))
beta <- cbind(getBeta(a_sub), getBeta(b_sub))
com <- GenomicRatioSet(gr = granges(a_sub), Beta=beta,
M=NULL, CN=NULL, pData=pdata, annotation=annotation(a_sub))

I don't know the GenomicRatioSet object you get from GEO has beta values or M-value and the return of pData might have different variable (in column) from that of your set. So you will need to be careful when creating the data.frame to feed to pData argument.

Fantastic! Thank you so much and I really appreciate the help.

Take care,

Matt