writeGenes {MineICA} | R Documentation |
biomaRt
.This function annotates IDs (typically gene IDs) provided by the user and returns an html file with their description.
writeGenes(data, filename = NULL, mart = useMart(biomart = "ensembl", dataset = "hsapiens_gene_ensembl"), typeId = "hgnc_symbol", typeRetrieved = NULL, sortBy = NULL, sortAbs = TRUE, colAnnot = NULL, decreasing = TRUE, highlight = NULL, caption = "")
data |
Either a data.frame whose rownames or one of its columns contain the IDs to be annotated, or a vector of IDs. |
filename |
The name of the HTML file where gene annotations are written. |
mart |
Output of function |
typeId |
The type of IDs available in |
typeRetrieved |
The descriptors uses to annotate the
features of |
sortBy |
Name of a column of |
sortAbs |
If TRUE absolute value of column
|
colAnnot |
The column containing the IDs to be
annotated, if NULL or missing and argument |
decreasing |
If TRUE, the output is sorted by
decreasing values of the |
highlight |
IDs to be displayed in colour red in the returned table |
caption |
A title for the HTML table |
"hgnc_symbol", "ensembl_gene_id", "description",
"chromosome_name", "start_position", "end_position",
"band"
, and "strand"
, are automatically added to
the list of fields available in argument
typeRetrieved
queried on biomaRt. The web-links to
www.genecards.org and www.proteinatlas.org are
automatically added in the columns of the output
respectively corresponding to hgnc_symbol
and
ensembl_gene_id
.
This function returns a data.frame which contains annotations of the input data.
Anne Biton
getBM
,
listFilters
,
listAttributes
,
useMart
if (interactive()) { ## define the database to be used mart <- useMart(biomart="ensembl", dataset="hsapiens_gene_ensembl") ### Describe: ## a set of hgnc symbols with default descriptions (typeRetrieved=NULL) genes <- c("TOP2A","E2F3","E2F1","CDK1","CDC20","MKI67") writeGenes(data=genes, filename="foo", mart=mart, typeId = "hgnc_symbol") ## a data.frame indexed by hngc symbols, sort output according to column "values", add a title to the HTML output datagenes <- data.frame(values=rnorm(6),row.names = genes) writeGenes(data=datagenes, filename="foo", sortBy = "values", caption = "Description of some proliferation genes.") ## a set of Entrez Gene IDs with default descriptions genes <- c("7153","1871","1869","983","991","4288") writeGenes(data=genes, filename="foo", mart=mart, typeId = "entrezgene") } ## Not run: ## add the GO category the genes belong to ## search in listAttributes(mart)[,1] which filter correspond to the Gene Ontology -> "go_id" writeGenes(data=genes, filename="foo", mart=mart, typeId = "entrezgene", typeRetrieved = "go_id") ## End(Not run)