Unconfigured Ad

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

    #1

    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
              Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
              by SEQadmin2



              Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

              Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
              ...
              10-14-2026, 09:55 AM
            • SEQadmin2
              New Genomics Technologies Take Aim at Long-Standing Limits
              by SEQadmin2


              Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

              We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
              ...
              09-28-2026, 10:25 AM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by SEQadmin2, Yesterday, 11:13 AM
            0 responses
            19 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, Yesterday, 10:48 AM
            0 responses
            18 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 10-15-2026, 10:52 AM
            0 responses
            36 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 10-14-2026, 05:39 AM
            0 responses
            42 views
            0 reactions
            Last Post SEQadmin2  
            Working...