Entering edit mode
5.4 years ago
waqaskhokhar999
▴
160
I want to see the association between genotype and splicing ratio, for this i can use ggplot after generating matrix like this:
sample ratio isoform geno
sample1 0.2 T01 AA
sample2 0.6 T01 GG
sample1 0.3 T02 AA
sample2 0.4 T02 GG
# ploting
ggplot(data=data,mapping=aes(x=geno,y=ratio,fill=isoform))+geom_boxplot()
In this, I am repeating sample, isoform and genotype name, again and again, To remover redundacny, I have generated two separate matrices like these:
splicing ratio matrix:
Transcripts sample1 sample2
T01 0.2 0.6
T02 0.3 0.4
Genotype matrxi:
snp sample1 sample2
snp_3_214472 AA GG
How can we pass these matrices in ggplot to generate the above image
Please see How to add images to a Biostars post to add your images properly. You need the direct link to the image, not the link to the webpage that has the image embedded (which is what you have used here)
EDIT: You've also pasted a mark-up anchor tag in a box that asked for a direct link to the file. It's gonna need some HTML parsing to get to the original link from that mess.
ggplot is designed to work on "long" format matrices such as you have used in your working example. Its much easier to just use a very large and "Redundant" long matrix than it is to try to do it using two separate matrices. Why are you concerned about redundancy?? I'm currently working on a table w/ 12 columns and 12 million rows and it works reasonably fast for plotting in ggplot.