weissmanlab / magic

Minimal Assumption Genomic Inference of Coalescence
MIT License
14 stars 2 forks source link

Error in magic.py #4

Closed SatoshiYa closed 5 years ago

SatoshiYa commented 5 years ago

Hi

I got an error in magic.py. command was "~/magic/magic.py *_counts.txt --out genome", and error message was below:

Traceback (most recent call last): File "/home/b/b35614/magic/magic.py", line 609, in counts = extract_counts(args.countfiles) File "/home/b/b35614/magic/magic.py", line 566, in extract_counts return [SNPHistogram(dict2array(hist)) for hist in combocountdicts] File "/home/b/b35614/magic/magic.py", line 566, in return [SNPHistogram(dict2array(hist)) for hist in combocountdicts] File "/home/b/b35614/magic/magic.py", line 550, in dict2array maxi = max(wdata.keys()) ValueError: max() arg is an empty sequence

Input files for magic.py were generated combo_prep.py and windower.py with below commands:

~/magic/combo_prep.py bamCaller.masked_scfxx.vcf.gz --coverfile scfxx.mask.bed.gz --masks bamCaller.masked_scfxx > scfxx.txt ~/magic/windower.py scfxx.txt --coverfile scfxx.mask.bed.gz

The first command generated “scfxx.txt” and the second command generated “scfxx_counts.txt” and “scfxx.log.” The generated “scfxx_counts.txt” was used in magic.py.

Do you have any help? Thank you in advance.

Satoshi

weissman commented 5 years ago

Hi Satoshi, can you upload the scfxx_counts.txt file so I can test it out? Thanks!

SatoshiYa commented 5 years ago

Yes. I attached. scfxx_counts.txt

SatoshiYa commented 5 years ago

I found a solution. remove lines 11–14 of the attached file, which have no information.

weissman commented 5 years ago

Thanks for pointing this out. I've edited magic.py so that it shouldn't choke anymore on trailing empty lines.