Plotting - taking size and mean in consideration
1
0
Entering edit mode
4.3 years ago
Gene ▴ 20

Dear all,

I have one doubt. I do not know which plot to choose which will represent my data well.

exon          mean               exon size

exon 1a    222.6731781              145
exon 1b    268.3251009              135
exon 1c    142.7838168              90
exon 1d    289.7393662              119
exon 1e    16.4791415               430

I tried with box plots, but box plots are taking just mean in consideration not taking size into account. Is there any way to plot these exons in that way that for example, exon 1e, with mean 16.4791415, and exon size 430, will have more influence than 1b, whose size is just 90?

Ideally it would be to represent all exons of one gene together and overall mean should be influenced by size. Something like weightened mean - mean of 16.4791415 should contrubute 46 % to overall mean, because it has the biggest size and represents 46% of a gene.

plot • 886 views
ADD COMMENT
1
Entering edit mode

Do you have some plot in mind, maybe a link to a published paper?

How about boxplot with width - rectangles: width is exon size, height is the mean?

ADD REPLY
0
Entering edit mode

Thank you for idea. I thought also about boxplots with width, but I have a lot of genes, and ideally it would be to represent all exons of one gene together.

Overall mean should be influenced by size. Something like weightened mean - mean of 16.4791415 should contrubute 46 % to overall mean, because it has the biggest size and represents 46% of a gene.

ADD REPLY
0
Entering edit mode

Any plot that can represent 3 features will be fine, such as colored scatter plot (x: mean; y: size; dot color: exon), etc.

ADD REPLY
0
Entering edit mode
4.3 years ago
lessismore ★ 1.3k

something like that in R?

library(ggplot2)

test <- structure(list(type = structure(c(1L, 1L, 1L, 1L, 1L), .Label = "exon", class = "factor"), exon = structure(1:5, .Label = c("1a", "1b", "1c", "1d", "1e"), class = "factor"), mean = c(222.6731781, 268.3251009, 142.7838168, 289.7393662, 16.4791415), size = c(145L, 135L, 90L, 119L, 430L)), class = "data.frame", row.names = c(NA, -5L))

ggplot(data = test, mapping = aes(x = exon, y = size)) +
    geom_bar(stat = "identity") +
    geom_point(mapping = aes(x = exon, y = mean))
ADD COMMENT

Login before adding your answer.

Traffic: 2025 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6