git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/MineICA@73179 bc3139a8-67e5-0310-9ffc-ced21a209358
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,93 @@ |
1 |
+\name{writeProjByComp} |
|
2 |
+\alias{writeProjByComp} |
|
3 |
+\title{writeProjByComp} |
|
4 |
+\description{This function writes in an html file the description of the |
|
5 |
+ features, or genes, that contribute to each component. It also writes |
|
6 |
+ an html file containing, for each feature or gene, its projection value on every component.} |
|
7 |
+\usage{writeProjByComp(icaSet, params, mart = useMart(biomart = "ensembl", |
|
8 |
+ dataset = "hsapiens_gene_ensembl"), typeRetrieved = NULL, addNbOcc = |
|
9 |
+ TRUE, selectionByComp = NULL, level = c("features", "genes"), typeId, selCutoffWrite=2.5)} |
|
10 |
+\arguments{ |
|
11 |
+ \item{icaSet}{An object of class \code{\link{IcaSet}}} |
|
12 |
+ \item{params}{An object of class \code{\link{MineICAParams}} containing the |
|
13 |
+ parameters of the analysis. The files are written in the path |
|
14 |
+ \code{genesPath(params)}. \code{selCutoff(params)} is used to select the features or genes |
|
15 |
+ by component.} |
|
16 |
+ \item{mart}{An output of function \code{\link[biomaRt]{useMart}} |
|
17 |
+ containing the database used for annotation.} |
|
18 |
+ \item{typeRetrieved}{The annotations biomaRt is queried about. They |
|
19 |
+ describe the feature or gene IDs of the argument \code{icaSet}, see \code{\link[biomaRt]{listFilters}}.} |
|
20 |
+ \item{addNbOcc}{If TRUE, the number of components the features/genes |
|
21 |
+ contribute to is added to the output. A gene/feature is considered |
|
22 |
+ as a contributor of a component if its absolute scaled projection |
|
23 |
+ value is higher than \code{selCutoff(icaSet)}.} |
|
24 |
+ \item{selectionByComp}{A list containing the feature/gene projections |
|
25 |
+ on each component, already restricted to the ones considered as contributors.} |
|
26 |
+ \item{level}{The data level of \code{icaSet} that will be annotated: |
|
27 |
+ either the feature projections ("features"), or the gene projections ("genes").} |
|
28 |
+ \item{typeId}{The type of ID the features or the genes of |
|
29 |
+ \code{icaSet} correspond to. By default \code{typeID(icaSet)} is used. It must be provided in the biomaRt way |
|
30 |
+ (type \code{listFilters(mart)} to choose the appropriate value).} |
|
31 |
+ \item{selCutoffWrite}{The cutoff applied to the absolute projection values to select the features/genes that will be annotated using package \code{biomaRt}, default is 2.5.} |
|
32 |
+} |
|
33 |
+\details{One file is created by component, each file is named by the |
|
34 |
+ index of the components (\code{indComp(icaSet)}) and located in the |
|
35 |
+ path \code{genePath(params)}. |
|
36 |
+ |
|
37 |
+In case you are interested in writing the description of features and |
|
38 |
+their annotations, please remember to modify code{genesPath(params)}, or |
|
39 |
+the previous files will be overwritten. |
|
40 |
+ |
|
41 |
+The genes are ranked according to their absolute projection values. |
|
42 |
+ |
|
43 |
+This function also writes an html file named "genes2comp" |
|
44 |
+providing, for each feature or gene, the number of components it |
|
45 |
+contributes to (according to the threshold \code{cutoffSel(params)}), |
|
46 |
+and its projection value on all the components. |
|
47 |
+The projection values are scaled. |
|
48 |
+ |
|
49 |
+See function \code{\link{writeGenes}} for details. |
|
50 |
+} |
|
51 |
+\value{This function returns a list of two elements:\describe{ |
|
52 |
+ \item{listAnnotComp:}{a list with the output of |
|
53 |
+ \code{\link{writeGenes}} for each component} |
|
54 |
+ \item{nbOccInComp:}{a data.frame storing the projection |
|
55 |
+ values of each feature/gene (row) across all the components |
|
56 |
+ (columns).}} |
|
57 |
+} |
|
58 |
+\examples{ |
|
59 |
+\dontrun{ |
|
60 |
+## load IcaSet object |
|
61 |
+## We will use 'icaSetCarbayo', whose features are hgu133a probe sets |
|
62 |
+## and feature annotations are Gene Symbols. |
|
63 |
+data(icaSetCarbayo) |
|
64 |
+ |
|
65 |
+## define database to be used by biomaRt |
|
66 |
+mart <- useMart(biomart="ensembl", dataset="hsapiens_gene_ensembl") |
|
67 |
+ |
|
68 |
+## define the parameters of the analysis |
|
69 |
+params <- buildMineICAParams(resPath="~/resMineICACarbayo/", selCutoff=0) |
|
70 |
+ |
|
71 |
+## Make sure the elements "_biomaRt" of attribute 'typeID' are defined |
|
72 |
+typeID(icaSetCarbayo) |
|
73 |
+ |
|
74 |
+### Query biomaRt and write gene descriptions in HTML files |
|
75 |
+### The files will be located in the directory 'genesPath(params)' |
|
76 |
+ |
|
77 |
+## 1. Write description of genes |
|
78 |
+res <- writeProjByComp(icaSet=icaSetCarbayo, params=params, mart=mart, |
|
79 |
+ level="genes") #, typeId="hgnc_symbol") |
|
80 |
+ |
|
81 |
+## 2. Write description of features |
|
82 |
+# change attribute 'genesPath' of params to preserve the gene descriptions |
|
83 |
+genesPath(params) <- paste(resPath(params),"comp2features/",sep="") |
|
84 |
+res <- writeProjByComp(icaSet=icaSetCarbayo, params=params, mart=mart, |
|
85 |
+ level="features") #, typeId="affy_hg_u133a") |
|
86 |
+ |
|
87 |
+} |
|
88 |
+} |
|
89 |
+ |
|
90 |
+\author{Anne Biton} |
|
91 |
+ |
|
92 |
+\seealso{\code{\link{writeGenes}}, \code{getBM}, \code{listFilters}, \code{listAttributes}, \code{useMart}, \code{\link{selectContrib}}, \code{\link{nbOccInComp}}} |
|
93 |
+ |