bulik / ldsc

LD Score Regression (LDSC)
GNU General Public License v3.0
628 stars 339 forks source link

Empty log files #239

Open zubiamansoor opened 4 years ago

zubiamansoor commented 4 years ago

Hi,

I am trying to use ldsc to compute genetic correlation and am doing so using Compute Canada. For both of my phenotypes, I ran the analysis on smaller-sized test sets (since the original dataset is so large) and it works fine. But when I am performing it on the full dataset, all I get are empty log files. Just wondering if anyone encountered similar circumstances or can shed more light on how I can proceed?

Any help is appreciated!

Zubia

adamdoescode commented 3 years ago

Hi,

After experiencing this issue I have been able to reproduce this bug reliably by doing the following.

  1. Perform ldsc.py heritability estimation on some munged summary stats
  2. Inspect log file to confirm information is present (it should be there)
  3. Repeat the ldsc.py call with the same --out PREFIX flag
  4. Inspect log file to find it is now empty!

Workaround: Deleting the log file and performing the call a third time will restore the log file with the correct information inside it.

Causes?

I suspect this is caused by the way the log file is generated. I can see from the ldsc.py file that there is a custom logger class which is called a single time within __main__ and uses open(fh, 'wb') which should just overwrite the existing log file and output a new one. Someone more confident with python 2 and ldsc.py could probably diagnose this problem quickly.