writeProjByComp {MineICA} | R Documentation

## writeProjByComp

### Description

This function writes in an html file the description of the features, or genes, that contribute to each component. It also writes an html file containing, for each feature or gene, its projection value on every component.

### Usage

    writeProjByComp(icaSet, params, mart = useMart(biomart = "ensembl",
        dataset = "hsapiens_gene_ensembl"), typeRetrieved = NULL, addNbOcc =
        TRUE, selectionByComp = NULL, level = c("features", "genes"), typeId, selCutoffWrite=2.5)

### Arguments

`icaSet` | An object of class `IcaSet`
`params` | An object of class `MineICAParams` containing the parameters of the analysis. The files are written in the path `genesPath(params)`. `selCutoff(params)` is used to select the features or genes by component.
`mart` | An output of function `useMart` containing the database used for annotation.
`typeRetrieved` | The annotations biomaRt is queried about. They describe the feature or gene IDs of the argument `icaSet`, see `listFilters`.
`addNbOcc` | If TRUE, the number of components the features/genes contribute to is added to the output. A gene/feature is considered as a contributor of a component if its absolute scaled projection value is higher than `selCutoff(icaSet)`.
`selectionByComp` | A list containing the feature/gene projections on each component, already restricted to the ones considered as contributors.
`level` | The data level of `icaSet` that will be annotated: either the feature projections ("features"), or the gene projections ("genes").
`typeId` | The type of ID the features or the genes of `icaSet` correspond to. By default `typeID(icaSet)` is used. It must be provided in the biomaRt way (type `listFilters(mart)` to choose the appropriate value).
`selCutoffWrite` | The cutoff applied to the absolute projection values to select the features/genes that will be annotated using package `biomaRt`, default is 2.5.

### Details

One file is created by component, each file is named by the index of the components (`indComp(icaSet)`) and located in the path `genePath(params)`.

In case you are interested in writing the description of features and their annotations, please remember to modify codegenesPath(params), or the previous files will be overwritten.

The genes are ranked according to their absolute projection values.

This function also writes an html file named "genes2comp" providing, for each feature or gene, the number of components it contributes to (according to the threshold `cutoffSel(params)`), and its projection value on all the components. The projection values are scaled.

See function `writeGenes` for details.

### Value

This function returns a list of two elements:

listAnnotComp:

  a list with the output of `writeGenes` for each component

nbOccInComp:

  a data.frame storing the projection values of each feature/gene (row) across all the components (columns).

### Author(s)

Anne Biton

### See Also

`writeGenes`, `getBM`, `listFilters`, `listAttributes`, `useMart`, `selectContrib`, `nbOccInComp`

### Examples

    ## Not run:
    ## load IcaSet object
    ## We will use 'icaSetCarbayo', whose features are hgu133a probe sets
    ## and feature annotations are Gene Symbols.
    data(icaSetCarbayo)

    ## define database to be used by biomaRt
    mart <- useMart(biomart="ensembl", dataset="hsapiens_gene_ensembl")

    ## define the parameters of the analysis
    params <- buildMineICAParams(resPath="~/resMineICACarbayo/", selCutoff=0)

    ## Make sure the elements "_biomaRt" of attribute 'typeID' are defined
    typeID(icaSetCarbayo)

    ### Query biomaRt and write gene descriptions in HTML files
    ### The files will be located in the directory 'genesPath(params)'

    ## 1. Write description of genes
    res <- writeProjByComp(icaSet=icaSetCarbayo, params=params, mart=mart,
               level="genes") #, typeId="hgnc_symbol")

    ## 2. Write description of features
    # change attribute 'genesPath' of params to preserve the gene descriptions
    genesPath(params) <- paste(resPath(params),"comp2features/",sep="")
    res <- writeProjByComp(icaSet=icaSetCarbayo, params=params, mart=mart,
               level="features") #, typeId="affy_hg_u133a")

    ## End(Not run)

[Package MineICA version 1.32.0 Index]