I have some issues trying to plot multiple boxplots in single figure using ggplot, even though I can easily do that in vanilla R. I tried to google for answers for quite a few hours, but I couldn't find anyone who had same problem as me.
So basically, I have a data frame with 25 columns
[1] "gene" "NumberIntrons"
[3] "NumResidues" "protein_coding"
[5] "ncRNA" "Rel_telomere"
[7] "mRNA_copies_per_cell" "protein_copies_per_cell"
[9] "mRNA.stabilities" "GeneticDiversity"
[11] "ProteinHalfLife" "Golgi"
[13] "Mitochondrion" "Nuclear_dots"
[15] "Nuclear_envelope" "Nucleolus"
[17] "Nucleus" "Vacuole"
[19] "start" "end"
[21] "solid.media.KO.fitness" "gene.expression.RPKM"
[23] "conservation.phyloP" "chromosome"
[25] "essential"
Values in "Golgi", "Nucleolus", "Nuclear_envelope", "Mitochondrion", "Nuclear_dots", "Nucleus" and "Vacuole" are either 1 or 0, depending if protein expressed from the gene is found in that compartment or not.
So now my problem is that I want to compare the expression rates between proteins in different compartments. And I tackled that problem by creating different data frame for each compartment using subset()
function in order to place all genes that are expressed in particular compartment in their specific dataframe. And in order to create a graph using basic R, I can simply run following command:
boxplot(log10(golgi.df$gene.expression.RPKM),
log10(mito.df$gene.expression.RPKM),
log10(nucleus.df$gene.expression.RPKM),
log10(nuc_env.df$gene.expression.RPKM),
...
which lets me compare gene expression rate between proteins found in every compartment. Problem is, I simply have no idea how can I run the same command in ggplot, I'm not sure if I'm simply missing something super obvious, because I can't figure it out myself and I just couldn't find anyone who had similar problem as me.
Many thanks for any sort of help
Edit: data sample:
gene NumberIntrons NumResidues protein_coding ncRNA Rel_telomere
1 SPAC1002.01 1 179 1 0 0.4768186
2 SPAC1002.02 0 229 1 0 0.4770079
3 SPAC1002.03c 0 923 1 0 0.4772343
4 SPAC1002.04c 0 199 1 0 0.4782177
5 SPAC1002.05c 0 715 1 0 0.4784627
mRNA_copies_per_cell protein_copies_per_cell mRNA.stabilities
1 0.46 NA 38.30908
2 3.80 2564.51 32.34325
3 7.20 9719.87 47.75722
4 1.40 1600.25 26.73106
5 0.52 NA 20.38781
GeneticDiversity ProteinHalfLife Golgi Mitochondrion Nuclear_dots
1 0.0024331 NA 0 1 0
2 0.0025389 177.6 0 0 0
3 0.0041078 959.8 0 0 0
4 0.0043796 756.3 0 0 0
5 0.0043057 NA 0 0 0
Nuclear_envelope Nucleolus Nucleus Vacuole start end
1 0 0 0 0 1798347 1799015
2 0 0 0 0 1799061 1800053
3 0 0 0 0 1799915 1803141
4 0 0 0 0 1803624 1804491
5 0 0 1 0 1804548 1806797
solid.media.KO.fitness gene.expression.RPKM conservation.phyloP
1 1.042607 6.94700 0.0000000
2 1.095876 88.64500 0.3780292
3 1.035408 103.73833 0.5133217
4 NA 33.71667 0.5185620
5 1.056457 8.13000 0.4469873
chromosome essential
1 I NA
2 I NA
3 I NA
4 I 1
5 I NA