DivyaratanPopli / Kinship_Inference

This is a tool to estimate pairwise relatedness from ancient DNA, taking in account contamination, ROH, ascertainment bias.
GNU General Public License v3.0
7 stars 2 forks source link

KINgaroo crash after populating splitbams and hapProbs #6

Closed logankistler closed 1 year ago

logankistler commented 1 year ago

Hello,

I'm running KINgaroo on a species with 18 chr, notated 1..18 in the bam and bed files. All runs smoothly to split and sort the bam files and produce _probs.csv and diffs.csv files for each of 22 chromosomes in the 19 samples, although files for chr 19..22 are all empty.

At that point I get the following error and a crash, pasted below. I wonder if the empty chromosome values could be causing this, but I'm not sure how to verify or correct if that's the case.

Insights/suggestions very much appreciated, thank you! Logan

multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/share/apps/tools/python/3.8/lib/python3.8/multiprocessing/pool.py", line 125, in worker result = (True, func(*args, *kwds)) File "/home/kistlerl/.local/lib/python3.8/site-packages/KINgaroo/KINgaroo_scripts/helpers.py", line 139, in get_merged_chrm diffs_list = findDiff(inds=probs_list, posall=pos_list) File "/home/kistlerl/.local/lib/python3.8/site-packages/KINgaroo/KINgaroo_scripts/input_preparation_functions.py", line 124, in findDiff diff0=(np.vstack(inds[:,0]) (1-inds)) + ((1-np.vstack(inds[:,0])) * inds) File "<__array_function__ internals>", line 5, in vstack File "/share/apps/tools/python/3.8/lib/python3.8/site-packages/numpy/core/shape_base.py", line 283, in vstack return _nx.concatenate(arrs, 0) File "<__array_function__ internals>", line 5, in concatenate ValueError: need at least one array to concatenate """

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/kistlerl/.local/bin/KINgaroo", line 8, in sys.exit(main.main()) File "/home/kistlerl/.local/lib/python3.8/site-packages/KINgaroo/main.py", line 104, in main libraries, listf, dwins, twins, id_dwins, id_twins, chrmlist = hel.pipeline1(targetsfile = args.target_location, File "/home/kistlerl/.local/lib/python3.8/site-packages/KINgaroo/KINgaroo_scripts/helpers.py", line 330, in pipeline1 dwins,twins,id_dwins,id_twins, chrmlist = parallel_mergedchrm(libraries=libraries, totalch=chrmf, interval=interval, cores=cores) File "/home/kistlerl/.local/lib/python3.8/site-packages/KINgaroo/KINgaroo_scripts/helpers.py", line 154, in parallel_mergedchrm allf = [p.get() for p in res] File "/home/kistlerl/.local/lib/python3.8/site-packages/KINgaroo/KINgaroo_scripts/helpers.py", line 154, in allf = [p.get() for p in res] File "/share/apps/tools/python/3.8/lib/python3.8/multiprocessing/pool.py", line 771, in get raise self._value ValueError: need at least one array to concatenate

DivyaratanPopli commented 1 year ago

Hi, thanks for pointing out this issue. I have updated the scripts to accommodate the case where number of chromosome pairs is not 22. You can run KINgaroo with -N 18 to specify 18 chromosome pairs. I hope this helps.

logankistler commented 1 year ago

That did it, thanks!