abyzovlab / CNVpytor

a python extension of CNVnator -- a tool for CNV analysis from depth-of-coverage by mapped reads
MIT License
178 stars 26 forks source link

List index out of range #209

Closed zainabae closed 7 months ago

zainabae commented 7 months ago

Hello, I faced an issue while merging multiple samples

Here is the code:

cnvpytor -conf /media/hussain/research_1/CNV/CamDro3/ref_genome_conf.py -root 10_awarik.pytor 37_Non_AP.pytor KWH_AP.pytor 18_Non_AP.pytor 38_Non_AP.pytor KW-RC-01_KSA_KW_Omn.pytor 19_AP.pytor 41_Non_AP.pytor KW-RC-02_KSA_KW_Omn.pytor 1_awarik.pytor 42_Non_AP.pytor KW-
RC-03_KSA_KW_Omn.pytor 20_AP.pytor 43_AP.pytor KW-RC-04_KSA_KW_Omn.pytor 21_AP.pytor 4_AP.pytor KW-RC-05_KSA_KW_Omn.pytor 22_AP.pytor 5_AP.pytor KW_RC_06_KSA_KW_Omn.pytor 23_AP.pytor 5_awarik.pytor KW_RC_07_KSA_KW_Omn.pytor 24_AP.pytor 6_awarik.pytor KW_RC_08_KSA_KW_Omn.pytor 25_AP.pytor 7_AP.pytor KW_RC_09_KSA_KW_Omn.pytor 26_AP.pytor 7_awarik.pytor KW_RC_10_KSA_KW_Omn.pytor 27_AP.pytor 8_AP.pytor MJH_1_Omn_kw.pytor 28_AP.pytor 8_awarik.pytor S26_Omn_kw.pytor 29_AP.pytor Camel-DNA-1_KSA_KW_Omn.pytor S42_Omn_kw.pytor 2_AP.pytor Camel-DNA-2_KSA_KW_Omn.pytor S43_Omn_kw.pytor 2_awarik.pytor Camel-DNA-3_KSA_KW_Omn.pytor S45_Omn_kw.pytor 30_AP.pytor Camel-DNA-4_KSA_KW_Omn.pytor SFR_1_Omn_kw.pytor 31_AP.pytor KWC_AP.pytor SFR_2_Omn_kw.pytor 32_AP.pytor KW-H76_KSA_KW_Omn.pytor SWFR_Omn_kw.pytor 33_AP.pytor KW-H77_KSA_KW_Omn.pytor WED_1_Omn_kw.pytor  -view 500 

2024-01-25 15:16:54,258 - cnvpytor.genome - INFO - Reading configuration file '/media/hussain/research_1/CNV/CamDro3/ref_genome_conf.py'.
2024-01-25 15:16:54,294 - cnvpytor.genome - INFO - Importing reference genome data: 'CamDro3'.
cnvpytor> set Q0_range -1 0.5
    * Q0_range: [-1.0, 0.5]
cnvpytor> set p_range 0 0.0001
    * p_range: [0.0, 0.0001]
cnvpytor> set size_range 1500 inf 
    * size_range: [1500, inf]
cnvpytor> set dG_range 100000 inf
    * dG_range: [100000, inf]
cnvpytor> set pN_range 0 0.5
    * pN_range: [0.0, 0.5]
cnvpytor> set print_filename 60_samples_calls.xlsx
    * print_filename: 60_samples_calls.xlsx
cnvpytor> print merged_calls

I got this error:

Traceback (most recent call last):
  File "/home/hussain/miniconda3/bin/cnvpytor", line 8, in <module>
    sys.exit(main())
  File "/home/hussain/.local/lib/python3.9/site-packages/cnvpytor/__main__.py", line 313, in main
    view.prompt()
  File "/home/hussain/.local/lib/python3.9/site-packages/cnvpytor/viewer.py", line 512, in prompt
    self.print_simple_merged_calls()
  File "/home/hussain/.local/lib/python3.9/site-packages/cnvpytor/viewer.py", line 1385, in print_simple_merged_calls
    genotypes = [
  File "/home/hussain/.local/lib/python3.9/site-packages/cnvpytor/viewer.py", line 1386, in <listcomp>
    self.genotype([bin_size], "%s:%d-%d" % (c, maxstart, minend), file_index=ix[i], p_val=True)[0]
  File "/home/hussain/.local/lib/python3.9/site-packages/cnvpytor/viewer.py", line 4001, in genotype
    e1 = getEValue(stat[4], stat[5], his_p, bin1, bin2 + 1) * 2.9e9 / bs
IndexError: list index out of range
arpanda commented 7 months ago

I suspect there might be an issue with 1-2 samples. To confirm, could you please check if you're obtaining CNV results for individual samples?

Additionally, have you examined this with 2-3 samples instead of more than 10?

-Arijit

zainabae commented 7 months ago

I suspect there might be an issue with 1-2 samples. To confirm, could you please check if you're obtaining CNV results for individual samples?

Additionally, have you examined this with 2-3 samples instead of more than 10?

-Arijit

Thank you for your response. I followed your suggestion and realized the issue was because I performed the steps for each group of samples separately before combining them. I resolved it by running all samples together.