Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF plate QC reports have correct filename but shares identical contents. #3

Open
yuxuanlan opened this issue Sep 16, 2024 · 0 comments

Comments

@yuxuanlan
Copy link
Collaborator

yuxuanlan commented Sep 16, 2024

When running the pipeline on multiple plate mode, some PDF plate QC reports can have correct file names but sharing the same report contents.

Process doc loads R object *qc_for_doc.Rdata into workspace at the start. When multiple R instances were running under same work directory, they access to the same workspace at the same time. The variables in objects will be loaded more than once from multiple doc processes, hence the error.

"""
Rscript -e \"options(warn=-1);objects<-\'${params.qcoutdir}${plate_id}qc_for_doc.Rdata\';mapping_file <- read.table(\'${params.qcoutdir}percent_pseudoaligned.txt\');rmarkdown::render(\'${params.RScript_dir}QCreport.Rmd\', 'pdf_document', output_file=\'${plate_id}_QC_report.pdf\', output_dir=\'${params.qcoutdir}${plate_id}\')\";
	echo '${plate_id}' > Finished_${plate_id}.txt
"""

One solution is to run each R instance in its nextflow temporary work directory, and assign process output to qc_dir/$plate publishDir.

Update 18 Sep 2024:
rmarkdown::render by default writes intermediate files to the same folder as .Rmd file. These files are deleted once the final outputs are produced. Setting rmarkdown::render(..., intermediates_dir='{params.plateqc_dir}', knit_root_dir='{params.plateqc_dir}, clean=FALSE)') doesn't stop this behaviour.

Copy the .Rmd file to nextflow temporary work directory should resolve this issue.

yuxuanlan added a commit that referenced this issue Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant