olgert denas avatar olgert denas committed 9570efa

BED4 output (bnMapper) had a problem

Comments (0)

Files changed (3)

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
 
+
Add a comment to this file

lib/bx/align/epo_tests.pyc

Binary file modified.

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:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.