Affymetrix CEL files


This analysis was performed using R (ver. 3.1.0).

Download raw data

The raw data files for this lab are in the rawdata repository, available here: https://github.com/genomicsclass/rawdata Click Download ZIP in order to download all the files, unzip this file which should result in a rawdata-master folder. Rename this folder to rawdata.

Read Affymeterix CEL files

We start by reading in the sample information table. This is usually created by the person who performed the experiment.

#Set working directory to the the celfiles
basedir <- "~/hubiC/Documents/R/doc/english/genomics/rawdata/celfiles"
setwd(basedir)
library(affy)
#Sample information table : it has file names and data from spiking experiment (spiking concentration)
tab <- read.delim("sampleinfo.txt",check.names=FALSE,as.is=TRUE)
rownames(tab) <- tab$filenames
tab[1:6, 1:3]
##                                       filenames 37777_at 684_at
## 1521a99hpp_av06.CEL.gz   1521a99hpp_av06.CEL.gz     0.00   0.25
## 1532a99hpp_av04.CEL.gz   1532a99hpp_av04.CEL.gz     0.00   0.25
## 2353a99hpp_av08.CEL.gz   2353a99hpp_av08.CEL.gz     0.00   0.25
## 1521b99hpp_av06.CEL.gz   1521b99hpp_av06.CEL.gz     0.25   0.50
## 1532b99hpp_av04.CEL.gz   1532b99hpp_av04.CEL.gz     0.25   0.50
## 2353b99hpp_av08r.CEL.gz 2353b99hpp_av08r.CEL.gz     0.25   0.50
#list all the .cel files that are in the current directory.
fns <- list.celfiles()
fns
## [1] "1521a99hpp_av06.CEL.gz"  "1521b99hpp_av06.CEL.gz" 
## [3] "1532a99hpp_av04.CEL.gz"  "1532b99hpp_av04.CEL.gz" 
## [5] "2353a99hpp_av08.CEL.gz"  "2353b99hpp_av08r.CEL.gz"
#Check whether the filenames are the same in the directory and in the sample info tab
fns %in% tab[,1] ##check
## [1] TRUE TRUE TRUE TRUE TRUE TRUE
#Read cel files in the current directory
ab <- ReadAffy(phenoData=tab)
ReadAffy function creates an AffyBatch object which object contains the information you need.
#Extract the perfect match probe-level intensities
dim(pm(ab))
## [1] 201807      6
#Phenotypic data : sample information 6X17
dim(pData(ab))
## [1]  6 17
#Plateform used for gene information
annotation(ab)
## [1] "hgu95a"

Normalization

The last thing to do here is to turn probe-level information into gene-level information. You can preprocess this probe-level information in many ways. One way you can do it is using this algorithm called rma. It’s going to turn probe-level data into gene-level data, quantile normalization and also background correction.

e <- rma(ab)
## Background correcting
## Normalizing
## Calculating Expression
dim(e)
## Features  Samples 
##    12626        6
You notice that this information is smaller, it's only 12,000 by 6. It's been summarized now.

If you are not interested in probe level data you could use this function :

setwd(basedir)
ejust <- justRMA(filenames=tab[,1],phenoData=tab)
dim(ejust)

Licence

Licence


Enjoyed this article? I’d be very grateful if you’d help it spread by emailing it to a friend, or sharing it on Twitter, Facebook or Linked In.

Show me some love with the like buttons below... Thank you and please don't forget to share and comment below!!
Avez vous aimé cet article? Je vous serais très reconnaissant si vous aidiez à sa diffusion en l'envoyant par courriel à un ami ou en le partageant sur Twitter, Facebook ou Linked In.

Montrez-moi un peu d'amour avec les like ci-dessous ... Merci et n'oubliez pas, s'il vous plaît, de partager et de commenter ci-dessous!





This page has been seen 15989 times