Description Usage Arguments Details Value Author(s) Examples
View source: R/TransView_tools.R
A convenience function to associate the peak center to a TSS or gene body provided by a gtf file.
1 | annotatePeaks(peaks, gtf, limit=c(-10e3,10e3), remove_unmatched=T, unifyBy=F, unify_fun="mean", min_genelength=0, reference="tss")
|
peaks |
A GRanges object. |
gtf |
A GRanges object with a meta data column ‘transcript_id’ and ‘exon_id’ like e.g. from |
limit |
Maximal distance range for a peak - TSS association in base pairs. |
remove_unmatched |
If TRUE, only TSS associated peaks will be returned. |
unifyBy |
If a transcript has multiple isoforms, the peak will be associated arbitrarily to the first ID found. In order associate a peak to an isoform with specific characteristics, a |
unify_fun |
A function which will choose the isoform in case of non unique peak - TSS associations. Defaults to the isoform with the highest mean score |
min_genelength |
Genes with a total sum of all exons smaller than this value will not be associated to a peak. |
reference |
If set to ‘tss’, the transcript with the smallest distance from the TSS to the peak center will be returned. If set to ‘gene_body’ the transcript with the smallest distance from the gene body (TSS or TES) to the peak center will be returned and the distance will be zero if the peak center is located within the gene body. |
Convenience function to annotate a GRanges object having one row per peak from e.g. macs2gr
. The resulting peak - TSS associations can be customized by the restricting the distance and resolving multiple matches using unify_fun.
GRanges object with row names according to the peak names provided and an added or updated meta data column ‘transcript_id’ with the associated transcript IDs and distances.
Julius Muller ju-mu@alumni.ethz.ch
1 2 3 4 5 6 7 | exgtf<-dir(system.file("extdata", package="TransView"),full=TRUE,patt="gtf.gz$")[2]
exls<-dir(system.file("extdata", package="TransView"),full=TRUE,patt="xls$")
GTF<-gtf2gr(exgtf)
peaks<-macs2gr(exls,psize=500)
apeaks<-annotatePeaks(peaks=peaks,gtf=GTF)
apeaks.gb<-annotatePeaks(peaks=peaks,gtf=GTF,reference="gene_body")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.