diff BSseeker2/bs_seeker2-call_methylation.py @ 1:8b26adf64adc draft default tip

V2.0.5
author weilong-guo
date Tue, 05 Nov 2013 01:55:39 -0500
parents e6df770c0e58
children
line wrap: on
line diff
--- a/BSseeker2/bs_seeker2-call_methylation.py	Fri Jul 12 18:47:28 2013 -0400
+++ b/BSseeker2/bs_seeker2-call_methylation.py	Tue Nov 05 01:55:39 2013 -0500
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 from optparse import OptionParser, OptionGroup
 from bs_utils.utils import *
@@ -71,7 +71,7 @@
 
     # if no options were given by the user, print help and exit
     if len(sys.argv) == 1:
-        print parser.print_help()
+        parser.print_help()
         exit(0)
 
     if options.version :
@@ -133,8 +133,6 @@
         nuc, context, subcontext = context_calling(chrom_seq, col.pos)
         total_reads = 0
 
-
-
         for pr in col.pileups:
         #     print pr
              if (not pr.indel) : # skip indels
@@ -152,7 +150,6 @@
                     print 'WARNING: read %s has an invalid alignment. Discarding.. ' % pr.alignment.qname
                     continue
                 read_nuc = pr.alignment.seq[pr.qpos]
-         #       print "read_nuc=", read_nuc
                 if pr.alignment.is_reverse:
                     ATCG_rev[read_nuc] += 1
                 else:
@@ -194,7 +191,8 @@
                 wiggle.write('%d\t%f\n' % (pos, meth_level))
             else :
                 wiggle.write('%d\t-%f\n' % (pos, meth_level))
-            CGmap.write('%(chrom)s\t%(nuc)s\t%(pos)d\t%(context)s\t%(subcontext)s\t%(meth_level_string)s\t%(meth_cytosines)s\t%(all_cytosines)s\n' % locals())
+
+        CGmap.write('%(chrom)s\t%(nuc)s\t%(pos)d\t%(context)s\t%(subcontext)s\t%(meth_level_string)s\t%(meth_cytosines)s\t%(all_cytosines)s\n' % locals())
     ATCGmap.close()
     CGmap.close()
     wiggle.close()