[BioC] (no subject)
James W. MacDonald
jmacdon at med.umich.edu
Wed Mar 29 17:08:52 CEST 2006
Hi Marie-Paule,
Marie-Paule Roth wrote:
> Dear List,
> I used MBNI cdfs to have only one probe set per gene. My DE genes are now
> identified by custom probe set names whose structure is "database entry
> ID_at". These custom probeset names are different from the original
> Affymetrix probe IDs. Up to now, I used aafTableAnn and saveHTML to save a
> html table allowing easy access to very useful information such as gene
> symbols, descriptions, chromosome locations, genebank ids... This does not
> work anymore. How should I proceed to rebuild a html table, starting with
> the custom probe set names rather than the original Affymetrix probe set
> names ?
I would recommend using the biomaRt package to annotate your probe sets,
and htmlpage() from the annotate package to build the HTML table. Right
now biomaRt and htmlpage() are not quite set up to work really well
together, but Steffen Durinck and I are working to make this process
much simpler. We should have something in place before the next release.
In the meantime, here is a function I made to build HTML tables using
biomaRt and htmlpage(). You can use this function to make lists of IDs
for the 'genelist' argument of htmlpage(), and also to make lists of
annotations for the 'othernames' argument. Note that this function is
really inefficient unless you are using the RMySQL interface to biomaRt.
In fact I wouldn't recommend using it unless you are using the RMySQL
interface.
###############################
##
## Function to extract data from a mart object and return as a list
## This circumvents the problem of getBM only being able to return
## multiple queries if they all have the same length
##
## mart - a mart class object, which can be constructed using setMart()
## attributes - a vector of attributes, usually resulting
## from a call to listAttributes(mart)
## filter - The filter indicates to biomaRt where the IDs we are
## querying come from for instance, they could be an
## affy chip, Entrez Gene, UniGene, etc.
## values - The IDs that we are querying for
##
## list.names - a character vector of names for the resulting list.
## If this is used prior to a call to htmlpage(), then .
## these will be the column headings
##
##############################
listBM <- function(mart, attributes, filter, values, list.names = NULL){
out <- vector("list", length(attributes))
if(is.null(list.names))
names(out) <- attributes
else
names(out) <- list.names
if(mart at mysql){
for(j in seq(along = attributes)){
tmp <- getBM(attributes[j], filter, values, mart)
tmp2 <- vector("list", length(values))
names(tmp2) <- values
for(i in seq(along=tmp2)){
tst <- tmp[tmp[,1] %in% values[i],2]
tst <- tst[!is.na(tst)]
if(length(tst) == 0 || tst == "") tst <- " "
tmp2[[i]] <- tst
}
out[[j]] <- tmp2
}
}else{
curl <- getCurlHandle()
for(j in seq(along = attributes)){
tmp2 <- vector("list", length(values))
names(tmp2) <- values
for(k in seq(along = tmp2)){
tst <- getBM(attributes[j], filter, values[k], mart, curl)
if(!is.null(tst))
tmp2[[k]] <- unlist(unique(tst), use.names = FALSE)
else
tmp2[[k]] <- " "
out[[j]] <- tmp2
}
}
}
out
}
HTH,
Jim
> Thanks for your help,
> Marie-Paule
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
--
James W. MacDonald, M.S.
Biostatistician
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
Ann Arbor MI 48109
734-647-5623
**********************************************************
Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.
More information about the Bioconductor
mailing list