rbioinformaticsdata-analysisbioconductorlimma

How do I tell R package Limma what to use as "targets" in read.idat()?


I am analyzing some microarray data. For each donor, I have a "before intervention" and an "after intervention" idat file. I have successfully read these into R using the Limma package with the read.idat() function. However, the resulting object only has one column in targets: "IDATfile". I believe that if I was using read.ilmn() I would specify a targets.txt file but I can't see this option when using read.idat(). E.g. in the Limma user guide Illumina example, the targets are "Donor", "Age", and "Cell Type". How do I tell Limma what to put as targets? I would like to have "Donor" and "Intervention".

An example of what I mean:

idatfiles <- dir(pattern="idat")
bgxfile <- dir(pattern="bgx")
x <- read.idat(idatfiles, bgxfile)
colnames(x$targets)
[1] "IDATfile"

Instead of "IDATfile", I would like this to be "Donor" and "Intervention". I can include some other columns of the original IDAT files as further targets by doing read.idat(..., dateinfo=TRUE), but I don't know how to edit these columns to make them "Donor" and "Intervention":

[1] "IDATfile"   "ScanInfo"   "DecodeInfo"

Let me know if any more info is needed, really appreciate any help!


Solution

  • If you want to simply edit colnames you can use:

    colnames(x$targets) <- c("Donor")
    

    But I think rows are samples in the target dataframe so is that really what you want?

    http://web.mit.edu/~r/current/arch/i386_linux26/lib/R/library/limma/html/EList.html

    targets data.frame containing information on the target RNA samples. Rows correspond to samples. May have any number of columns.