How to plot a next generation sequencing data
1
0
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

next-gen R • 3.4k views
ADD COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode

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:

ADD REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
1
Entering edit mode
9.6 years ago

In R:

library(gplots)
d <- read.delim("some_file", header=T, row.names=1) #Or something similar
heatmap.2(d)
ADD COMMENT

Login before adding your answer.

Traffic: 2714 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