genomic-medicine-sweden / gms-artic

A nextflow pipeline with a GMS touch for running the ARTIC network's fieldbioinformatics tools (https://github.com/artic-network/fieldbioinformatics).
GNU Affero General Public License v3.0
8 stars 6 forks source link

Update Dockerfile #57

Closed henningonsbring closed 2 years ago

henningonsbring commented 2 years ago

The purpose of the code changes are as follows:

With the latest container for gms-artic the analyses are crashing with error message: R is not installed on this machine. It is required for creating the chart.

When trying to use R in the latest container, then it fails, there is something wrong with the R installation. When trying to use R from a 10 days old container, then R is working.

This code is installing R in a more explicit way than it was installed before.

Also adding possibility to add arguments to the fastqc command via config (e.g. change number of threads to deal with Java errors)

Standard test procedure

This version is a:

henningonsbring commented 2 years ago

Testing latest docker image from gms dockerhub, R is not working:

singularity exec artic-ncov2019-illumina.sif R
/opt/conda/envs/artic-ncov2019-illumina/lib/R/bin/exec/R: error while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory

When testing the container built using the code from this PR, then R works:

singularity pull --force /home/proj/stage/mutant/MUTANT/mutant/externals/gms-artic/artic-ncov2019-illumina.sif docker://henningonsbring/artic-ncov2019-illumina:latest
WARNING: Authentication token file not found : Only pulls of public images will succeed
INFO:    Starting build...
Getting image source signatures
Skipping fetch of repeat blob sha256:c32ce6654453d35d0b3dde45d195adeee586ffba0a683006ee06748c077c01fa
Skipping fetch of repeat blob sha256:a004fd528405ae282a6b6bdcc0f24a2861c7020ed4c83eaadb558126c78efa67
Skipping fetch of repeat blob sha256:49ad3e7c98c0248e58d6d245e16b08178e61d6ad68e464d9024eea96487da41f
Copying config sha256:94c983d8b44aaaac845f948f092c1f367a95fcfcee77e789ec33f1b607f6f786
 1.64 KiB / 1.64 KiB [======================================================] 0s
Writing manifest to image destination
Storing signatures
INFO:    Creating SIF file...
INFO:    Build complete: /home/proj/stage/mutant/MUTANT/mutant/externals/gms-artic/artic-ncov2019-illumina.sif
[31|891|901] θ71° 7d [hiseq.clinical@hasta:/home/proj/stage/mutant/MUTANT/mutant/externals/gms-artic] [S_main] 48b0f48+ 2m13s ± singularity exec artic-ncov2019-illumina.sif R

R version 4.0.5 (2021-03-31) -- "Shake and Throw"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-conda-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C" 
2: Setting LC_COLLATE failed, using "C" 
3: Setting LC_TIME failed, using "C" 
4: Setting LC_MESSAGES failed, using "C" 
5: Setting LC_MONETARY failed, using "C" 
6: Setting LC_PAPER failed, using "C" 
7: Setting LC_MEASUREMENT failed, using "C" 
>
henningonsbring commented 2 years ago

We have a lot of java errors from fastqc and picard on our cluster. Also R stopped working in the container. @JD2112 have you experienced the same?

Maybe this PR is not ready for merge, for example someone needs to build a new container where R works and put on gms docker-hub. Can @sofstam or @JD2112 help? Perhaps a better solution to make picard behave can be done as well.

I have played around a lot with the dedicated picard memory setting, both testing lower and higher, but that has not helped. Giving fastq fewer threads helped, and retrying picard tools more times helped (but that is a bit ugly maybe it can be improved).

sofstam commented 2 years ago

@henningonsbring I can help with building a new container later in the afternoon.

JD2112 commented 2 years ago

@henningonsbring Yes, I can see the same R error with the latest container. I think it's nice to add R from conda in the yml file.

sofstam commented 2 years ago

Giving fastq fewer threads helped, and retrying picard tools more times helped (but that is a bit ugly maybe it can be improved).

Maybe we can leave the retrying picard tools more times as it is right now since it is common practice for nextflow?

sofstam commented 2 years ago

Shall I merge? @henningonsbring @JD2112

JD2112 commented 2 years ago

@sofstam Sure. I hope it's working fine :)

sofstam commented 2 years ago

I tested:

[1|1|596] θ67° [sofia.stamouli@hasta:~/Metoid/Metoid] [base] master(+235/-395)* ± singularity exec artic-ncov2019-illumina.sif R

R version 4.0.5 (2021-03-31) -- "Shake and Throw"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-conda-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C" 
2: Setting LC_COLLATE failed, using "C" 
3: Setting LC_TIME failed, using "C" 
4: Setting LC_MESSAGES failed, using "C" 
5: Setting LC_MONETARY failed, using "C" 
6: Setting LC_PAPER failed, using "C" 
7: Setting LC_MEASUREMENT failed, using "C" 

and it seems there are no errors related to R.

henningonsbring commented 2 years ago

I think this should be merged now

sofstam commented 2 years ago

The container should be downloaded manually this week for MUTANT.