Entering edit mode
9.6 years ago
ankit.1g
•
0
Hi all,
I have next gen data in csv format which have headers columns like genename and s1, t1, s2 and t2, I want to plot the s1, t1... read in color map forms for each gene with gene name on y axis and s1 and t1 on x axis. I am new in r and matlab, is there way to do that. Can any one please help me in this.
thanks
What? What exactly do you mean by "plot...in color map form"? Do you mean a heatmap? What are s1 and t1?
Please post what a few lines from your csv file and an example of the plot style you'd like to produce.
Hi yes, like heatmap
my csv file looks like this:
Something like this:
I just saw the image. Do you actually want a heatmap or something like the middle of panel A? If the latter then it'd be better to use geom_tile() in ggplot2 (also an R package).
Yes, the one in the middle, but how to make sure that I have my y axis as genname and x axis be column of s1, t1,s2 and t2..)
Thanks a lot for helping out.
I assume you mean with ggplot2.
You'd do something like:
You'd then use a threshold or something to determine what colour to make things. Presumably you'd also want to filter out some of the values. For converting your CSV file to an appropriately formatted dataframe, give the
melt()
function in the reshape2 package a try.Hi,
Thank you very much,
I installed the package ggplot but getting error ggplot2 not found, even after I used the command
library(ggplot2)
.Also can you tell me what should come as "sample" and "data frame", when I run the command
I get
data.frame': 99 obs. of 28 variables:
with some $ column values like$GENE_NAME
,$S1
,$S2
...I ran your command like this:
but getting error.
That was a typo, the function is called ggplot() and it's in the ggplot2 library (mea culpa).
sample
would be whatever column containss1
,t1
, etc. after youmelt()
data
. Also,colour=S1read, T1read
, is a syntax error.Hi sorry , I am still confused with the syntax you provided, I am not sure how to plot multiple columns as a x axis and genes as y axis with the given syntax, is there any tools or gui available which I can use.?