Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • atongo77
    Junior Member
    • Sep 2014
    • 4

    methylation ratio Error

    Hello folks,

    I was using the script "methratio.py" from BSMAP to extract methylation frequencies on reads from bisulphite sequencing. I have been getting this error message on some specific chromosomes. I am using a reference genome of mm9.fa.


    Traceback (most recent call last):
    File "methratio.py", line 253, in <module>
    disp('total %d valid mappings, %d covered cytosines, average coverage: %.2f fold.' % (nmap, nc, float(nd)/nc))
    ZeroDivisionError: float division by zero

    I would appreciate it if someone can help me figure out what might be going on.

    Thanks.
  • dpryan
    Devon Ryan
    • Jul 2011
    • 3478

    #2
    Can you show the exact command used (and perhaps the first 2 or so alignments in your BAM file)? This should only ever happen if you have no covered cytosines, which would seem rather unlikely.

    BTW, keep in mind that there are innate problems with using BSMAP's output, since you can't filter by quality. Having said that, since bsmap is much faster than anything else out there I can't really fault you for using it

    Comment

    • atongo77
      Junior Member
      • Sep 2014
      • 4

      #3
      @dpryan

      Hello dpryan,

      Thank you very much for your response. This is the command I issued:

      > python methratio.py --ref=mm9.fa --out=brain_control_chr9.txt --chr=chr9 --context=CG --zero-meth *.bam

      The "bam" files were about 5 in all. also used the "samtools" to issue this command on one of the bm files:

      >samtools view 2_SRR955122*.bam | head

      And this is what I got:

      SRR955121-NP070.2 0 chr2 263592509 255 36M * 0 0 CTCTGCCTGCCTCCCCTCTTGNGAATCTTGCAGGCT ggggggggggggggggceggdGddda_a__gegfgd NM:i:0 ZS:Z:++
      SRR955121-NP070.3 0 chr14 60374539 255 36M * 0 0 GGAAGGACGCGCACACCTGCANTCGTATGTGTACAC ffggggdggggggggfggcfbF^aaSSVVSdfdffa NM:i:0 ZS:Z:++
      SRR955121-NP070.5 16 chr1 187870119 255 36M * 0 0 TGTGAATTCAGTTANTTCCCAGTAGCCTATTCTTGT ggcgggaaaa^aa^Eagagggggggggdcggggggg NM:i:1 ZS:Z:-+
      SRR955121-NP070.6 16 chr11 35334197 255 36M * 0 0 CATGGAGGCGATAAGCGATCCGAACATCAGCATGAA ffcfd]ffcaddaffffdfffffaffffafcfddfd NM:i:0 ZS:Z:-+
      SRR955121-NP070.13 16 chr2 20010899 255 36M * 0 0 TCGTAAGAACTCACGCTCTTCTAAGAAAGGGAGGTA dgggcgffffffffffedcggfffdfagggdggggg NM:i:0 ZS:Z:-+
      SRR955121-NP070.16 0 chr2 226862985 255 36M * 0 0 TGTGGTGCAATTCCAGCGGTGATGACGGAACTGGTG eae`dfcdfc`aaaaf_cfff_acfff\fdeSce]f NM:i:0 ZS:Z:++
      SRR955121-NP070.17 16 chr16 41229004 255 36M * 0 0 CCCATTGAGCATTTCTATGTAGGTAGTTTAAGGCCC a^S]aaYU\WNYYUYPL]JXU[U\QQcccc\cccc_ NM:i:0 ZS:Z:-+
      SRR955121-NP070.18 0 chr15 36462077 255 36M * 0 0 CCAAGGTCCAGGGACAAACCATGGGAGAGGGAGTAA f]fffaaddda^Yacdaddd[dd\dUWIYVWT_SXf NM:i:0 ZS:Z:++
      SRR955121-NP070.19 16 chr7 117682445 255 36M * 0 0 AGTAGCCCGCAAGTTTGGAAGTAGCGCTGGGCCGCT c[\O_I^ac[aZ\\X\b^Y\acY^_a^cccccaccc NM:i:0 ZS:Z:-+
      SRR955121-NP070.22 0 chr1 187649295 255 36M * 0 0 AGCACTGTTTCTTTGAATTCAGTTAGTTCCCAGTAG gfgggggggggfgggfggggaggggggfgggggggf NM:i:0 ZS:Z:++


      I really appreciate your help. In addition, I would greatly appreciate any advice on how to be efficient and effective in this analysis. Thanks.

      Comment

      • dpryan
        Devon Ryan
        • Jul 2011
        • 3478

        #4
        Can you confirm that you have alignments on chr9? If so then I haven't a clue what the issue is (I'd have to go through the source code). You might try to contact the authors in that case.

        Comment

        • atongo77
          Junior Member
          • Sep 2014
          • 4

          #5
          Thanks dpryan. I think there are no alignments on chr9. It appears this problem crops up for all chr* for which there are no alignments. I have seen similar errors for chrX and chrY. I have sent a mail to the authors and waiting for their response. Thanks once again.

          Comment

          • atongo77
            Junior Member
            • Sep 2014
            • 4

            #6
            Hello dpryan,

            Were you able to check from the source code on what might be causing the division by zero error? Authors are yet to respond to my email. I truly appreciate your help.

            Thanks

            Comment

            Latest Articles

            Collapse

            • SEQadmin2
              Nine Things a Sample Prep Scientist Thinks About Before Sequencing
              by SEQadmin2


              I’m not a sequencing expert. I’m a purification scientist who uses NGS to evaluate workflows my group develops. With this perspective, we think about the sample first and the NGS workflow second. The sequencer is an exceptionally honest reporter, but it can only report on what you give it, so whether you get clean, interpretable data from an NGS workflow is largely determined before you begin.


              Here are nine questions we think about, in roughly the order they matter, before...
              06-18-2026, 07:11 AM
            • SEQadmin2
              From Collection to Sequencing: Why Sample Preparation and Preservation Define Sequencing Data
              by SEQadmin2


              Data variability is still an issue in sequencing technologies despite the advances in reproducibility and accuracy of these platforms. But the problem does not originate in the sequencing itself, but in the previous steps, before the sample reaches the sequencer.


              The first step is collection, followed by preservation and sample preparation for analysis. Most scientists overlook those steps, but not being careful might just be skewing the experiment’s results.
              ...
              06-02-2026, 10:05 AM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by SEQadmin2, 06-17-2026, 06:09 AM
            0 responses
            26 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 06-09-2026, 11:58 AM
            0 responses
            44 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 06-05-2026, 10:09 AM
            0 responses
            48 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 06-04-2026, 08:59 AM
            0 responses
            49 views
            0 reactions
            Last Post SEQadmin2  
            Working...