def fastaFromBed(bedfile, fastafile, name=False, tab=False, stranded=False):
    suffix = ".sfa" if tab else ".fasta"
    outfile = op.basename(bedfile).rsplit(".", 1)[0] + suffix
    cmd = "fastaFromBed -fi {0} -bed {1} -fo {2}".\
            format(fastafile, bedfile, outfile)
    if name:
        cmd += " -name"
    if tab:
        cmd += " -tab"
    if stranded:
        cmd += " -s"

    if need_update([bedfile, fastafile], outfile):
        sh(cmd, outfile=outfile)

    return outfile
dataset/ETHPy150Open tanghaibao/jcvi/formats/bed.py/fastaFromBed/original