olgert denas avatar olgert denas committed 8037142

check cached chains are up to date and int chain score

Comments (0)

Files changed (2)

lib/bx/align/epo.py

     __slots__ = ()
 
     def __str__(self):
-        return "chain 0 {tName} {tSize} {tStrand} {tStart} {tEnd} {qName} {qSize} {qStrand} {qStart} {qEnd} {id}".format(**self._asdict())
+        return "chain {score} {tName} {tSize} {tStrand} {tStart} {tEnd} {qName} {qSize} {qStrand} {qStart} {qEnd} {id}".format(**self._asdict())
 
     @classmethod
     def _strfactory(cls, line):
 
         line = line.rstrip().split()[1:] # the first component is the keyword "chain"
         tup = map(lambda t: t[0](t[1]),
-                zip([float, str, int, str, int, int, str, int, str, int, int, str], line))
+                zip([int, str, int, str, int, int, str, int, str, int, int, str], line))
         return tuple.__new__(cls, tup)
 
     @classmethod
             log.debug("loading pickled file %s ..." % fname)
             return cPickle.load( open(fname) )
         elif os.path.isfile("%s.pkl" % fname):
-            log.warning("loading pickled file %s.pkl ..." % fname)
+            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))
             return cPickle.load( open("%s.pkl" % fname) )
 
         data = fastLoadChain(fname, cls._strfactory)

scripts/bnMapper.py

 from bx.align.epo import bed_union as elem_u
 
 elem_t = np.dtype([('chrom', np.str_, 30), ('start', np.int64), ('end', np.int64), ('id', np.str_, 100)])
-LOG_LEVELS = {"info" : logging.INFO, "debug" : logging.DEBUG, "silent" : logging.CRITICAL}
+LOG_LEVELS = {"info" : logging.INFO, "debug" : logging.DEBUG, "silent" : logging.ERROR}
 
 logging.basicConfig()
 log = logging.getLogger()
     parser = argparse.ArgumentParser(description=__doc__, epilog="Olgert Denas (Taylor Lab)",
             formatter_class=argparse.ArgumentDefaultsHelpFormatter)
 
-    parser.add_argument("input", nargs='*',
+    parser.add_argument("input", nargs='+',
             help="Input to process. If more than a file is specified, all files will be mapped and placed on --output, which should be a directory.")
     parser.add_argument("alignment", help="Alignment file (.chain or .pkl)")
 
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.