SunPengChuan / wgdi-example

14 stars 8 forks source link

Alignmenttrees (-at) KeyError #3

Closed erika-r-moore closed 6 months ago

erika-r-moore commented 6 months ago

Hello!

I am trying to run the "Alignmenttrees" command (-at) but keep getting a key error:

alignment  =  align_polyclass_vvi161s-ALL8.csv
gff  =  ./0_gff/vvi161s.gff
lens  =  ./0_lens/vvi161s.lens
dir  =  ./GRAPE/aster8/
sequence_file  =  ./0_pep/asterales8.pep.fa
cds_file  =  ./0_cds/asterales8.cds.fa
codon_positon  =  1,2,3
trees_file  =  ./GRAPE/aster8/aster8.nwk
align_software  =  mafft
tree_software  =  iqtree
model  =  MFP
trimming  =  trimal
minimum  =  2
delete_detail  =  false
Traceback (most recent call last):
  File "/home/ermoore3/miniconda2/envs/mamba/envs/wgdi/bin/wgdi", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/ermoore3/miniconda2/envs/mamba/envs/wgdi/lib/python3.12/site-packages/wgdi/run.py", line 163, in main
    module_to_run(arg, value)
  File "/home/ermoore3/miniconda2/envs/mamba/envs/wgdi/lib/python3.12/site-packages/wgdi/run.py", line 122, in module_to_run
    run_subprogram(program, conf, name)
  File "/home/ermoore3/miniconda2/envs/mamba/envs/wgdi/lib/python3.12/site-packages/wgdi/run.py", line 87, in run_subprogram
    r.run()
  File "/home/ermoore3/miniconda2/envs/mamba/envs/wgdi/lib/python3.12/site-packages/wgdi/trees.py", line 182, in run
    data = self.grouping(alignment)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ermoore3/miniconda2/envs/mamba/envs/wgdi/lib/python3.12/site-packages/wgdi/trees.py", line 57, in grouping
    gene_sequence = sequence[row[i]]
                    ~~~~~~~~^^^^^^^^
KeyError: 'vvi161s11g00006'

This is an example of the first ten lines what my alignment file looks like:

vvi161s11g00001,,,,,,,,,,,,,,,,,,,,
vvi161s11g00002,,,,,,,,,,,,,,,,,,,,
vvi161s11g00003,,,,,,,,,,,,,,,,,,,,
vvi161s11g00004,,,,,,,,,,,,,,,,,,,,
vvi161s11g00005,,,,,,,,,,,,,,,,,,,,
vvi161s11g00006,,,,,,,,,,,,,,,,,,,,"Platycodon('scaffold_4',)g01388"
vvi161s11g00007,,,,,,,,,,,,,,,,,,,,"Platycodon('scaffold_4',)g01389"
vvi161s11g00008,,,,,,,,,,,,,,,,"Lactuca('Dovetail_5',)g05481",,,,.
vvi161s11g00009,,,,,,,,,,,,,,,,.,,,,.
vvi161s11g00010,,,,,"Arctium('CM042053.1',)g00003",,,,,"Helianthus('Ha412HOChr03',)g00009",,,,,,"Lactuca('Dovetail_5',)g05518",,,"Nymphoides('chr4',)g02459","Platycodon('scaffold_4',)g01426"

Do you have any idea what the issue is? I have been able to successfully run this before, but it is now giving me this error.

Let me know if you need any more information! Thanks!

Best, Erika

SunPengChuan commented 6 months ago

The error indicates the gene ID cannot be found in cds or pep. Keep in mind, the required minimum value should be at least 4 (even if you input 2, the system processes it as 4). If you encounter difficulties, please send your data to sunpengchuan@gmail.com and I will help you resolve the issue.

erika-r-moore commented 6 months ago

Thank you for the quick response! I double checked my pep and cds files and I did miss one of the species. Once added, the function worked!