Last data update: 2014.03.03

R: Get distance to nearest TSS and gene id from...
getAssociationWithTSSR Documentation

Get distance to nearest TSS and gene id from AnnotationByGeneParts

Description

This accessor function gets the nearest TSS, its distance to target feature, strand and name of TSS/gene from AnnotationByGeneParts object

Usage

getAssociationWithTSS(x)

## S4 method for signature 'AnnotationByGeneParts'
getAssociationWithTSS(x)

Arguments

x

a AnnotationByGeneParts object

Value

RETURNS a data.frame containing row number of the target features, distance of target to nearest TSS, TSS/Gene name, TSS strand

Examples

data(cage)
bed.file = system.file("extdata/chr21.refseq.hg19.bed", package = "genomation")
gene.parts = readTranscriptFeatures(bed.file)
cage.annot = annotateWithGeneParts(cage, gene.parts, intersect.chr=TRUE)
head(getAssociationWithTSS(cage.annot))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(genomation)
Loading required package: grid
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/genomation/AnnotationByGeneParts-methods.Rd_%03d_medium.png", width=480, height=480)
> ### Name: getAssociationWithTSS
> ### Title: Get distance to nearest TSS and gene id from
> ###   AnnotationByGeneParts
> ### Aliases: AnnotationByGeneParts-method getAssociationWithTSS
> ###   getAssociationWithTSS, getAssociationWithTSS,-methods
> ###   getAssociationWithTSS,AnnotationByGeneParts-method
> 
> ### ** Examples
> 
> data(cage)
> bed.file = system.file("extdata/chr21.refseq.hg19.bed", package = "genomation")
> gene.parts = readTranscriptFeatures(bed.file)
Reading the table... 
Calculating intron coordinates... 
Calculating exon coordinates... 
Calculating TSS coordinates... 
Calculating promoter coordinates... 
Outputting the final GRangesList... 

> cage.annot = annotateWithGeneParts(cage, gene.parts, intersect.chr=TRUE)
intersecting chromosomes...
> head(getAssociationWithTSS(cage.annot))
    target.row dist.to.feature feature.name feature.strand
323          1               0    NR_103796              +
7            2              49 NM_001204303              -
523          3             151    NM_004339              -
243          4              47 NM_001282907              -
233          5               0    NM_006988              -
292          6              16    NM_000454              +
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>