This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Script for analyzing idat (illumina) microarray files with limma, any suggestion?

I have some idat files to analyze, since I haven’t found a complete script for doing it I have wrote one by myself:

library(limma)

# Files and experimental conditions
targets <- readTargets("targets.txt")  # I have two conditions "KO" and "WT"

# Reading data
idatfiles = dir(path="C:/Data", pattern = ".idat")
bgxfile = dir(path = "C:/Data", pattern = ".bgx")
data = read.idat(idatfiles, bgxfile)

# Normalization and background adjustment
data2 <- neqc(data)

# Build the design matrix for the linear modelling function. 
f <- factor(targets$Condition, levels = unique(targets$Condition))
design <- model.matrix(~0 + f)
colnames(design) <- levels(f)

# Apply the intensity values to lmFit. 
fit <- lmFit(data2, design)

# Create a contrast matrix. In this example, all combinations of contrasts can be set up as below. 
contrast.matrix <- makeContrasts("KO-WT",  levels=design)

# Apply this contrast matrix to the modeled data and compute statistics for the data.
fit2 <- contrasts.fit(fit, contrast.matrix)
fit2 <- eBayes(fit2)

# Output the statistics for the dataset and write them to disk for further analysis.
output <- topTable(fit2, adjust="BH", coef="KO-WT", genelist=data2$genes, number=Inf)
write.table(output, file="Results.txt", sep="\t", quote=FALSE)

I have two questions, is it correct? Do you have any suggestion to improve it?

Thank you very much.

r limma idat

2 answers

Hi, I have written a small automated script for analysis of idat files from Illumina beadarrays (HT12V4 platform, but you can change the platform to yours). You can find it here.

Thank you, I' ll check it

Can you please update the link? Thanks.

I tried but gave up since the debugging takes longer than creating my own script. Some errors below:

topTable = beadAnalyze(idats = c("9533701097_A_Grn.idat","9533701097_B_Grn.idat","9533701097_C_Grn.idat","9533701097_D_Grn.idat"),names = c("H7_2a_2v_A","H7_2a_2v_B","H7_2v_C","H7_2v_D"),condition = c("2a_2v","2a_2v","2v","2v"),ref.condition = "2v", fdr = 0.05, plotPCA = T) Annotating control probes using package illuminaHumanv4.db Version:1.26.0 Show Traceback Rerun with Debug Error in (function (od, vd) : object and replacement value dimnames differ

Error in validObject(.Object) : invalid class “ExpressionSet” object: 1: sampleNames differ between assayData and phenoData invalid class “ExpressionSet” object: 2: sampleNames differ between phenoData and protocolData

Your read.idat call couldn't work because you specified a path to dir but not to read.idat.

read.idat and neqc are the only function calls specific to Illumina arrays. Once you run them, it's just like any other limma analysis.

Log in to answer this question.