KangchengHou / admix-kit

Toolkit for analyzing genetics data from admixed populations
https://kangchenghou.github.io/admix-kit
22 stars 5 forks source link

Error in admix lanc_convert #15

Closed nrosewick closed 2 years ago

nrosewick commented 2 years ago

Hello,

I try to convert rfmix output to lanc format using admix lanc_convert

admix lanc_convert input out.lanc --rfmix input.msp.tsv

I got this error :

2022-02-07 10:11.59 [info     ] Received parameters: 
lanc-convert
  --pfile=input
  --out=output.lanc
  --rfmix=input.msp.tsv
  --raw=None
Traceback (most recent call last):
  File "/home/user/.local/bin/admix", line 33, in <module>
    sys.exit(load_entry_point('admix-kit', 'console_scripts', 'admix')())
  File "/home/users/tools/admix-kit/new/admix-kit/admix/cli/__init__.py", line 37, in cli
    fire.Fire()
  File "/home/user/.local/lib/python3.9/site-packages/fire/core.py", line 141, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)
  File "/home/user/.local/lib/python3.9/site-packages/fire/core.py", line 466, in _Fire
    component, remaining_args = _CallAndUpdateTrace(
  File "/home/user/.local/lib/python3.9/site-packages/fire/core.py", line 681, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
  File "/home/users/tools/admix-kit/new/admix-kit/admix/cli/_lanc.py", line 54, in lanc_convert
    lanc = admix.io.read_rfmix(
  File "/home/users/tools/admix-kit/new/admix-kit/admix/io/_read.py", line 340, in read_rfmix
    chunk_start, chunk_stop = np.where(chunk_mask)[0][[0, -1]]
IndexError: index 0 is out of bounds for axis 0 with size 0

Any idea how to solve this ? thank you

KangchengHou commented 2 years ago

Seems that there is a RFmix chunk where you don't have any SNPs in the pfile.

Could you provide more information on how you obtain the local ancestry?

KangchengHou commented 2 years ago

Meanwhile please git pull to the latest version and try again, i have some updates on this.

nrosewick commented 2 years ago

lanc-convert finished with :

2022-02-08 11:07.39 [warning  ] No SNP found in 0-th region of RFmix
2022-02-08 11:07.39 [warning  ] No SNP found in 1-th region of RFmix

But no output .lanc file is created ..

I use 1000G hg38 data as reference to perform rfmix : http://ftp.1000genomes.ebi.ac.uk/vol1/ftp/data_collections/1000G_2504_high_coverage/working/20201028_3202_phased/

KangchengHou commented 2 years ago

I updated the repo to print more information which would help debugging. Could you pull and try again? Thanks.

KangchengHou commented 2 years ago

closing this.. feel free to reopen