abyzovlab / CNVpytor

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

ZeroDivisionError: float division by zero #96

Open Badr202 opened 2 years ago

Badr202 commented 2 years ago

I run cnvpytor to show circular plot as follows:

cnvpytor -root file.pytor -rd sample.bam cnvpytor -root file.pytor -his 100000

I got the following result: Traceback (most recent call last): File "/home/u1/.local/lib/python3.8/site-packages/cnvpytor/viewer.py", line 508, in prompt self.parse(f + [str(self.bin_size)]) File "/home/u1/.local/lib/python3.8/site-packages/cnvpytor/viewer.py", line 384, in parse self.circular() File "/home/u1/.local/lib/python3.8/site-packages/cnvpytor/viewer.py", line 2652, in circular dt = 2.0 * np.pi / plot_len ZeroDivisionError: float division by zero

For info about file.pytor, I run the command >cnvpytor -root filename.pytor -ls :

Filename 'file.pytor'

File created: 2022-02-13 09:05 using CNVpytor ver 1.2

Chromosomes with RD signal: chrM, chr1, chr2, chr3, chr4, chr5, chr6, chr7, chr8, chr9, chr10, chr11, chr12, chr13, chr14, chr15, chr16, chr17, chr18, chr19, chr20, chr21, chr22, chrX, chrY, chr1_gl000191_random, chr1_gl000192_random, chr4_ctg9_hap1, chr4_gl000193_random, chr4_gl000194_random, chr6_apd_hap1, chr6_cox_hap2, chr6_dbb_hap3, chr6_mann_hap4, chr6_mcf_hap5, chr6_qbl_hap6, chr6_ssto_hap7, chr7_gl000195_random, chr8_gl000196_random, chr8_gl000197_random, chr9_gl000198_random, chr9_gl000199_random, chr9_gl000200_random, chr9_gl000201_random, chr11_gl000202_random, chr17_ctg5_hap1, chr17_gl000203_random, chr17_gl000204_random, chr17_gl000205_random, chr17_gl000206_random, chr18_gl000207_random, chr19_gl000208_random, chr19_gl000209_random, chr21_gl000210_random, chrUn_gl000211, chrUn_gl000212, chrUn_gl000213, chrUn_gl000214, chrUn_gl000215, chrUn_gl000216, chrUn_gl000217, chrUn_gl000218, chrUn_gl000219, chrUn_gl000220, chrUn_gl000221, chrUn_gl000222, chrUn_gl000223, chrUn_gl000224, chrUn_gl000225, chrUn_gl000226, chrUn_gl000227, chrUn_gl000228, chrUn_gl000229, chrUn_gl000230, chrUn_gl000231, chrUn_gl000232, chrUn_gl000233, chrUn_gl000234, chrUn_gl000235, chrUn_gl000236, chrUn_gl000237, chrUn_gl000238, chrUn_gl000239, chrUn_gl000240, chrUn_gl000241, chrUn_gl000242, chrUn_gl000243, chrUn_gl000244, chrUn_gl000245, chrUn_gl000246, chrUn_gl000247, chrUn_gl000248, chrUn_gl000249

Chromosomes with SNP signal:

Using reference genome: hg19 [ GC: yes, mask: yes ]

Chromosomes with RD histograms [bin sizes]: chr10, chr11, chr12, chr13, chr14, chr15, chr16, chr17, chr18, chr19, chr1, chr20, chr21, chr22, chr2, chr3, chr4, chr5, chr6, chr7, chr8, chr9, chrM, chrX, chrY [1000, 10000, 100000]

Chromosomes with SNP histograms [bin sizes]: []

