mergeGenes: Merge overlapping "genes" into gene clusters

View source: R/helper.R

mergeGenesR Documentation

Merge overlapping "genes" into gene clusters

Description

This function looks for overlapping exons in ebg. The overlapping "genes" are used to form a graph. Any connected components in the graph (sets of "genes" which can be reached from each other through overlap relations) are connected into a new gene cluster, which is given the suffix "_mrg" and using one of the original gene names.

Usage

mergeGenes(ebg, txdf, ignore.strand = TRUE)

Arguments

ebg

an exons-by-genes GRangesList, created with exonsBy

txdf

a data.frame created by running select on a TxDb object. Must have a column GENEID.

ignore.strand

Default is TRUE.

Value

a manipulated txdf.

Examples


library(GenomicRanges)
txdf <- data.frame(GENEID=c("101","102","103","104"))
ebg <- GRangesList(GRanges("1",IRanges(c(100,200),width=50)),
                   GRanges("1",IRanges(c(200,300),width=50)),
                   GRanges("1",IRanges(c(300,400),width=50)),
                   GRanges("1",IRanges(c(500,600),width=50)))
names(ebg) <- c("101","102","103","104")
mergeGenes(ebg, txdf)


mikelove/alpine documentation built on June 9, 2024, 11:37 a.m.