htmlpage              package:annotate              R Documentation

_F_u_n_c_t_i_o_n_s _t_o _b_u_i_l_d _H_T_M_L _p_a_g_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     This function is designed to create an HTML table containing both
     static information as well as links to various online annotation
     sources.

_U_s_a_g_e:

     htmlpage(genelist, filename, title, othernames, table.head,
     table.center = TRUE, repository = list("en"), ...)

_A_r_g_u_m_e_n_t_s:

genelist: A list or 'data.frame' of character vectors containing ids to
          be made into hypertext links. See details for more
          information.

filename: A filename for the resultant HTML table. 

   title: A title for the table. 

othernames: A list or 'data.frame' of other things to add to the table.
          These will not be hyperlinks. The list of othernames can
          contain vectors, matrices, 'data.frames' or lists. 

table.head: A character vector of column headers for the table.

table.center: Center the table? Defaults to 'TRUE'. 

repository: A list of repositories to use for creating the hypertext
          links. Currently available repositories include 'gb'
          (GenBank), 'en' (EntrezGene), 'omim' (Online Mendelian
          Inheritance in Man), 'sp' (SwissProt), 'affy' (Affymetrix),
          'ug' (UniGene), 'fb' (FlyBase). Additional repositories can
          easily be added. See 'getQueryLink' for more information.

     ...: Further arguments to be passed to 'xtable' or 'print.xtable'.

_D_e_t_a_i_l_s:

     This function will accept a list or 'data.frame' of character
     vectors, each containing different ids that are to be turned into
     hyperlinks (e.g., a list containing affy ids, genbank accession
     numbers, and locus link ids). For instances where there are more
     than one id per gene, use a sub-list of character vectors. See the
     vignette 'HowTo: Get HTML Output' for more information. Othernames
     should be a list or 'data.frame'. Again, if there are multiple
     entries for a given gene, use a sub-list. This is more easily
     explained using an example - please see the examples section below
     and the above mentioned vignette.

     Note that this function now uses 'xtable' to create the HTML
     table, and there is the ability to pass some arguments on to
     either 'xtable' or 'print.xtable'. One such argument would be
     'append=TRUE', which would allow one to put lots of tables in one
     page, as long as the filename argument remained the same.

_V_a_l_u_e:

     This function is used only for the side effect of creating an HTML
     table.

_A_u_t_h_o_r(_s):

     Robert Gentleman <rgentlem@fhcrc.org>, further modifications by
     James W. MacDonald <jmacdon@med.umich.edu>

_E_x_a_m_p_l_e_s:

     library(annotate)
     ## fake up some data
     ## first we create data to annotate
     unigene <- list("Hs.600536",c("Hs.596913","HS.655491"),"Hs.76704")
     refseq <- list(c("NM_001030050", "NM_001030047", "NM_001648",
     "NM_001030049"), "NM_000860", c("NM_001011645", "NM_000044"))
     entrez <- c("354", "3248", "367")
     genelist <- list(unigene, refseq, entrez)

     ## now some other data

     symb <- c("KLK3","HPGD","AR")
     desc <- c("Prostate-specific antigen precursor",
     "15-hydroxyprostaglandin dehydrogenase",
     "Androgen receptor")
     t.stat <- c(40.21, -22.14, 21.56)
     p.value <- rep(0,3)
     fold.change <- c(3.54, -2.35, 3.18)
     expression <- matrix(c(11.78, 11.69, 11.62, 8.17, 5.78, 5.58, 5.68,
     8.26, 9.08, 9.28, 9.19, 6.05), ncol=4, byrow=TRUE)

     otherdata <- list(symb, desc, t.stat, p.value, fold.change, expression)
     table.head <- c("UniGene", "RefSeq", "EntrezGene", "Symbol",
     "Description", "t-stat", "p-value", "fold change", paste("Sample", 1:4))

     htmlpage(genelist, "test.html", "Some gene expression data", otherdata,
     table.head, repository=list("ug","gb","en"))

     if(interactive())
     browseURL("test.html")

     if(!interactive())
     file.remove("test.html")

