popgenmethods / momi2

Infer demographic history with the Moran model
GNU General Public License v3.0
47 stars 11 forks source link

Error computing allele counts. #28

Closed Hjorvik closed 4 years ago

Hjorvik commented 5 years ago

I've been following the tutorial, and at the point where you have to compute the allele counts I'm getting this error:

Traceback (most recent call last): File "/home/pedrom/.pyenv/versions/anaconda3-2019.07/envs/Momi2/lib/python3.6/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/home/pedrom/.pyenv/versions/anaconda3-2019.07/envs/Momi2/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/pedrom/.pyenv/versions/anaconda3-2019.07/envs/Momi2/lib/python3.6/site-packages/momi/read_vcf.py", line 45, in info_aa_field=args.info_aa_field).dump(args.out_file) File "/home/pedrom/.pyenv/versions/anaconda3-2019.07/envs/Momi2/lib/python3.6/site-packages/momi/data/snps.py", line 96, in read_vcf bcf_in.subset_samples(list(ind2pop.keys())) File "pysam/cbcf.pyx", line 2407, in pysam.cbcf.VariantFile.subset_samples (pysam/cbcf.c:32879) ValueError: I/O operation on closed file

I have also tried it on my data with the same result. Any idea of what is going on?

Hjorvik commented 5 years ago

I tested it on my own computer instead of on the cluster I was using before and everything seems to work. Same code, same versions installed from the same source (conda).

jackkamm commented 4 years ago

Thanks for reporting. It's perplexing that it works fine on your computer but not on your cluster. I'm not sure where to start debugging.

What OS is your personal computer, and what OS is your cluster running?

jackkamm commented 4 years ago

I've just uploaded a newer version of momi (2.1.18) on Python 3.7. Could you try the new version to see if the problem goes away?

Hjorvik commented 4 years ago

Now it works perfectly. Thanks.