def __init__(self, source, target, cmds, remove=False): self.source = listify(source) self.target = listify(target) self.cmds = listify(cmds) if remove: rm_cmd = "rm -f {0}".format(" ".join(self.target)) self.cmds = [rm_cmd] + self.cmds
def __init__(self, taxon, chr, pos, ref_allele, alt_allele, profile): self.taxon = taxon self.chr = chr self.pos = pos self.ref_nt = listify(ref_allele) self.ref_allele = listify(ref_allele) self.alt_allele = listify(alt_allele) self.update(profile)
def __init__(self, source, target, cmds, id, remove=False): self.id = id self.source = listify(source) self.target = listify(target) self.cmds = listify(cmds) if remove: rm_cmd = "rm -f {0}".format(" ".join(self.target)) self.cmds = [rm_cmd] + self.cmds
def wrapper(*args, **kwargs): assert outfile in kwargs, "You need to specify `outfile=` on function call" if infile in kwargs: infilename = listify(kwargs[infile]) for x in infilename: assert op.exists( x), "The specified infile `{0}` does not exist".format(x) outfilename = kwargs[outfile] if need_update(infilename, outfilename): return func(*args, **kwargs) else: msg = "File `{0}` exists. Computation skipped.".format(outfilename) logging.debug(msg) outfilename = listify(outfilename) for x in outfilename: assert op.exists( x), "Something went wrong, `{0}` not found".format(x) return outfilename
def wrapper(*args, **kwargs): assert outfile in kwargs, \ "You need to specify `outfile=` on function call" if infile in kwargs: infilename = listify(kwargs[infile]) for x in infilename: assert op.exists(x), \ "The specified infile `{0}` does not exist".format(x) outfilename = kwargs[outfile] if need_update(infilename, outfilename): return func(*args, **kwargs) else: msg = "File `{0}` exists. Computation skipped." \ .format(outfilename) logging.debug(msg) outfilename = listify(outfilename) for x in outfilename: assert op.exists(x), \ "Something went wrong, `{0}` not found".format(x) return outfilename
def normalize_axes(axes): axes = listify(axes) for ax in axes: ax.set_xlim(0, 1) ax.set_ylim(0, 1) ax.set_axis_off()
def __init__(self, target, args): for x in args: x = listify(x) self.append(Process(target=target, args=x))
def add(self, source, target, cmds, remove=False): self.ndeps += 1 d = Dependency(source, target, cmds, self.ndeps, remove=remove) self.append(d) self.targets |= set(listify(target))
def __init__(self, source, target, cmds): self.source = listify(source) self.target = listify(target) self.cmds = listify(cmds)