Entering edit mode
6.9 years ago
marija
▴
80
Hello everyone, I would like to ask you how can I get the number of exon? I want visualize gene length vs. number of exons in gene.
For example:
I have the length of the gene:
exons <- getBM(attributes = c("external_gene_name","start_position","end_position","ensembl_exon_id"),
filters = "chromosome_name",
values = "21",
mart = genes)
exons[5] <- exons$end_position - exons$start_position
names(exons)[5] <- "gene_length"
I tried to find out the number of exons:
as.data.frame(table(exons$ensembl_exon_id))
But now, I don't know what else. Please, somebody would help me?
@Nicolas Please do you know explain me why you use this command:
Thank you
n() reports the number of elements in each group thus the number of exons