I would like to make a distribution plot like in this publication :
https://www.nature.com/articles/s41598-018-35738-0.pdf
for this I have a table consisting of 24 col each col representing a chromosome and each row a sample And I have a 25th col consisting in a score i would like to use as a gradient to color the distribution.
I tried to apply the code i found here: Plotting column names as x-axis in R
and so I got this plot:
So here is my code :
my_data <- read.table(my_file, header=TRUE, sep=';')
my_data <- my_data[,2:(ncol(my_data))]
rs <- as.data.frame(t(my_data))
rs$chr <- rownames(rs)
rs <- melt(rs, id.vars=c("chr"))
ggplot(rs, aes(x=as.factor(chr), y=value)) + geom_point()
and here is a piece of my data:
Sample;1;2;3;4;ff_seqff s1;-1.4368687908545408;-0.35632901567869174;-0.8630635469138286;0.08972089597838186;0.102953198414832 s2;1.0899445208946068;-0.7895300680366577;-1.2080358536312499;-1.8869137000565392;0.0318184922525369
if you have any idea of how to this it would be appreciated !