ribolands/barmap.py
def barmap_barriers(_bname, seq, sfiles, args):
    """ Print barriers files and mapping info """

    bfiles = []
    prog = ril.ProgressBar(args.stop - args.start + 1)
    for e, l in enumerate(range(args.start, args.stop + 1)):
        cseq = seq[0:l]
        cname = "{}-len_{:02d}".format(_bname, l)
        pname = "{}-len_{:02d}".format(_bname, l - 1)
        sfile = sfiles[e]

        if os.path.exists(pname + '.bar'):
            with open(pname + '.bar', 'r') as oldbar, \
                    open(pname + '.map', 'w') as mapfile:
                for e, line in enumerate(oldbar):
                    if e == 0:
                        continue
                    cols = line.strip().split()
                    mapfile.write(cols[1] + '.' + "\n")
            mfile = pname + '_barriers.ms'
        else:
            mfile = ''

        # Make sure the first round for mapping is always recomputed
        # force = True if e == 1 else args.force

        print('now running')
        [bfile, efile, rfile, rbfile, psfile, bmfile] = ril.sys_barriers_180(cname, sfile,
                 barriers = args.barriers,
                 minh = args.b_minh, 
                 maxn = args.b_maxn,
                 temp = args.temperature,
                 noLP = args.noLP,
                 moves = 'single-base-pair',
                 zipped = True,
                 rates = True,
                 k0 = args.k0,
                 bsize = False,
                 saddle = False,
                 bmfile = True,
                 force = args.force)

        bfiles.append([bfile, efile, rbfile, psfile, bmfile])
        prog.inc()
    return bfiles
 Print barriers files and mapping info 
Print barriers files and mapping info
Print barriers files and mapping info
def barmap_barriers(_bname, seq, sfiles, args):
    bfiles = []
    prog = ril.ProgressBar(args.stop - args.start + 1)
    for e, l in enumerate(range(args.start, args.stop + 1)):
        cseq = seq[0:l]
        cname = "{}-len_{:02d}".format(_bname, l)
        pname = "{}-len_{:02d}".format(_bname, l - 1)
        sfile = sfiles[e]
        if os.path.exists(pname + '.bar'):
            with open(pname + '.bar', 'r') as oldbar, \
                    open(pname + '.map', 'w') as mapfile:
                for e, line in enumerate(oldbar):
                    if e == 0:
                        continue
                    cols = line.strip().split()
                    mapfile.write(cols[1] + '.' + "\n")
            mfile = pname + '_barriers.ms'
        else:
            mfile = ''
        print('now running')
        [bfile, efile, rfile, rbfile, psfile, bmfile] = ril.sys_barriers_180(cname, sfile,
                 barriers = args.barriers,
                 minh = args.b_minh, 
                 maxn = args.b_maxn,
                 temp = args.temperature,
                 noLP = args.noLP,
                 moves = 'single-base-pair',
                 zipped = True,
                 rates = True,
                 k0 = args.k0,
                 bsize = False,
                 saddle = False,
                 bmfile = True,
                 force = args.force)
        bfiles.append([bfile, efile, rbfile, psfile, bmfile])
        prog.inc()
    return bfiles
def barmap_barriers ( _bname , seq , sfiles , args ) : bfiles = [ ] prog = ril . ProgressBar ( args . stop - args . start + 1 ) for e , l in enumerate ( range ( args . start , args . stop + 1 ) ) : cseq = seq [ 0 : l ] cname = "{}-len_{:02d}" . format ( _bname , l ) pname = "{}-len_{:02d}" . format ( _bname , l - 1 ) sfile = sfiles [ e ] if os . path . exists ( pname + '.bar' ) : with open ( pname + '.bar' , 'r' ) as oldbar , open ( pname + '.map' , 'w' ) as mapfile : for e , line in enumerate ( oldbar ) : if e == 0 : continue cols = line . strip ( ) . split ( ) mapfile . write ( cols [ 1 ] + '.' + "\n" ) mfile = pname + '_barriers.ms' else : mfile = '' print ( 'now running' ) [ bfile , efile , rfile , rbfile , psfile , bmfile ] = ril . sys_barriers_180 ( cname , sfile , barriers = args . barriers , minh = args . b_minh , maxn = args . b_maxn , temp = args . temperature , noLP = args . noLP , moves = 'single-base-pair' , zipped = True , rates = True , k0 = args . k0 , bsize = False , saddle = False , bmfile = True , force = args . force ) bfiles . append ( [ bfile , efile , rbfile , psfile , bmfile ] ) prog . inc ( ) return bfiles
Print barriers files and mapping info
Print barriers files and mapping info
""" Print barriers files and mapping info """ # Make sure the first round for mapping is always recomputed # force = True if e == 1 else args.force
_bname
seq
sfiles
args