background:
I use Rmarkdown to get a report for one of my process.
I kept running into the error where the report got written into ${rmd_file}
source location. Because ${rmd_file}
is stage in as a softlink in workdir.
I was able to solve it by
knit_root_dir = ‘pwd
’
I didn’t like it.
Then I dig around and I found this old issue in biostars link
That worked. But it is against the spirit of nextflow (Working with files — Nextflow documentation)
script:
"""
# cp to avoid rmarkdown known issue with softlinked Rmd files
cp -L ${rmd_file} notebook.Rmd
R -e "rmarkdown::render(
'notebook.Rmd',
output_format = 'html_document',
output_file = 'output.html',
params = list(meta = '$metadata', data = '$countData')
)"
"""
Anyone else out there working rmarkdown in nextflow have some suggestions?
Thank you.