Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

How to plot copy number variation profile in R?

$
0
0

I'm trying to plot a copy number variation profile plot in R. This is what I'm looking for but with all the cells in my data.

I'm looking to make something like this but with all the cells

Ploidy is on the Y axis and chromosome number is on the X axis

This is my data and this is what I've tried so far but it's not giving me what I'm looking for

input <- data.frame(chrom = sample("chr1"),start = sample(c(780000, 2920000, 4920000)), stop=sample(c(2920000, 4920000, 692000)), cell0=sample(1), cell1=sample(1,3,1),cell2=sample(2,1,2)
ggplot(input, aes(x=chrom, y=cell_0, group=1)) +
  geom_point() +
  geom_line(color = "#00AFBB", size = 1) 

Here's a link to the whole file

https://pastebin.com/440AX3Dr

When I run the code in the answer this is what I get. I'm hoping that all the chromosomes can be horizontal like the above plot.

Link to output


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>