The reason for having all consecutive exons in the same row is that they are (likely) part of the same CNV. You can annotate which those exons (nexons) are as in the vignette:
exons.hg19.GRanges <- GenomicRanges::GRanges(seqnames = exons.hg19$chromosome,
IRanges::IRanges(start=exons.hg19$start,end=exons.hg19$end),
names = exons.hg19$name)
all.exons <- AnnotateExtra(x = all.exons,
reference.annotation = exons.hg19.GRanges,
min.overlap = 0.0001,
column.name = 'exons')
...and only the gene names:
genes.hg19.GRanges <- GenomicRanges::GRanges(seqnames = genes.hg19$chromosome,
IRanges::IRanges(start=genes.hg19$start,end=genes.hg19$end),
names = genes.hg19$name)
all.exons <- AnnotateExtra(x = all.exons,
reference.annotation = genes.hg19.GRanges,
min.overlap = 0.0001,
column.name = 'gene')
I don't know if there's an option to separate each exon into a single row though, but if you print all exons counts you get them exon by exon:
write.table(ExomeCount.dafr, "ExomeCount.txt", sep = '\t')