Commits

olgert denas committed 9570efa

BED4 output (bnMapper) had a problem

  • Participants
  • Parent commits 46d5d7a

Comments (0)

Files changed (3)

File lib/bx/align/epo.py

     """A Chain header as in http://genome.ucsc.edu/goldenPath/help/chain.html
 
     chain coordinates are with respect to the strand, so for example tStart on the + strand is the
-    distance from the 0th position from the left; tStart on the - strand is the distance from
-    the last position from the right."""
+    distance from the leftmost position; tStart on the - strand is the distance from the rightmost position."""
 
     __slots__ = ()
 
         :param fname: name of the file"""
 
         if fname.endswith('.pkl'):
+            #you asked for the pickled file. I'll give it to you
             log.debug("loading pickled file %s ..." % fname)
             return cPickle.load( open(fname) )
         elif os.path.isfile("%s.pkl" % fname):
+            #there is a cached version I can give to you
             log.info("loading pickled file %s.pkl ..." % fname)
             if os.stat(fname).st_mtime > os.stat("%s.pkl" % fname).st_mtime:
                 log.critical("*** pickled file %s.pkl is not up to date ***" % (fname))
                 self.end-self.start+1, d_sum)
         return d[1:] #clip the (thr, thr) entry
 
+

File lib/bx/align/epo_tests.pyc

Binary file modified.

File scripts/bnMapper.py

 """Map features from the target species to the query species of a chain alignment file.
 This is intended for mapping relatively short features such as Chip-Seq
 peaks on TF binding events. Features that get mapped on different chromosomes
-or that span multiple chains are silently filtered out."""
+or that span multiple chains are silently filtered out. TODO:
+(1)for narrowPeak input, map the predicted peak position.
+"""
 
 
 import sys, os, logging, pdb
 def transform_file(ELEMS, ofname, EPO, TREE, opt):
     "transform/map the elements of this file and dump the output on 'ofname'"
 
+    BED4_FRM = "%s\t%d\t%d\t%s\n"
     log.info("%s (%d) elements ..." % (opt.screen and "screening" or "transforming", ELEMS.shape[0]))
     with open(ofname, 'w') as out_fd:
         if opt.screen: