Affycoretools package, HTA 2.0 annotation for non-coding RNA
Entering edit mode
Last seen 5 months ago

Hello everybody. I'm newbie in this field. I have recently run the HTA 2.0 annotation using the two packages affycoretools and as outlined in the post

files=list.celfiles(dir,full.names = TRUE)

norm_data <- oligo::rma(read.celfiles(filenames=files),background=TRUE, normalize=TRUE, target="core")

#Save data

#Load data
data <- read.table("./BaselineVsControls/Data_normalized.txt",header=T)
#Add matrix
med<-new("ExpressionSet", exprs=as.matrix(data))

main <- getMainProbes("pd.hta.2.0")[replace(getMainProbes("pd.hta.2.0")$type==1,"pd.hta.2.0")$type==1),FALSE),]
eset.main <- annotateEset(med, pd.hta.2.0)
eset.main <- eset.main[main$transcript_cluster_id,] <- rowMedians(exprs(eset.main))

Everything runs perfectly, however now I want to export only those that are non-coding.

Using Thermo TAC (Transcriptome Analyse Control) program, there is a "non-coding gene" column in the final list. However, I couldn't find a way to do that in Bioconductor. Do you have any idea?

Thank you in advance.

affy rna hta2.0 r • 294 views
Entering edit mode
Last seen 5 hours ago
United States

There isn't a function per se, but you can do it easily enough.

> library(pd.hta.2.0)
> load(system.file("/extdata/netaffxTranscript.rda", package = "pd.hta.2.0"))
> annot <- pData("netaffxTranscript")
## should be OK, but make sure
> annot <- annot[featureNames(eset.main),]
> eset.noncoding <- eset.main[annot$locustype %in% "NonCoding",]

Entering edit mode

OR, you could just add it to the fData slot

fdat <- fData(eset.main)
fdat$LOCUSTYPE <- annot$locustype
fData(eset.main) <- fdat
Entering edit mode

When I run

annot <- pData("netaffxTranscript")

I got an error:

Error in (function (classes, fdef, mtable) : unable to find an inherited method for function 'pData' for signature '"character"'

Do u know how to fix this?

Entering edit mode

Yes. Don't do what I said, but instead what I meant.

annot <- pData(netaffxTranscript)

And for your personal edification, you could have figured that out on your own. You got an error saying some blahblahblah about the pData function. At which point you should think 'Huh, what does the help page say about that function? This guy MacDonald seems to have set me wrong.'

And ?pData would present

Retrieve information on experimental phenotypes recorded in eSet and
ExpressionSet-derived classes.


     These generic functions access the phenotypic data (e.g.,
     covariates) and meta-data (e.g., descriptions of covariates)
     associated with an experiment.


     phenoData(object) <- value
     varLabels(object) <- value
     varMetadata(object) <- value
     pData(object) <- value


  object: Object, possibly derived from 'eSet-class' or

   value: Value to be assigned to corresponding object.

The critical part being where it says that the object has to be either some sort of eSet-class or an AnnotatedDataFrame. And if you then did

> class("netaffxTranscript")
[1] "character"
## and then
> class(netaffxTranscript)
[1] "AnnotatedDataFrame"
[1] "Biobase"

You would then know that you need to pass the netaffxTranscript object, rather than the character string "netaffxTranscript".

Entering edit mode

Thank you so much for your reply and I apologize. I didn't know about the existence of netaffxTranscript, since I didn't find any efficient guide to analyze HTA 2.0 arrays and it's my first time using R and Bioconductor.

Entering edit mode

Hello James. One question. I promise you that I have tried to look for it on the internet and on this forum, but I have found nothing.

When I use my code to do the annotation of the main probes, I do this:

#Read my data

#Create expressionset and annotation
med<-new("ExpressionSet", exprs=as.matrix(data_BvsP))

main <- getMainProbes("pd.hta.2.0")[replace(getMainProbes("pd.hta.2.0")$type==1,"pd.hta.2.0")$type==1),FALSE),]
eset.main <- annotateEset(med, pd.hta.2.0)
eset.main <- eset.main[main$transcript_cluster_id,]

#Create expresion Data annotated    
    data_BvsP <- eset.main@assayData$exprs
    data_BvsP <- cbind(data_BvsP,eset.main@featureData@data)

#Remove NA from Symbol 
    data_BvsP<- data_BvsP[!$SYMBOL),]

#Remove duplicated Genename
    data_BvsP <- data_BvsP[which(!duplicated(data_BvsP$GENENAME)),]

#Write results

When I do this, I have a lot of "NA" in Gene Symbol column. However, when I use your code, I could see that the dataframe that creates the pData function, the mrnaAsigment column, most of the column does not contain "NA"

Do you know why? And what is your recommendation?

Thank you very much in advance.

Entering edit mode

My recommendation is to not do what you are doing.

Why are you writing the data to disk, and then having to recreate the ExpressionSet by hand? That makes no sense to me. You are apparently going through all the motions to generate a HTAFeatureSet, then throwing all that out by writing the results to a text file. The whole rationale for using Bioconductor tools in the first place is to have these nice data containers that hold all your data, that you can operate on as if they were simple data.frame objects.

There is nothing you can do with a text file that you couldn't have done with the original HTAFeatureSet object (well, except for reading into Excel...) and there are any number of things that you could do with the HTAFeatureSet that you can't do with the text file.

Anyway, this isn't a site intended for people to get their code checked by an expert (or god forbid, me), but instead is intended to provide help in using the existing functionality in Bioconductor. Any code that you write is your responsibility.

I personally just write the code to read in the CEL files and annotate the resulting object, and if I need to re-run, I re-run. Although you could also use BiocFileCache, or alternative do my usual bootleg version and just drop .Rdata or .RDS files for the big things that take time to generate and wrap in an if statement:

if(!file.exists("wowthattookalongtime.Rdata")) {
dat <- read.celfiles()
eset <- rma(dat)
eset <- annotateEset(eset, pd.hta.2.0)
 load(system.file("/extdata/netaffxTranscript.rda", package = "pd.hta.2.0"))
 annot <- pData("netaffxTranscript")
annot <- annot[featureNames(eset),]
fdat <- fData(eset)
fdat$LOCUSTYPE <- annot$locustype
fData(eset) <- fdat
save(eset, file = "wowthattookalongtime.Rdata")
} else {

Login before adding your answer.

Traffic: 161 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6