cancerit / ascatNgs

Somatic copy number analysis using WGS paired end wholegenome sequencing
http://cancerit.github.io/ascatNgs/
GNU Affero General Public License v3.0
68 stars 17 forks source link

ascat error occuring with creation of scratch dir #99

Open anoronh4 opened 3 years ago

anoronh4 commented 3 years ago

I am trying to run ascat.pl and coming up on an error immediately after executing: Error in tempdir() using /scratch/myusername/XXXXXXXXXX: Could not create directory /scratch/myusername/Gb4qZ4stot: Read-only file system at /opt/wtsi-cgp/lib/perl5/Sanger/CGP/AlleleCount/Genotype.pm line 182.

i don't see any option in ascat.pl that allows me to point to a new tmp dir. I am running the ascat.pl from within a singularity container (pulled from dockstore-cgpwgs:2.1.0 and dockstore-cgpwgs:2.1.1) on an lsf cluster and my working directory is already a subdirectory of /scratch. any solutions to this?

keiranmraine commented 3 years ago

There is a dedicated ascatngs image in quay.io here:

singularity pull docker://quay.io/wtsicgp/ascatngs:4.4.0

Use of singularity is dependent on how your administrators have configured it. You may need to manually mount the filesystem. I'd expect the command to be something like:

singularity exec --cleanenv --home $HOME:$HOME --bind /scratch:/scratch ascatngs_4.4.0.sif ascat.pl ...
anoronh4 commented 3 years ago

good to know about the other docker, i'll probably switch to that one.

that does seem to be the solution. i automatically assumed i would not be able to bind /scratch while being in a subdirectory of /scratch, but to my surprise it actually works!

anoronh4 commented 3 years ago

so actually we realized that the above is not an appropriate solution, because we are running in the workflow language nextflow that needs to clean up tmp files. we are not sure what the exact behavior will be, but if we let nextflow bind /scratch, it will either try to clean up all /scratch directories that it can access, or it will skip clean up of all /scratch dirs outside of my working directory entirely.

instead our solution was to run export TMPDIR="$(pwd)/tmp" once we enter the container and right before executing ascat.pl. Maybe this comment will be of use to someone else who needs a workaround.

keiranmraine commented 3 years ago

Thanks for the info. We don't use nextflow a huge amount. I'll need to investigate which part is using $TMPDIR as we have tried to push things to the working directory.

anoronh4 commented 3 years ago

@keiranmraine The error (which i did not save unfortunately) pointed me to this line in alleleCount: https://github.com/cancerit/alleleCount/blob/dev/perl/lib/Sanger/CGP/AlleleCount/Genotype.pm#L32

keiranmraine commented 3 years ago

Thanks, 2 places to be fixed:

https://github.com/cancerit/alleleCount/blob/a074b3e2317293907c249cd679a55df1a27f931f/perl/lib/Sanger/CGP/AlleleCount/Genotype.pm#L116

https://github.com/cancerit/alleleCount/blob/a074b3e2317293907c249cd679a55df1a27f931f/perl/lib/Sanger/CGP/AlleleCount/Genotype.pm#L182