SunPengChuan / wgdi

WGDI: A user-friendly toolkit for evolutionary analyses of whole-genome duplications and ancestral karyotypes
https://wgdi.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
114 stars 22 forks source link

Problem of ancestral_karyotype_repertoire #48

Closed SUPERI-SAI closed 7 months ago

SUPERI-SAI commented 7 months ago

Hello, thank you very much for this program !

I am doing the step of ancestral_karyotype_repertoire, and now i have a problem about it. Here is my script (ANC.akr.conf):

[ancestral_karyotype_repertoire]
blockinfo =  Cipangopaludina_cathayensis.ANC.block.correspondence.csv
blockinfo_reverse = False
gff1 = Cipangopaludina_cathayensis.gff4
gff2 = allspe.ancestor.gff
gap = 5
mark = ANC.on.Cipangopaludina_cathayensis
ancestor = allspe.ancestor.txt
ancestor_new =  allspe.ancestor.on.Cipangopaludina_cathayensis.txt
ancestor_pep =  allspe.ancestor.on.Cipangopaludina_cathayensis.pep
ancestor_pep_new =  allspe.ancestor.on.Cipangopaludina_cathayensis.pep_new
ancestor_gff =  allspe.ancestor.on.Cipangopaludina_cathayensis.gff
ancestor_lens =  allspe.ancestor.on.Cipangopaludina_cathayensis.lens

and i run it with the commond: wgdi -akr ANC.akr.conf I got the error message as follows:

+ wgdi -akr ANC.akr.conf
/public1/home/stu_qs/miniconda3/lib/python3.9/site-packages/scipy/__init__.py:155: UserWarning: A NumPy version >=1.18.5 and <1.26.0 is required for this version of SciPy (detected version 1.26.0
  warnings.warn(f"A NumPy version >={np_minversion} and <{np_maxversion}"
blockinfo  =  Cipangopaludina_cathayensis.ANC.block.correspondence.csv
blockinfo_reverse  =  False
gff1  =  Cipangopaludina_cathayensis.gff4
gff2  =  allspe.ancestor.gff
gap  =  5
mark  =  ANC.on.Cipangopaludina_cathayensis
ancestor  =  allspe.ancestor.txt
ancestor_new  =  allspe.ancestor.on.Cipangopaludina_cathayensis.txt
ancestor_pep  =  allspe.ancestor.on.Cipangopaludina_cathayensis.pep
ancestor_pep_new  =  allspe.ancestor.on.Cipangopaludina_cathayensis.pep_new
ancestor_gff  =  allspe.ancestor.on.Cipangopaludina_cathayensis.gff
ancestor_lens  =  allspe.ancestor.on.Cipangopaludina_cathayensis.lens
Traceback (most recent call last):
  File "/public1/home/stu_qs/miniconda3/lib/python3.9/site-packages/pandas/core/indexes/base.py", line 3790, in get_loc
    return self._engine.get_loc(casted_key)
  File "index.pyx", line 152, in pandas._libs.index.IndexEngine.get_loc
  File "index.pyx", line 181, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 7080, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 7088, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: '1'

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

Traceback (most recent call last):
  File "/public1/home/stu_qs/miniconda3/bin/wgdi", line 10, in <module>
    sys.exit(main())
  File "/public1/home/stu_qs/miniconda3/lib/python3.9/site-packages/wgdi/run.py", line 163, in main
    module_to_run(arg, value)
  File "/public1/home/stu_qs/miniconda3/lib/python3.9/site-packages/wgdi/run.py", line 122, in module_to_run
    run_subprogram(program, conf, name)
  File "/public1/home/stu_qs/miniconda3/lib/python3.9/site-packages/wgdi/run.py", line 87, in run_subprogram
    r.run()
  File "/public1/home/stu_qs/miniconda3/lib/python3.9/site-packages/wgdi/ancestral_karyotype_repertoire.py", line 63, in run
    ancestor.at[index, 2] = lens.at[str(row[0]),'order']
  File "/public1/home/stu_qs/miniconda3/lib/python3.9/site-packages/pandas/core/indexing.py", line 2488, in __getitem__
    return super().__getitem__(key)
  File "/public1/home/stu_qs/miniconda3/lib/python3.9/site-packages/pandas/core/indexing.py", line 2440, in __getitem__
    return self.obj._get_value(*key, takeable=self._takeable)
  File "/public1/home/stu_qs/miniconda3/lib/python3.9/site-packages/pandas/core/frame.py", line 4012, in _get_value
    row = self.index.get_loc(index)
  File "/public1/home/stu_qs/miniconda3/lib/python3.9/site-packages/pandas/core/indexes/base.py", line 3797, in get_loc
    raise KeyError(key) from err
KeyError: '1'

This is the file I used to run it. To avoid the uploading error, i changed the suffix of the gff file to gff.txt allspe.ancestor.txt Cipangopaludina_cathayensis.ANC.block.correspondence.csv allspe.ancestor.gff.txt Cipangopaludina_cathayensis.gff4.txt

Could you please help me check the problem?

SunPengChuan commented 7 months ago

[ancestral_karyotype_repertoire] blockinfo = Cipangopaludina_cathayensis.ANC.block.correspondence.csv blockinfo_reverse = true gff2 = Cipangopaludina_cathayensis.gff4.txt gff1 = allspe.ancestor.gff.txt gap = 5 mark = ANC.on.Cipangopaludina_cathayensis ancestor = allspe.ancestor.txt ancestor_new = allspe.ancestor.on.Cipangopaludina_cathayensis.txt ancestor_pep = allspe.ancestor.on.Cipangopaludina_cathayensis.pep ancestor_pep_new = allspe.ancestor.on.Cipangopaludina_cathayensis.pep_new ancestor_gff = allspe.ancestor.on.Cipangopaludina_cathayensis.gff ancestor_lens = allspe.ancestor.on.Cipangopaludina_cathayensis.lens

I don't have the file named 'allspe.ancestor.on.Cipangopaludina_cathayensis.pep'. ancestor_pep = ancestor pep file

cat all pep files together

Adjustments are needed for gff1, gff2, and blockinfo_reverse to align seamlessly with the provided blockinfo and ancestor, ensuring consistent order. Could you please give it another try now?

SUPERI-SAI commented 7 months ago

blockinfo_reverse

Thank you for your prompt reply! I changed the order of gff1 and gff2 and changed the ‘blockinfo_reverse’ parameter to ‘true’, and now it works! Thanks again for your help!