Question: How to plot a next generation sequencing data
0
gravatar for ankit.1g
5.8 years ago by
ankit.1g0
United States
ankit.1g0 wrote:

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

 

next-gen R • 2.6k views
ADD COMMENTlink modified 5.8 years ago by Devon Ryan95k • written 5.8 years ago by ankit.1g0

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.

ADD REPLYlink written 5.8 years ago by Devon Ryan95k

Hi yes, like heatmap 

my csv file looks like this:

GENE_NAME S1 read T1 read S2 read T2 read
AKT1 8 30 72 51
AKT1 8 30 72 50
APC 8 30 70 53
APC 1 5 12 21
BRCA1 93 181 4 191

something like this:

http://www.nature.com/nature/journal/v511/n7511/images_article/nature13385-f1.jpg

 

 

 

 

ADD REPLYlink modified 5.8 years ago • written 5.8 years ago by ankit.1g0

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).

ADD REPLYlink written 5.8 years ago by Devon Ryan95k

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.

ADD REPLYlink modified 5.8 years ago • written 5.8 years ago by ankit.1g0

I assume you mean with ggplot2.

You'd do something like:

g <- ggplot2(gene_name, sample, data=some_data_frame) + geom_tile(aes(colour=some_dataframe_column)))

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.

ADD REPLYlink modified 5.8 years ago • written 5.8 years ago by Devon Ryan95k

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 

data <- read.csv("data.csv")

str(data)

I get data.frame':    99 obs. of  28 variables:  with some $ column values like $ GENE_NAME, $ S1, $S2...

i ran your command like this:

g <- ggplot2(GENE_NAME, sample, data=data) + geom_tile(aes(colour=S1read,T1read))

but getting error.

ADD REPLYlink written 5.8 years ago by ankit.1g0

That was a typo, the function is called ggplot() and it's in the ggplot2 library (mea culpa). sample would be whatever column contains s1, t1, etc. after you melt() data. Also, colour=S1read, T1read, is a syntax error.

ADD REPLYlink written 5.8 years ago by Devon Ryan95k

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.?

ADD REPLYlink written 5.8 years ago by ankit.1g0
1
gravatar for Devon Ryan
5.8 years ago by
Devon Ryan95k
Freiburg, Germany
Devon Ryan95k wrote:

In R:

library(gplots)
d <- read.delim("some_file", header=T, row.names=1) #Or something similar
heatmap.2(d)
ADD COMMENTlink modified 5.8 years ago • written 5.8 years ago by Devon Ryan95k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1343 users visited in the last hour