SubPhaser icon indicating copy to clipboard operation
SubPhaser copied to clipboard

IndexError: index -1 is out of bounds for axis 0 with size 0

Open yilunhuangyue opened this issue 2 years ago • 7 comments

Hi, Thanks for developing the tool. I tried the example of ginger and successfully procressed. But When I used my own triploid genome (3n=63), I met an error. My config file is as follow: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 21 22 23 24 25 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 47 48 49 50 51 52 53 54 59 60 64 65 67 68 71 72 73 74 75 76 77

The command was 'subphaser -i ref.fa -c config.txt -pre out', The I get the error like this:

22-06-02 16:24:49 [INFO] Summary of overall LTR insertion age (million years): /home/wangyue/software/miniconda2/envs/SubPhaser/lib/python3.8/site-packages/numpy/core/fromnumeric.py:3440: RuntimeWarning: Mean of empty slice. return _methods._mean(a, axis=axis, dtype=dtype, /home/wangyue/software/miniconda2/envs/SubPhaser/lib/python3.8/site-packages/numpy/core/_methods.py:189: RuntimeWarning: invalid value encountered in double_scalars ret = ret.dtype.type(ret / rcount) Traceback (most recent call last): File "/home/wangyue/software/miniconda2/envs/SubPhaser/bin/subphaser", line 33, in sys.exit(load_entry_point('subphaser==1.2.5', 'console_scripts', 'subphaser')()) File "/home/wangyue/software/miniconda2/envs/SubPhaser/lib/python3.8/site-packages/subphaser-1.2.5-py3.8.egg/subphaser/main.py", line 779, in main pipeline.run() File "/home/wangyue/software/miniconda2/envs/SubPhaser/lib/python3.8/site-packages/subphaser-1.2.5-py3.8.egg/subphaser/main.py", line 516, in run ltr_bedlines, enrich_ltr_bedlines = self.step_ltr(d_kmers) if not self.disable_ltr else ([],[]) File "/home/wangyue/software/miniconda2/envs/SubPhaser/lib/python3.8/site-packages/subphaser-1.2.5-py3.8.egg/subphaser/main.py", line 600, in step_ltr enrich_ltrs = LTR.plot_insert_age(ltrs, d_enriched, prefix, shared=d_shared, File "/home/wangyue/software/miniconda2/envs/SubPhaser/lib/python3.8/site-packages/subphaser-1.2.5-py3.8.egg/subphaser/LTR.py", line 513, in plot_insert_age d_info = summary_ltr_time(d_data, fout) File "/home/wangyue/software/miniconda2/envs/SubPhaser/lib/python3.8/site-packages/subphaser-1.2.5-py3.8.egg/subphaser/LTR.py", line 578, in summary_ltr_time np.median(xages), abs(np.percentile(xages, 2.5)), np.percentile(xages, 97.5))) File "<array_function internals>", line 5, in percentile File "/home/wangyue/software/miniconda2/envs/SubPhaser/lib/python3.8/site-packages/numpy/lib/function_base.py", line 3867, in percentile return _quantile_unchecked( File "/home/wangyue/software/miniconda2/envs/SubPhaser/lib/python3.8/site-packages/numpy/lib/function_base.py", line 3986, in _quantile_unchecked r, k = _ureduce(a, func=_quantile_ureduce_func, q=q, axis=axis, out=out, File "/home/wangyue/software/miniconda2/envs/SubPhaser/lib/python3.8/site-packages/numpy/lib/function_base.py", line 3564, in _ureduce r = func(a, **kwargs) File "/home/wangyue/software/miniconda2/envs/SubPhaser/lib/python3.8/site-packages/numpy/lib/function_base.py", line 4098, in _quantile_ureduce_func n = np.isnan(ap[-1]) IndexError: index -1 is out of bounds for axis 0 with size 0

And the results in the file "outk15_q200_f2.chrom-subgenome.tsv" showed different number of chromosomes for each genotype.

I don't know where is my problem. Can you give me any advises? Thanks a lot

yilunhuangyue avatar Jun 02 '22 11:06 yilunhuangyue

Can you show me the whole log and the plots produced by subphaser? I suspect that the genome is not well phased.

zhangrengang avatar Jun 02 '22 11:06 zhangrengang

4DQ_~L8B~BFHLF_NIG60(E](https://user-images.githubusercontent.com/16872303/171627985-0954bc75-94d0-4e59-aa47-063a3672944c.png) ![}AKLT KQ G68(R3O6{5E216](https://user-images.githubusercontent.com/16872303/171627990-de8f4ef6-d327-48c6-aa37-9c0350851bbd.png) ![JV3X~O_F@VU}69)5G{)TZX

yilunhuangyue avatar Jun 02 '22 12:06 yilunhuangyue

}AKLT KQ G68(R3O6{5E216

yilunhuangyue avatar Jun 02 '22 12:06 yilunhuangyue

4`DQ_~L8B~BFHLF_NIG60(E

yilunhuangyue avatar Jun 02 '22 12:06 yilunhuangyue

log.txt

yilunhuangyue avatar Jun 02 '22 12:06 yilunhuangyue

As clearly shown by the results, the subgenomes are not well assigned, because there are too few differential kmers between subgenomes. It may be artifactual or natural. My suggestions (refer to the Supplementary Material):

  1. Check the HiC contact map whether there are too many switch errors between subgenomes. If not, it is natural.
  2. If natural, it may be because 1) there are too many recombinations between subgenomes after hybridization, or 2) their progenitors are too close (possible autopolyploid) to distinguish. In these cases, subgenome phasing is meaningless and subphaser will not work.

So many chromosomes may also be an issue. You can have a try to reduce the number of homeologous chromosome sets by setting the config like:

1 2 3
...
13 14 15
16
17
18
...
75
76
77

Remove check point files by rm tmp/*ok before re-runing to avoid confusing.

zhangrengang avatar Jun 02 '22 12:06 zhangrengang

Thank you for your quick reply. I will take a try

yilunhuangyue avatar Jun 02 '22 12:06 yilunhuangyue