From 0e78feee628b6f4d8e9697f80af7614d6d22d2ed Mon Sep 17 00:00:00 2001 From: mschechter Date: Mon, 14 Aug 2023 11:42:25 -0500 Subject: [PATCH] throw error if grep disk quota --- anvio/workflows/sra_download/Snakefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/anvio/workflows/sra_download/Snakefile b/anvio/workflows/sra_download/Snakefile index f69763abdb..9e415cec28 100644 --- a/anvio/workflows/sra_download/Snakefile +++ b/anvio/workflows/sra_download/Snakefile @@ -121,6 +121,14 @@ rule fasterq_dump: run: shell("fasterq-dump {params.SRA_INPUT_DIR} -t FASTERQDUMP_TEMP --outdir {params.OUTPUT_DIR} --split-files --verbose --progress --threads {threads} >> {log} 2>&1") + # Check if fasterq-dump encountered a Disk quota exceeded error + error_message = "Disk quota exceeded" + log_path = str(log) + with open(log_path, "r") as log_file: + log_contents = log_file.read() + if error_message in log_contents: + raise Exception("fasterq-dump encountered a Disk quota exceeded when processing {wildcards.accession}") + rule pigz: """Compress FASTQ files using pigz in parallel!