abyzovlab / CNVpytor

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

Issue with joint caller prototype (ValueError) #167

Closed lunalvan closed 1 year ago

lunalvan commented 1 year ago

Hi! I am running the joint CNV caller prototype and this error came up:


cnvpytor.root - WARNING - No bins with BAF=0.5! Using all bins for RD normalisation.
Traceback (most recent call last):
  File "/home/lalvaradoanon/.local/bin/cnvpytor", line 8, in <module>
    sys.exit(main())
  File "/home/lalvaradoanon/.local/lib/python3.6/site-packages/cnvpytor/__main__.py", line 442, in main
    omin=args.overlap_threshold, use_hom=args.use_hom, anim=args.animation)
  File "/home/lalvaradoanon/.local/lib/python3.6/site-packages/cnvpytor/root.py", line 3127, in call_2d
    dmin = np.min(data)
  File "<__array_function__ internals>", line 6, in amin
  File "/usr/local/lib64/python3.6/site-packages/numpy/core/fromnumeric.py", line 2831, in amin
    keepdims=keepdims, initial=initial, where=where)
  File "/usr/local/lib64/python3.6/site-packages/numpy/core/fromnumeric.py", line 87, in _wrapreduction
    return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
ValueError: zero-size array to reduction operation minimum which has no identity

Do you know why it may have occurred? I believe the original data files are correct, so I don't know where to check

lunalvan commented 1 year ago

For anyone that may need it, I solved this issue.

When looking into the file.pytor that was generated, I saw that "Chromosomes with SNP signal" and "Chromosomes with SNP histograms" were the only two empty fields, so I figured it must have been an error with the .vcf file.

I came across this issue (https://github.com/abyzovlab/CNVpytor/issues/127), in which they recommended checking whether or not the .vcf file had the GT and AD tags. It did, so I ruled out this option.

Then, I found these other two issues (https://github.com/abyzovlab/CNVpytor/issues/27 and https://github.com/abyzovlab/CNVpytor/issues/61), which pointed towards a problem with the FILTER column in the .vcf file.

Apparently, CNVpytor only reads variants that have PASS in that column, but not all .vcf files show this.

Long story short, I just added "-nofilter" to the -snp step of the call. It ignored the FILTER column and the analysis went well.