Chromosome lengths: {'chrM': '16571', 'chr1': '249250621', 'chr2': '243199373', 'chr3': '198022430', 'chr4': '191154276', 'chr5': '180915260', 'chr6': '171115067', 'chr7': '159138663', 'chr8': '146364022', 'chr9': '141213431', 'chr10': '135534747', 'chr11': '135006516', 'chr12': '133851895', 'chr13': '115169878', 'chr14': '107349540', 'chr15': '102531392', 'chr16': '90354753', 'chr17': '81195210', 'chr18': '78077248', 'chr19': '59128983', 'chr20': '63025520', 'chr21': '48129895', 'chr22': '51304566', 'chrX': '155270560', 'chrY': '59373566', 'chr1_gl000191_random': '106433', 'chr1_gl000192_random': '547496', 'chr4_ctg9_hap1': '590426', 'chr4_gl000193_random': '189789', 'chr4_gl000194_random': '191469', 'chr6_apd_hap1': '4622290', 'chr6_cox_hap2': '4795371', 'chr6_dbb_hap3': '4610396', 'chr6_mann_hap4': '4683263', 'chr6_mcf_hap5': '4833398', 'chr6_qbl_hap6': '4611984', 'chr6_ssto_hap7': '4928567', 'chr7_gl000195_random': '182896', 'chr8_gl000196_random': '38914', 'chr8_gl000197_random': '37175', 'chr9_gl000198_random': '90085', 'chr9_gl000199_random': '169874', 'chr9_gl000200_random': '187035', 'chr9_gl000201_random': '36148', 'chr11_gl000202_random': '40103', 'chr17_ctg5_hap1': '1680828', 'chr17_gl000203_random': '37498', 'chr17_gl000204_random': '81310', 'chr17_gl000205_random': '174588', 'chr17_gl000206_random': '41001', 'chr18_gl000207_random': '4262', 'chr19_gl000208_random': '92689', 'chr19_gl000209_random': '159169', 'chr21_gl000210_random': '27682', 'chrUn_gl000211': '166566', 'chrUn_gl000212': '186858', 'chrUn_gl000213': '164239', 'chrUn_gl000214': '137718', 'chrUn_gl000215': '172545', 'chrUn_gl000216': '172294', 'chrUn_gl000217': '172149', 'chrUn_gl000218': '161147', 'chrUn_gl000219': '179198', 'chrUn_gl000220': '161802', 'chrUn_gl000221': '155397', 'chrUn_gl000222': '186861', 'chrUn_gl000223': '180455', 'chrUn_gl000224': '179693', 'chrUn_gl000225': '211173', 'chrUn_gl000226': '15008', 'chrUn_gl000227': '128374', 'chrUn_gl000228': '129120', 'chrUn_gl000229': '19913', 'chrUn_gl000230': '43691', 'chrUn_gl000231': '27386', 'chrUn_gl000232': '40652', 'chrUn_gl000233': '45941', 'chrUn_gl000234': '40531', 'chrUn_gl000235': '34474', 'chrUn_gl000236': '41934', 'chrUn_gl000237': '45867', 'chrUn_gl000238': '39939', 'chrUn_gl000239': '33824', 'chrUn_gl000240': '41933', 'chrUn_gl000241': '42152', 'chrUn_gl000242': '43523', 'chrUn_gl000243': '43341', 'chrUn_gl000244': '39929', 'chrUn_gl000245': '36651', 'chrUn_gl000246': '38154', 'chrUn_gl000247': '36422', 'chrUn_gl000248': '39786', 'chrUn_gl000249': '38502'}

Badr202 commented 2 years ago

FYI, I didn't run the command to import BAF:

cnvpytor -root sample.pytor -snp sample.vcf.gz cnvpytor -root sample.pytor -mask_snps cnvpytor -root sample.pytor -baf 100000

suvakov commented 2 years ago

Is it working now? Thanks.

Badr202 commented 2 years ago

No

suvakov commented 2 years ago

SNP data is requirement for circular plot. Please follow example. VCF file should contain SNPs with AD, GT tags.

Badr202 commented 2 years ago

Hi suvakov, Thank you for your help. I added AD and GT tags and still it is not working

suvakov commented 2 years ago

Is it the same error now. Can you please copy here output of -ls after -snp and -baf steps. Also it can be useful if you copy output of -snp command with -v d (debug log messages). Thanks.

Badr202 commented 2 years ago

Yes, still the same error.

1- After running the command > cnvpytor -root file.pytor -snp file.vcf. I got the following results: 2022-03-28 06:42:00,892 - cnvpytor.vcf - INFO - File: file3_37.vcf successfully open 2022-03-28 06:42:00,893 - cnvpytor.vcf - INFO - Chromosome 'chrM' read. Number of variants to store: 0. 2022-03-28 06:42:01,244 - cnvpytor.vcf - INFO - Chromosome 'chr1' read. Number of variants to store: 0. 2022-03-28 06:42:01,568 - cnvpytor.vcf - INFO - Chromosome 'chr2' read. Number of variants to store: 0. 2022-03-28 06:42:01,821 - cnvpytor.vcf - INFO - Chromosome 'chr3' read. Number of variants to store: 0. 2022-03-28 06:42:02,068 - cnvpytor.vcf - INFO - Chromosome 'chr4' read. Number of variants to store: 0. 2022-03-28 06:42:02,290 - cnvpytor.vcf - INFO - Chromosome 'chr5' read. Number of variants to store: 0. 2022-03-28 06:42:02,509 - cnvpytor.vcf - INFO - Chromosome 'chr6' read. Number of variants to store: 0. 2022-03-28 06:42:02,724 - cnvpytor.vcf - INFO - Chromosome 'chr7' read. Number of variants to store: 0. 2022-03-28 06:42:02,912 - cnvpytor.vcf - INFO - Chromosome 'chr8' read. Number of variants to store: 0. 2022-03-28 06:42:03,086 - cnvpytor.vcf - INFO - Chromosome 'chr9' read. Number of variants to store: 0. 2022-03-28 06:42:03,293 - cnvpytor.vcf - INFO - Chromosome 'chr10' read. Number of variants to store: 0. 2022-03-28 06:42:03,698 - cnvpytor.vcf - INFO - Chromosome 'chr11' read. Number of variants to store: 0. 2022-03-28 06:42:04,037 - cnvpytor.vcf - INFO - Chromosome 'chr12' read. Number of variants to store: 0. 2022-03-28 06:42:04,341 - cnvpytor.vcf - INFO - Chromosome 'chr13' read. Number of variants to store: 0. 2022-03-28 06:42:04,465 - cnvpytor.vcf - INFO - Chromosome 'chr14' read. Number of variants to store: 0. 2022-03-28 06:42:04,595 - cnvpytor.vcf - INFO - Chromosome 'chr15' read. Number of variants to store: 0. 2022-03-28 06:42:04,734 - cnvpytor.vcf - INFO - Chromosome 'chr16' read. Number of variants to store: 0. 2022-03-28 06:42:04,881 - cnvpytor.vcf - INFO - Chromosome 'chr17' read. Number of variants to store: 0. 2022-03-28 06:42:04,987 - cnvpytor.vcf - INFO - Chromosome 'chr18' read. Number of variants to store: 0. 2022-03-28 06:42:05,120 - cnvpytor.vcf - INFO - Chromosome 'chr19' read. Number of variants to store: 0. 2022-03-28 06:42:05,214 - cnvpytor.vcf - INFO - Chromosome 'chr20' read. Number of variants to store: 0. 2022-03-28 06:42:05,281 - cnvpytor.vcf - INFO - Chromosome 'chr21' read. Number of variants to store: 0. 2022-03-28 06:42:05,348 - cnvpytor.vcf - INFO - Chromosome 'chr22' read. Number of variants to store: 0. 2022-03-28 06:42:05,466 - cnvpytor.vcf - INFO - Chromosome 'chrX' read. Number of variants to store: 0.

