HKU-BAL / Clair3-Trio

Clair3-Trio: variant calling in trio using Nanopore long-reads

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Memory error while adding --gvcf parameter

asvarvara opened this issue · comments

Hi, I am running Clair3-Trio on HTCondor and I am experiencing issues while "merging variants and non-variants to GVCF" for each chromosome, prompting both MemoryError and OSError: [Errno 12] Cannot allocate memory
It just pass to the next chromosome, prompting the same error and go on, until the last chromosome and then pass to the next tasks. At the end of the process, .vcfs and .bam files are correctly created (in size of GBs), meanwhile .gvcf are basically empty (size of few Mbs)

Apart from the huge walltime I did not run into issues while running the same script without the --gvcf flag, with these condor settings:
request_cpus = 16
request_memory = 128 GB

I encounter this issue with --gvcf even boosting the settings to:
request_cpus = 64
request_memory = 512 GB
So I reckon it's not a matter of lack of memory from my side.

This is an example of the error prompted:

[INFO] Pileup variants processed in chr1: 12927629
[INFO] Trio variants processed in chr1: 1722491
[INFO] Merge variants and non-variants to GVCF
Traceback (most recent call last):
File "/home/Clair3-Trio/trio/../clair3.py", line 112, in
main()
File "/home/Clair3-Trio/trio/../clair3.py", line 106, in main
submodule.main()
File "/home/Clair3-Trio/trio/MergeVcf_Trio.py", line 259, in main
mergeNonVariant(args)
File "/home/Clair3-Trio/trio/MergeVcf_Trio.py", line 180, in mergeNonVariant
args.ctgEnd)
File "/home/Clair3-Trio/preprocess/utils.py", line 221, in mergeCalls
self.writeNonVarBlock(curNonVarStart, curNonVarEnd, curNonVarPos, curNonVarCall, save_writer)
File "/home/Clair3-Trio/preprocess/utils.py", line 181, in writeNonVarBlock
self._writeRightBlock(start, end, curNonVarCall, save_writer)
File "/home/Clair3-Trio/preprocess/utils.py", line 164, in _writeRightBlock
new_ref = self.readReferenceBaseAtPos(pos_cmd)
File "/home/Clair3-Trio/preprocess/utils.py", line 152, in readReferenceBaseAtPos
reader = os.popen(cmd)
File "/home/miniconda3/envs/clair3/lib-python/3/os.py", line 980, in popen
bufsize=buffering)
File "/home/miniconda3/envs/clair3/lib-python/3/subprocess.py", line 744, in init
restore_signals, start_new_session)
File "/home/miniconda3/envs/clair3/lib-python/3/subprocess.py", line 1323, in _execute_child
restore_signals, start_new_session, preexec_fn)
OSError: [Errno 12] Cannot allocate memory
[INFO] Pileup variants processed in chr4: 15631830
...

And this is the script I am running, I emptied the arguments by purpose:

home/Clair3-Trio/run_clair3_trio.sh \
  --bam_fn_c=/home/new_hg38/minimap_S2_sorted.bam \
  --bam_fn_p1=/home/new_hg38/minimap_S3_sorted.bam \
  --bam_fn_p2=home/new_hg38/minimap_S4_sorted.bam \
  --output=/home/new_trio_variants \
  --ref_fn=/home/new_hg38/hg38.fa \
  --threads=12 \
  --model_path_clair3=/home/Clair3-Trio/models/clair3_models/r941_prom_hac_g360+g422 \
  --model_path_clair3_trio=/home/Clair3-Trio/models/clair3_trio_models/c3t_hg002_g422 \
  --whatshap=/home/miniconda3/envs/clair3/bin/whatshap \
  --gvcf \
  --include_all_ctgs \
  --enable_output_phasing \
  --enable_output_haplotagging

Do someone experienced the same issue?

Hi,

We confirmed it as a bug in gvcf setting, and we fixed it in a quick update v0.7.1 in our repo, please try to check whether the updated version can fix your error.

Thanks,
JH