Running Rscript in Nextflow pipeline

Viewed 1332

I'm trying to run a Rscript in Nextflow pipeline. This Rscript has a package "ggolot2".

I have this error:

Error in library(ggplot2): there is no package called "ggplot2", Execution halted.

Why do I get that error?

Here's the code:

process fingerprint_plot {

    publishDir "${params.outdir}/fingerprint_plot", mode: 'copy'

    input:
    set val(sample_id), file(samples) from sample_cov_ch
    set val(control_id), file(controls) from control_cov_ch.collect()

    output:
    file("${sample_id}.fingerprint.pdf") into fingerprint_plot_ch

    script:
    """

    Rscript /mnt/Data/cut_and_tag/cut_tag_fingerprint_cmd.R --args ${controls} ${control_id} ${samples} ${sample_id} ${sample_id}.fingerprint.pdf

    """
}
1 Answers
Related