2- I got no result after running the command > cnvpytor -root file.pytor -baf 100000

3- Here a part of result after running the command > cnvpytor -root file.pytor -snp filevcf -v d : 2022-03-28 06:49:28,213 - cnvpytor.vcf - DEBUG - Header samples: NIST7086 2022-03-28 06:49:28,213 - cnvpytor.vcf - INFO - Chromosome 'chrM' read. Number of variants to store: 0. 2022-03-28 06:49:28,213 - cnvpytor.vcf - DEBUG - Variants filter field statistics: 2022-03-28 06:49:28,213 - cnvpytor.vcf - DEBUG - 'No filter (.)' : 39 2022-03-28 06:49:28,611 - cnvpytor.vcf - INFO - Chromosome 'chr1' read. Number of variants to store: 0. 2022-03-28 06:49:28,611 - cnvpytor.vcf - DEBUG - Variants filter field statistics: 2022-03-28 06:49:28,611 - cnvpytor.vcf - DEBUG - 'No filter (.)' : 48118 2022-03-28 06:49:28,980 - cnvpytor.vcf - INFO - Chromosome 'chr2' read. Number of variants to store: 0. 2022-03-28 06:49:28,980 - cnvpytor.vcf - DEBUG - Variants filter field statistics: 2022-03-28 06:49:28,980 - cnvpytor.vcf - DEBUG - 'No filter (.)' : 45007 2022-03-28 06:49:29,263 - cnvpytor.vcf - INFO - Chromosome 'chr3' read. Number of variants to store: 0. 2022-03-28 06:49:29,264 - cnvpytor.vcf - DEBUG - Variants filter field statistics: 2022-03-28 06:49:29,264 - cnvpytor.vcf - DEBUG - 'No filter (.)' : 34735 2022-03-28 06:49:29,550 - cnvpytor.vcf - INFO - Chromosome 'chr4' read. Number of variants to store: 0. 2022-03-28 06:49:29,550 - cnvpytor.vcf - DEBUG - Variants filter field statistics: 2022-03-28 06:49:29,550 - cnvpytor.vcf - DEBUG - 'No filter (.)' : 34273 2022-03-28 06:49:29,800 - cnvpytor.vcf - INFO - Chromosome 'chr5' read. Number of variants to store: 0. 2022-03-28 06:49:29,800 - cnvpytor.vcf - DEBUG - Variants filter field statistics: 2022-03-28 06:49:29,800 - cnvpytor.vcf - DEBUG - 'No filter (.)' : 31065 2022-03-28 06:49:30,046 - cnvpytor.vcf - INFO - Chromosome 'chr6' read. Number of variants to store: 0. 2022-03-28 06:49:30,047 - cnvpytor.vcf - DEBUG - Variants filter field statistics: 2022-03-28 06:49:30,047 - cnvpytor.vcf - DEBUG - 'No filter (.)' : 30278 2022-03-28 06:49:30,290 - cnvpytor.vcf - INFO - Chromosome 'chr7' read. Number of variants to store: 0. 2022-03-28 06:49:30,290 - cnvpytor.vcf - DEBUG - Variants filter field statistics: 2022-03-28 06:49:30,290 - cnvpytor.vcf - DEBUG - 'No filter (.)' : 29824 2022-03-28 06:49:30,504 - cnvpytor.vcf - INFO - Chromosome 'chr8' read. Number of variants to store: 0. 2022-03-28 06:49:30,504 - cnvpytor.vcf - DEBUG - Variants filter field statistics: 2022-03-28 06:49:30,504 - cnvpytor.vcf - DEBUG - * 'No filter (.)' : 26398

Is this what you want?. Thanks in advance