Graphs in R
1
0
Entering edit mode
9.2 years ago
aj123 ▴ 120

Hello,

I'm trying to figure out how to draw combined average profile graphs in R. I have 4 files, each with 2 columns of values. Any help given would be useful. Thank you.

Graphs R Statistics • 2.1k views
ADD COMMENT
0
Entering edit mode

Hello anjanaram1!

We believe that this post does not fit the main topic of this site.

This belongs better on stackoverflow (or its statistics division).

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

ADD REPLY
0
Entering edit mode

the two values are "TSS binding site affinities" vs. log likelihood ratios.

ADD REPLY
0
Entering edit mode

Even so, this is more of a graphing question than bioinformatics. Have you tried searching on stack overflow?

ADD REPLY
0
Entering edit mode

Yes I have. I'm trying to use R to plot TSS binding site location vs log-likelihood values. I believe this falls under the purview of "Bioinformatics". Hence posted here.

ADD REPLY
0
Entering edit mode

It'd help if you showed an example of what you're trying to do. I assume you're trying to just plot average lines in different colors, in which case ggplot2 makes this quite simple (not that you can't use the base graphics, they're just less convenient).

ADD REPLY
0
Entering edit mode

Average log-likehood ratios (0.1, 0.3, 0.5 etc) on Y-axis vs.distance to TSS binding site (in bp ie -5000 -2500, 0, +2500, +5000) lines on X axis. 4 lines for the 4 tss1, 2, 3, 4 files. each of the 4 files has log-likehood ration column and distance to TSS column. So I guess yes, 4 lines in diff colors.

ADD REPLY
1
Entering edit mode
9.2 years ago

The most convenient method is to just use ggplot2. If you make a single data.frame from your 4 files and add a column that designates what column things came from then just:

g <- ggplot(some_data_frame, aes(x=position, y=average_value, colour=some_file_designator))
g <- g + geom_line()
g
ADD COMMENT

Login before adding your answer.

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