ukhsa-collaboration/PHEnix

Crash when calculating memory before samtools sort

Closed this issue · 2 comments

Hi.
I have a crash in phenix when running on MAC OSX in anconda2 environment

Traceback (most recent call last):
File "/Users/cheryll.sia/anaconda2/bin/phenix.py", line 6, in
exec(compile(open(file).read(), file, 'exec'))
File "/Users/cheryll.sia/PHEnix/scripts/phenix.py", line 113, in
exit(main())
File "/Users/cheryll.sia/PHEnix/scripts/phenix.py", line 99, in main
return run_snp_pipeline.main(args)
File "/Users/cheryll.sia/PHEnix/scripts/run_snp_pipeline.py", line 206, in main
make_aux=make_aux)
File "/Users/cheryll.sia/PHEnix/phe/mapping/init.py", line 154, in make_bam
sort_memory = calculate_memory_for_sort()
File "/Users/cheryll.sia/PHEnix/phe/utils/init.py", line 1079, in calculate_memory_for_sort
avail_memory = os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') # e.g. 4015976448
ValueError: unrecognized configuration name

The way it calculates the available physical memory is known not to work in Mac OS.

6f18ba5

This commit should fix it. I don't have a Mac, soo I cannot test it. Please let me know if it works. You need to install the psutil Python library on your Mac, else it still won't work.