defineBins {Rcade} | R Documentation

## Define Bins

### Description

Defines bins about the 5' end of certain features of interest - these features are usually transcripts.

### Usage

    defineBins(anno, zone, geneID="ensembl_gene_id", removeDuplicates=TRUE)

### Arguments

`anno` | `data.frame` (or, an object that can be coerced to a data.frame, such as a GRanges) - Annotation information, corresponding to features of interest (usually transcripts). Only the 5' end of each object is used. Rcade expects the following column names: `chr, start, end, str`. These correspond to chromosome name, start co-ordinate, end co-ordinate and strand. Additionally, there must be another column specifying a gene ID, specified by the `geneID` argument.
`zone` | `integer` - must be a length 2 vector of form `c(relative.start, relative.end)`. For example, `zone = c(-10,100)` will produce bins that start 10bp 5' of each transcript's TSS and end 100bp 3' of it.
`geneID` | `character` or `integer` - The column in `anno` that contains a geneID (or some other feature ID).
`removeDuplicates` | `logical` - If `TRUE`, then any rows that share the same geneID and genomic location as another row will be removed (even if any of the other columns are different).

### Details

The `defineBins` function is useful when ChIP-seq bins are defined about ... . In particular, biomaRt data can be fed into this function directly. FIXME See vignette.

### Value

A `GRanges` object, corresponding to genomic bins. This output can be used as the `ChIPannoZones` argument in `RcadeAnalysis`.

### Author(s)

Jonathan Cairns

### See Also

`RcadeAnalysis`

### Examples

    ## Not run: 	##acquire annotation from biomaRt
    	library(biomaRt)
    	anno <- getBM(
    		attributes= c("ensembl_gene_id", "chromosome_name",
    			"transcript_start", "transcript_end", "strand"),
    		mart= useDataset("hsapiens_gene_ensembl", useMart("ensembl"))
    	)

    ## End(Not run)
    #define bins about the annotation
    anno <- anno[order(anno$chromosome_name),]
    colnames(anno) <- c("ENSG","chr","start","end","str")
    ChIPannoZones <- defineBins(anno, c(-1500, 1500), geneID = "ENSG")

[Package Rcade version 1.30.0 Index]