CONTRA baseline ZeroDivisionError: float division by zero
0
0
Entering edit mode
7.5 years ago

I have this error in using baseline.py in contra :

bio-info@ANG-BIO-INF-NGS:~/Documents/Thanina/CONTRA/test_standart$ /home/bio-info/Documents/Thanina/CONTRA/CONTRA.v2.0.8/baseline.py --target annotationTumeurs_Solides.bed --files IonXpress_072_Tumeurs-solides-28-04-2017_17-02174-TT.bam IonXpress_073_Tumeurs-solides_17-02176-TT.bam IonXpress_074_Tumeurs-solides-28-04-2017_17-02240-TT.bam IonXpress_075_Tumeurs-solides-28-04-2017_17-02241-TT.bam IonXpress_076_Tumeurs-solides-28-04-2017_17-02242-TT.bam IonXpress_077_Tumeurs-solides-28-04-2017_17-02243-TM.bam --output baseline/ --name baseline_test


 ------ baseline.py ------- 
Target: annotationTumeurs_Solides.bed
File: IonXpress_072_Tumeurs-solides-28-04-2017_17-02174-TT.bam
File: IonXpress_073_Tumeurs-solides_17-02176-TT.bam
File: IonXpress_074_Tumeurs-solides-28-04-2017_17-02240-TT.bam
File: IonXpress_075_Tumeurs-solides-28-04-2017_17-02241-TT.bam
File: IonXpress_076_Tumeurs-solides-28-04-2017_17-02242-TT.bam
File: IonXpress_077_Tumeurs-solides-28-04-2017_17-02243-TM.bam
Output Directory:  baseline/
 ----- creating output directory -----
