Contig length distribution plotting with R
1
0
Entering edit mode
8.3 years ago
seta ★ 1.9k

Hi all,

I would like to plot the contig length distribution of my assembly using R software. I tried the ggplot2 package, but sounds that it's not correct for this purpose, however, I'm not sure about it. Could you please help me out on this issue? which R package is suitable for this task?

Thank you in advance

contig length plotting R • 4.4k views
ADD COMMENT
0
Entering edit mode

hist() in R would not do that ?

ADD REPLY
1
Entering edit mode
8.3 years ago
h.mon 35k

Assuming you have a data frame with contig lengths:

contigs <- data.frame( row.names = c( "contig1", "contig2", "contig3", 
                                      "contig4", "contig5", "contig6", 
                                      "contig7"),
                       length = c(10000, 10001, 540, 320, 600, 640, 1000) )
#base graphics
hist( contigs$length )

#both are ggplot
qplot( contigs$length, geom="histogram" )
ggplot(data=contigs, aes(length)) + geom_histogram()

edit: see ?hist and ?qplot for options and parameters.

ADD COMMENT
0
Entering edit mode

How to make the same as a scatter plot? Is it possible?

ADD REPLY

Login before adding your answer.

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