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
              Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
              by SEQadmin2


              Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

              The systematic characterization of the human proteome has
              ...
              07-20-2026, 11:48 AM
            • SEQadmin2
              Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
              by SEQadmin2



              Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
              ...
              07-09-2026, 11:10 AM
            • SEQadmin2
              Cancer Drug Resistance: The Lingering Barrier to Rising Survival
              by SEQadmin2



              Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

              There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
              07-08-2026, 05:17 AM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by SEQadmin2, 07-24-2026, 12:17 PM
            0 responses
            31 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 07-23-2026, 11:41 AM
            0 responses
            23 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 07-20-2026, 11:10 AM
            0 responses
            214 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 07-13-2026, 10:26 AM
            0 responses
            79 views
            0 reactions
            Last Post SEQadmin2  
            Working...