

def generate_plot(filename, rplot='A50.rplot', rpdf='A50.pdf'):
    from jcvi.apps.r import RTemplate
    rplot_template = '\n    library(ggplot2)\n\n    data <- read.table("$rplot", header=T, sep="\t")\n    g <- ggplot(data, aes(x=index, y=cumsize, group=fasta))\n    g + geom_line(aes(colour=fasta)) +\n    xlab("Contigs") + ylab("Cumulative size (Mb)") +\n    opts(title="A50 plot", legend.position="top")\n\n    ggsave(file="$rpdf")\n    '
    rtemplate = RTemplate(rplot_template, locals())
    rtemplate.run()

dataset/ETHPy150Open tanghaibao/jcvi/graphics/assembly.py generate_plot/original