Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List index out of range during gc correction #245

Open
RSchwieger opened this issue Nov 15, 2024 · 1 comment
Open

List index out of range during gc correction #245

RSchwieger opened this issue Nov 15, 2024 · 1 comment

Comments

@RSchwieger
Copy link

RSchwieger commented Nov 15, 2024

I am facing an issue with the GC correction. I created the gc-file using the instructions to create a gc-file and provided the file in ref_genome_conf.py.

When running the following command

cnvpytor -conf ref_genome_conf.py -root file.pytor -his 10000 100000

I get the error message:

2024-11-15 10:23:01,081 - cnvpytor.root - INFO - Chromosome 'CM020500.1' bin size 100 stat - RD unique distribution gaussian fit:  8.39 +- 4.84
2024-11-15 10:23:01,081 - cnvpytor.root - INFO - Calculating global statistics.
2024-11-15 10:23:01,414 - cnvpytor.root - INFO - Calculating GC corrected RD histogram using bin size 100 for chromosome 'CM020439.1'.
Traceback (most recent call last):
  File "/environment4CNVpytor/.pipeline-env/bin/cnvpytor", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/environment4CNVpytor/.pipeline-env/lib/python3.12/site-packages/cnvpytor/__main__.py", line 400, in main
    app.calculate_histograms(args.his, chroms=args.chrom, gc_auto=args.gc_auto, gc_corr_rm_ol=args.gc_corr_rm_ol)
  File "/environment4CNVpytor/.pipeline-env/lib/python3.12/site-packages/cnvpytor/root.py", line 1005, in calculate_histograms
    his_p_corr = his_p / np.array(list(map(lambda x: gc_corr[int(x)], gcp_decompress(gcat, bin_ratio))))
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/environment4CNVpytor/.pipeline-env/lib/python3.12/site-packages/cnvpytor/root.py", line 1005, in <lambda>
    his_p_corr = his_p / np.array(list(map(lambda x: gc_corr[int(x)], gcp_decompress(gcat, bin_ratio))))
                                                     ~~~~~~~^^^^^^^^
IndexError: list index out of range

And the output of

cnvpytor -conf ref_genome_conf.py -root file.pytor -ls

was

Error message:

File created: 2024-11-15 10:19 using CNVpytor ver 1.3.2

Chromosomes with RD signal: CM020439.1, CM020440.1, CM020441.1, CM020442.1, CM020443.1, CM020444.1, CM020445.1, CM020446.1, CM020447.1, CM020448.1, CM020449.1, CM020450.1, CM020451.1, CM020452.1, CM020453.1, CM020454.1, CM020455.1, CM020456.1, CM020457.1, CM020458.1, CM020459.1, CM020460.1, CM020461.1, CM020463.1, CM020462.1, CM020500.1

Chromosomes with SNP signal: 

Using reference genome: bSteHir1 [ GC: yes, mask: no ]

Chromosomes with RD histograms [bin sizes]:  []

Chromosomes with SNP histograms [bin sizes]:  []
@arpanda
Copy link
Member

arpanda commented Nov 15, 2024

Hi @RSchwieger,
It seems there is an issue with your GC file or providing the path for GC file. Please ensure the following:

  • The same FASTA file was used for both the alignment and the creation of the GC file.
  • The full path to the GC file is correctly specified.

Thank you,
-Arijit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants