abyzovlab / CNVpytor

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

IndexError: index 8132 is out of bounds axis 0 with size 8132. #223

Open tokiboggle opened 1 month ago

tokiboggle commented 1 month ago

I am trying to make manhattan plots of yeast genomes. To reduce noise I have attempted to create a strict mask for the Cerevisiae Saccharomyces genome. However, when I try to calculate histograms with the mask file specified in the configuration file, I get an error saying: File "/home/tokiboggle/.local/lib/python3.10/site-packages/cnvpytor/root.py", line 962, in calculate_histograms his_p[p // bin_ratio] += rd_p[p] IndexError: index 8132 is out of bounds for axis 0 with size 8132.

Only the first chromosome is displayed in the manhattan plot, and emptiness in the others.

When I do it without the mask file being specified in the configuration file. All the chromosomes are displayed but with lots of noise.

arpanda commented 1 month ago

Could you please share the output of the '-ls' command? This will help us determine whether the reference genome is set up correctly. Additionally, could you provide details on how the mask file was created? Please note that the input to the create mask should be in the 1000 Genomes strict mask format.

Thanks Arijit

tokiboggle commented 1 day ago

I used dustmasker to create the mask file. The mask file is set up, so that passed nucleotides are written as P and not passed as N. This is what I understood to be the strict mask format, however it is probably incorrect.

I'm not sure what you mean by output of -ls command. Can you explain?

Sorry for the delayed answer Tóki

arpanda commented 1 day ago

The error appears to be related to an incorrect setup of the reference genome. Since you were able to visualize the Manhattan plot without the mask file, it suggests that your setup is correct up to that point. Therefore, the issue is likely due to an incorrect mask file, possibly originating starting from the second chromosome. I recommend comparing the chromosome lengths in the mask file with those in the reference configuration.

ls command usage: cnvpytor -root <pytor_file> -ls. it show the content of the pytor file.

-Arijit