The only difference would be the annotations, instead of using bedframes from data(genes.hg19) and data(exons.hg19) in ExomeDepth, I got them from the UCSC Table Browser for hg38 (http://genome.ucsc.edu/cgi-bin/hgTables).
The only info they contain are: chromosome start end name
..and then run as before. Change bed.frame = exons.hg19 to the exon data you downloaded.
I called the exon data "geneid":
my.counts <- getBamCounts(bed.frame = geneid,
bam.files = my.bam,
include.chr = F)
In the end you can annotate also with genes from UCSC:
genes.hg38 <- read.csv("Genes.csv", header=TRUE, sep = ";")
genes.hg38.GRanges <- GenomicRanges::GRanges(seqnames = genes.hg38$chromosome,
names = genes.hg38$geneName)
all.exons <- AnnotateExtra(x = all.exons,
reference.annotation = genes.hg38.GRanges,
min.overlap = 0.1,
column.name = 'genes.hg38')