ablab / quast

Genome assembly evaluation tool
http://quast.sf.net
Other
395 stars 76 forks source link

[Errno 30] Read-only file system: '/usr/local/lib/python3.10/dist-packages/quast_libs/bwa/make.log' #255

Closed ChiaraCampanelli closed 11 months ago

ChiaraCampanelli commented 11 months ago
quast.py $assembly_quast \     
    --nanopore $fastq \
    -r ${params.genomeref} \
    --threads $task.cpus

The error appears when options parameters have been used. If I run QUAST just by giving in input only the assembly, everything works properly.

For more details: [Errno 30] Read-only file system: '/usr/local/lib/python3.10/dist-packages/quast_libs/bwa/make.log' Traceback (most recent call last): File "/usr/local/bin/quast.py", line 309, in return_code = main(sys.argv[1:]) File "/usr/local/bin/quast.py", line 118, in main bed_fpath, cov_fpath, physical_cov_fpath = reads_analyzer.do(ref_fpath, contigs_fpaths, File "/usr/local/lib/python3.10/dist-packages/quast_libs/reads_analyzer.py", line 928, in do if not compile_reads_analyzer_tools(logger): File "/usr/local/lib/python3.10/dist-packages/quast_libs/ra_utils/misc.py", line 115, in compile_reads_analyzer_tools if compile_bwa(logger, only_clean) and compile_bedtools(logger, only_clean) and compile_minimap(logger, only_clean): File "/usr/local/lib/python3.10/dist-packages/quast_libs/ra_utils/misc.py", line 86, in compile_bwa return bwa_fpath('bwa') or compile_tool('BWA', bwa_dirpath, ['bwa'], only_clean=only_clean, logger=logger) File "/usr/local/lib/python3.10/dist-packages/quast_libs/qutils.py", line 886, in compile_tool open(make_logs_basepath + '.log', 'w').close() OSError: [Errno 30] Read-only file system: '/usr/local/lib/python3.10/dist-packages/quast_libs/bwa/make.log'

By changing the permissions, the error keeps showing.

alexeigurevich commented 11 months ago

Long story short, two workarounds:

  1. Install the BWA aligner on your system and ensure it is added to the PATH environment variable (i.e., you can run bwa in the command line). Rerun Quast after that.
  2. Run Quast from a local installation, e.g., download the .tar.gz release package, unpack it and run quast_5.2.0/quast.py.

In more detail: By default, Quast installation includes only modules required for basic pipeline steps. If you provide raw reads as input (--nanopore in your case) the Quast pipeline uses the read processing module (an advanced feature), which requires some third-party tools installed on your system, in particular BWA. If Quast doesn't see bwa in the PATH environment variable, it tries to compile the BWA version provided within the Quast package. The compilation process creates some files, so requires writing permissions. This process works fine if you use the Quast installation package, e.g., in you home directory. However, in your case, Quast was already installed on your system under /usr/local/lib/ (by a system administrator I suppose), so it doesn't have writing permission in that location.

ChiaraCampanelli commented 10 months ago

Unfortunately I keep having issues with the installation of the tool. Even if it seems to work, at some point it gets stuck. This is the .log file and the part of the process where quast stops:

136541_shasta_racon_trimmed.fastq -r GCA_000001405.15_GRCh38_no_alt_analysis_set.fna -o quast_haploid --threads 18

Version: 5.2.0

System information: OS: Linux-4.18.0-425.13.1.el8_7.x86_64-x86_64-with-glibc2.35 (linux_64) Python version: 3.10.12 CPUs number: 72

Started: 2023-11-16 17:05:20

Logging to /lustre1/project/stg_00124/Chiara/tmp/df/3cdbd1d92d786ea20cdfbbfa7da3e4/quast_haploid/quast.log

CWD: /lustre1/project/stg_00124/Chiara/tmp/df/3cdbd1d92d786ea20cdfbbfa7da3e4 Main parameters: MODE: default, threads: 18, min contig length: 500, min alignment length: 65, min alignment IDY: 95.0, \ ambiguity: one, min local misassembly length: 200, min extensive misassembly length: 1000

Reference: GCA_000001405.15_GRCh38_no_alt_analysis_set.fna ==> GCA_000001405.15_GRCh38_no_alt_analysis_set

Contigs: Pre-processing... polished_assembly.fasta ==> polished_assembly

2023-11-16 17:07:45 Running Reads analyzer... Logging to files /lustre1/project/stg_00124/Chiara/tmp/df/3cdbd1d92d786ea20cdfbbfa7da3e4/quast_haploid/reads_stats/reads_stats.log and /lustre1/project/stg_00124/Chiara/tmp/df/3cdbd1d92d786ea20cdfbbfa7da3e4/quast_haploid/reads_stats/reads_stats.err... Will not search Structural Variations (needs paired-end reads) Pre-processing reads... Running BWA... Pre-processing reads... Running BWA for reference...

I also want to show you the Dockerfile I used to install it:

FROM ubuntu:latest

ENV DEBIAN_FRONTEND noninteractive
RUN chmod ugo+rwx -R /usr/
RUN apt-get update
RUN apt-get install -y apt-utils make wget bzip2 gcc git libncurses5-dev bzip2 libhts-dev libbz2-dev liblzma-dev zlib1g-dev pkg-config libfreetype6-dev libpng-dev python3-matplotlib wget git python3-pip

RUN wget https://github.com/ablab/quast/releases/download/quast_5.2.0/quast-5.2.0.tar.gz
RUN tar -xzf quast-5.2.0.tar.gz
RUN ln -s  /usr/lib/x86_64-linux-gnu/libidn2.so.0.3.7 /usr/lib/x86_64-linux-gnu/libidn11.so
RUN apt install python-is-python3

WORKDIR /quast-5.2.0
RUN python3 ./setup.py install_full

RUN sed -i 's/const uint8_t rle_auxtab/extern const uint8_t rle_auxtab/' /usr/local/lib/python3.10/dist-packages/quast-5.2.0-py3.10.egg/quast_libs/bwa/rle.h
WORKDIR /usr/local/lib/python3.10/dist-packages/quast-5.2.0-py3.10.egg/quast_libs/bwa
RUN make

WORKDIR /usr/local/lib/python3.10/dist-packages/quast-5.2.0-py3.10.egg/quast_libs/bedtools
RUN make

RUN sed -i 's/const uint8_t rle_auxtab/extern const uint8_t rle_auxtab/' /quast-5.2.0/quast_libs/bwa/rle.h
WORKDIR /quast-5.2.0/quast_libs/bwa
RUN make

WORKDIR /quast-5.2.0/quast_libs/bedtools
RUN make

WORKDIR /quast-5.2.0