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

problem with running KINgaroo #4

Closed bgyuris closed 1 year ago

bgyuris commented 1 year ago

Hi,

I have tried to run KINgaroo but got into this problem while running a test or my dataset:

Traceback (most recent call last): File "/home/install/anaconda3/bin/KINgaroo", line 5, in from KINgaroo import main File "/home/install/anaconda3/lib/python3.9/site-packages/KINgaroo/main.py", line 13, in from .KINgaroo_scripts import helpers as hel File "/home/install/anaconda3/lib/python3.9/site-packages/KINgaroo/KINgaroo_scripts/helpers.py", line 14, in from .input_preparation_functions import * File "/home/install/anaconda3/lib/python3.9/site-packages/KINgaroo/KINgaroo_scripts/input_preparation_functions.py", line 15, in import pybedtools File "/home/install/anaconda3/lib/python3.9/site-packages/pybedtools/init.py", line 8, in from .cbedtools import ( ImportError: /home/install/anaconda3/lib/python3.9/site-packages/pybedtools/cbedtools.cpython-39-x86_64-linux-gnu.so: undefined symbol: _ZSt28__throw_bad_array_new_lengthv

Do you have any idea how to resolve it? Thanks

DivyaratanPopli commented 1 year ago

Hi, looks like there is an import error. Are you using a conda environment as described in README.md?

bgyuris commented 1 year ago

Hi,

Now I have redone it in conda environment again and seems fine, thanks. But another issue occurred with KINgaroo.

Traceback (most recent call last): File "/home/install/anaconda3/envs/kin1/lib/python3.8/multiprocessing/pool.py", line 125, in worker result = (True, func(*args, *kwds)) File "/home/install/anaconda3/envs/kin1/lib/python3.8/site-packages/KINgaroo/KINgaroo_scripts/helpers.py", line 134, in get_merged_chrm probs_list, pos_list, chrm_list = hapProbsAll(haplist=pslist, hap='noid') File "/home/install/anaconda3/envs/kin1/lib/python3.8/site-packages/KINgaroo/KINgaroo_scripts/input_preparation_functions.py", line 96, in hapProbsAll x=pd.read_csv(fi, sep=",", header=0,index_col=0) File "/home/install/anaconda3/envs/kin1/lib/python3.8/site-packages/pandas/util/_decorators.py", line 311, in wrapper return func(args, kwargs) File "/home/install/anaconda3/envs/kin1/lib/python3.8/site-packages/pandas/io/parsers/readers.py", line 586, in read_csv return _read(filepath_or_buffer, kwds) File "/home/install/anaconda3/envs/kin1/lib/python3.8/site-packages/pandas/io/parsers/readers.py", line 482, in _read parser = TextFileReader(filepath_or_buffer, kwds) File "/home/install/anaconda3/envs/kin1/lib/python3.8/site-packages/pandas/io/parsers/readers.py", line 811, in init self._engine = self._make_engine(self.engine) File "/home/install/anaconda3/envs/kin1/lib/python3.8/site-packages/pandas/io/parsers/readers.py", line 1040, in _make_engine return mapping[engine](self.f, **self.options) # type: ignore[call-arg] File "/home/install/anaconda3/envs/kin1/lib/python3.8/site-packages/pandas/io/parsers/c_parser_wrapper.py", line 51, in init self._open_handles(src, kwds) File "/home/install/anaconda3/envs/kin1/lib/python3.8/site-packages/pandas/io/parsers/base_parser.py", line 222, in _open_handles self.handles = get_handle( File "/home/install/anaconda3/envs/kin1/lib/python3.8/site-packages/pandas/io/common.py", line 701, in gethandle handle = open( FileNotFoundError: [Errno 2] No such file or directory: 'hapProbs/hapProbs/media/install/fd1024f6-b3b9-4f39-82f4-2b63628e64ce/bams_for_kin/A1803_chrm1_probs.csv' """

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

Traceback (most recent call last): File "/home/install/anaconda3/envs/kin1/bin/KINgaroo", line 8, in sys.exit(main.main()) File "/home/install/anaconda3/envs/kin1/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/install/anaconda3/envs/kin1/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/install/anaconda3/envs/kin1/lib/python3.8/site-packages/KINgaroo/KINgaroo_scripts/helpers.py", line 154, in parallel_mergedchrm allf = [p.get() for p in res] File "/home/install/anaconda3/envs/kin1/lib/python3.8/site-packages/KINgaroo/KINgaroo_scripts/helpers.py", line 154, in allf = [p.get() for p in res] File "/home/install/anaconda3/envs/kin1/lib/python3.8/multiprocessing/pool.py", line 771, in get raise self.value FileNotFoundError: [Errno 2] No such file or directory: 'hapProbs/hapProbs/media/install/fd1024f6-b3b9-4f39-82f4-2b63628e64ce/bams_for_kin/A1803_chrm1_probs.csv'

I see it was an issue for others too so I double-checked the bed file and also the bams (it was already rmdup). Do you have any idea how to resolve this?

Thanks

DivyaratanPopli commented 1 year ago

Can you send me screenshot of your input files (first few rows), and the command you're using?

bgyuris commented 1 year ago

KINgaroo -bam ~/bams_for_kin -bed 1240k_chr_20220920.bed -T bamlist.txt -cnt 0

Képernyőkép ekkor: 2022-09-27 10-53-28

Képernyőkép ekkor: 2022-09-27 10-52-42

DivyaratanPopli commented 1 year ago

The issue is that the script expects 1,2,3... as chromosomes but your bed file and bam files have chr1,...It should run fine if you change that.

bgyuris commented 1 year ago

I also tried it earlier without chr for other reference samples. Attaching the picture of those, but got the same problem.

Képernyőkép ekkor: 2022-09-27 10-51-57

Képernyőkép ekkor: 2022-09-27 10-53-52

DivyaratanPopli commented 1 year ago

Can you run the same command with -test 1 option, and send me screenshot of all the output files?

bgyuris commented 1 year ago

Képernyőkép ekkor: 2022-09-27 14-20-09 Képernyőkép ekkor: 2022-09-27 14-20-27 Képernyőkép ekkor: 2022-09-27 14-21-08

DivyaratanPopli commented 1 year ago

The files look ok. What is the exact error that you get while using bam and bed files with chromosomes denoted by 1,2..?

bgyuris commented 1 year ago

Hi, sorry for the late answer. The problem was with the bam files. Now it is working properly.

Thanks