MadsAlbertsen / mmgenome

Please use mmgenome2 instead. Tools for extracting individual genomes from metagenomes
https://kasperskytte.github.io/mmgenome2/
27 stars 8 forks source link

plot coverage variation of a bin across all samples #40

Open Kirk3gaard opened 6 years ago

Kirk3gaard commented 6 years ago

Make a function to plot coverage variation of a bin across all samples

Something like this

mmplot_coverage<-function(data,ncov=2,log.y=F,plotline=F) { dm<-melt(data$scaffolds,measure.vars = names(data$scaffolds)[c(4:(ncov+3))]) p<-ggplot(dm, aes(x = variable, y = value,col=tax,size=length)) + geom_point(alpha=0.1)+ theme_bw()+theme(axis.text.x = element_text(angle = 90))+ylab("Coverage") if (log.y == T){p <- p + scale_y_log10()} if (plotline==T){p <- p +geom_line(aes(group = scaffold),size=1)} return(p) } mmplot_coverage_example

KasperSkytte commented 6 years ago

It has been implemented in mmgenome2.