baseline/
baseline/buf
----- Processing Files -----
baseline/buf/IonXpress_072_Tumeurs-solides-28-04-2017_17-02174-TT.bam
baseline/buf/IonXpress_075_Tumeurs-solides-28-04-2017_17-02241-TT.bam
baseline/buf/IonXpress_073_Tumeurs-solides_17-02176-TT.bam
baseline/buf/IonXpress_074_Tumeurs-solides-28-04-2017_17-02240-TT.bam
baseline/buf/IonXpress_076_Tumeurs-solides-28-04-2017_17-02242-TT.bam
chr1
chr10
WARNING: baseline/buf/IonXpress_073_Tumeurs-solides_17-02176-TT.bam/chr/chr10.txt NOT FOUND (should be generated by splitByChromosome3). Likely due to no reads found in a targeted chromosome (chr10), in turn likely due to currupted bam files
chr11
WARNING: baseline/buf/IonXpress_073_Tumeurs-solides_17-02176-TT.bam/chr/chr11.txt NOT FOUND (should be generated by splitByChromosome3). Likely due to no reads found in a targeted chromosome (chr11), in turn likely due to currupted bam files
chr12
WARNING: baseline/buf/IonXpress_073_Tumeurs-solides_17-02176-TT.bam/chr/chr12.txt NOT FOUND (should be generated by splitByChromosome3). Likely due to no reads found in a targeted chromosome (chr12), in turn likely due to currupted bam files
chr14
WARNING: baseline/buf/IonXpress_073_Tumeurs-solides_17-02176-TT.bam/chr/chr14.txt NOT FOUND (should be generated by splitByChromosome3). Likely due to no reads found in a targeted chromosome (chr14), in turn likely due to currupted bam files
chr15
WARNING: baseline/buf/IonXpress_073_Tumeurs-solides_17-02176-TT.bam/chr/chr15.txt NOT FOUND (should be generated by splitByChromosome3). Likely due to no reads found in a targeted chromosome (chr15), in turn likely due to currupted bam files
chr17
WARNING: baseline/buf/IonXpress_073_Tumeurs-solides_17-02176-TT.bam/chr/chr17.txt NOT FOUND (should be generated by splitByChromosome3). Likely due to no reads found in a targeted chromosome (chr17), in turn likely due to currupted bam files
chr2
WARNING: baseline/buf/IonXpress_073_Tumeurs-solides_17-02176-TT.bam/chr/chr2.txt NOT FOUND (should be generated by splitByChromosome3). Likely due to no reads found in a targeted chromosome (chr2), in turn likely due to currupted bam files
chr3
WARNING: baseline/buf/IonXpress_073_Tumeurs-solides_17-02176-TT.bam/chr/chr3.txt NOT FOUND (should be generated by splitByChromosome3). Likely due to no reads found in a targeted chromosome (chr3), in turn likely due to currupted bam files
chr4
WARNING: baseline/buf/IonXpress_073_Tumeurs-solides_17-02176-TT.bam/chr/chr4.txt NOT FOUND (should be generated by splitByChromosome3). Likely due to no reads found in a targeted chromosome (chr4), in turn likely due to currupted bam files
chr6
WARNING: baseline/buf/IonXpress_073_Tumeurs-solides_17-02176-TT.bam/chr/chr6.txt NOT FOUND (should be generated by splitByChromosome3). Likely due to no reads found in a targeted chromosome (chr6), in turn likely due to currupted bam files
chr7
WARNING: baseline/buf/IonXpress_073_Tumeurs-solides_17-02176-TT.bam/chr/chr7.txt NOT FOUND (should be generated by splitByChromosome3). Likely due to no reads found in a targeted chromosome (chr7), in turn likely due to currupted bam files
baseline/buf/IonXpress_077_Tumeurs-solides-28-04-2017_17-02243-TM.bam
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
chr1
chr10
WARNING: baseline/buf/IonXpress_077_Tumeurs-solides-28-04-2017_17-02243-TM.bam/chr/chr10.txt NOT FOUND (should be generated by splitByChromosome3). Likely due to no reads found in a targeted chromosome (chr10), in turn likely due to currupted bam files
chr11
WARNING: baseline/buf/IonXpress_077_Tumeurs-solides-28-04-2017_17-02243-TM.bam/chr/chr11.txt NOT FOUND (should be generated by splitByChromosome3). Likely due to no reads found in a targeted chromosome (chr11), in turn likely due to currupted bam files
chr12
WARNING: baseline/buf/IonXpress_077_Tumeurs-solides-28-04-2017_17-02243-TM.bam/chr/chr12.txt NOT FOUND (should be generated by splitByChromosome3). Likely due to no reads found in a targeted chromosome (chr12), in turn likely due to currupted bam files
chr14
WARNING: baseline/buf/IonXpress_077_Tumeurs-solides-28-04-2017_17-02243-TM.bam/chr/chr14.txt NOT FOUND (should be generated by splitByChromosome3). Likely due to no reads found in a targeted chromosome (chr14), in turn likely due to currupted bam files
chr15
WARNING: baseline/buf/IonXpress_077_Tumeurs-solides-28-04-2017_17-02243-TM.bam/chr/chr15.txt NOT FOUND (should be generated by splitByChromosome3). Likely due to no reads found in a targeted chromosome (chr15), in turn likely due to currupted bam files
chr17
WARNING: baseline/buf/IonXpress_077_Tumeurs-solides-28-04-2017_17-02243-TM.bam/chr/chr17.txt NOT FOUND (should be generated by splitByChromosome3). Likely due to no reads found in a targeted chromosome (chr17), in turn likely due to currupted bam files
chr2
WARNING: baseline/buf/IonXpress_077_Tumeurs-solides-28-04-2017_17-02243-TM.bam/chr/chr2.txt NOT FOUND (should be generated by splitByChromosome3). Likely due to no reads found in a targeted chromosome (chr2), in turn likely due to currupted bam files
chr3
WARNING: baseline/buf/IonXpress_077_Tumeurs-solides-28-04-2017_17-02243-TM.bam/chr/chr3.txt NOT FOUND (should be generated by splitByChromosome3). Likely due to no reads found in a targeted chromosome (chr3), in turn likely due to currupted bam files
chr4
WARNING: baseline/buf/IonXpress_077_Tumeurs-solides-28-04-2017_17-02243-TM.bam/chr/chr4.txt NOT FOUND (should be generated by splitByChromosome3). Likely due to no reads found in a targeted chromosome (chr4), in turn likely due to currupted bam files
chr6
WARNING: baseline/buf/IonXpress_077_Tumeurs-solides-28-04-2017_17-02243-TM.bam/chr/chr6.txt NOT FOUND (should be generated by splitByChromosome3). Likely due to no reads found in a targeted chromosome (chr6), in turn likely due to currupted bam files
chr7
WARNING: baseline/buf/IonXpress_077_Tumeurs-solides-28-04-2017_17-02243-TM.bam/chr/chr7.txt NOT FOUND (should be generated by splitByChromosome3). Likely due to no reads found in a targeted chromosome (chr7), in turn likely due to currupted bam files
chr1
chr10
chr11
chr12
chr14
chr15
chr17
chr2
chr3
chr4
chr6
chr7
chr1
chr10
chr11
chr12
chr14
chr15
chr17
chr2
chr3
chr4
chr6
chr7
chr1
chr10
chr11
chr12
chr14
chr15
chr17
chr2
chr3
chr4
chr6
chr7
chr1
chr10
chr11
chr12
chr14
chr15
chr17
chr2
chr3
chr4
chr6
chr7
['unionBedGraphs', '-header', '-i', 'baseline/buf/IonXpress_076_Tumeurs-solides-28-04-2017_17-02242-TT.bam.BEDGRAPH.TARGETONLY', 'baseline/buf/IonXpress_074_Tumeurs-solides-28-04-2017_17-02240-TT.bam.BEDGRAPH.TARGETONLY', 'baseline/buf/IonXpress_075_Tumeurs-solides-28-04-2017_17-02241-TT.bam.BEDGRAPH.TARGETONLY', 'baseline/buf/IonXpress_077_Tumeurs-solides-28-04-2017_17-02243-TM.bam.BEDGRAPH.TARGETONLY', 'baseline/buf/IonXpress_072_Tumeurs-solides-28-04-2017_17-02174-TT.bam.BEDGRAPH.TARGETONLY', 'baseline/buf/IonXpress_073_Tumeurs-solides_17-02176-TT.bam.BEDGRAPH.TARGETONLY', '-names', 'IonXpress_076_Tumeurs-solides-28-04-2017_17-02242-TT.bam.BEDGRAPH.TARGETONLY', 'IonXpress_074_Tumeurs-solides-28-04-2017_17-02240-TT.bam.BEDGRAPH.TARGETONLY', 'IonXpress_075_Tumeurs-solides-28-04-2017_17-02241-TT.bam.BEDGRAPH.TARGETONLY', 'IonXpress_077_Tumeurs-solides-28-04-2017_17-02243-TM.bam.BEDGRAPH.TARGETONLY', 'IonXpress_072_Tumeurs-solides-28-04-2017_17-02174-TT.bam.BEDGRAPH.TARGETONLY', 'IonXpress_073_Tumeurs-solides_17-02176-TT.bam.BEDGRAPH.TARGETONLY']
Traceback (most recent call last):
  File "/home/bio-info/Documents/Thanina/CONTRA/CONTRA.v2.0.8/baseline.py", line 231, in <module>
    xs = [float(xs_tmp[i])*Ns_gmean/Ns[i] for i in range(len(xs_tmp))]

> ZeroDivisionError: float division by zero

Help please!! thank you

CONTRA baseline • 1.8k views
ADD COMMENT
0
Entering edit mode

I added code markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:

101010 Button

What are the chromosome identifiers in your bamfile? Check with samtools idxstats, and make sure they are the same as those used in your bed file.

ADD REPLY
0
Entering edit mode

It is an old question, but I also have a similar problem. Did you solve it? May I ask how did you solve this problem? It looks that reference fasta file and bam file have different chromosome notation.

ADD REPLY

Login before adding your answer.

Traffic: 1709 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6