For each segment, identifies overlapping genes and adds gene names and the number of overlapping genes to the segment data.
Usage
AnnotateGene(gene, segment)
Arguments
- gene
Character. Path to a gene annotation file (tab-delimited, columns: chrom, loc.start, loc.end, Gene).
- segment
Data frame. Segment data with columns chrom, loc.start, and loc.end.
Value
A data frame with the original segment columns plus Gene (comma-separated gene names) and Gene_count.
Examples
# segment <- data.frame(chrom = "1", loc.start = 1000, loc.end = 2000)
# AnnotateGene("genes.txt", segment)