示例#1
0
文件: rldecode.py 项目: nhoffman/bioy
def action(args):
    # Ignore SIGPIPE, for head support
    utils.exit_on_sigpipe()
    utils.exit_on_sigint()

    rledict = {seqname: rle for seqname, rle in csv.reader(args.rle)}
    seqs = ((s, from_ascii(rledict[s.id])) for s in args.seqs)

    pool = Pool(processes=args.threads)
    seqs = pool.imap(seq_and_homodecode, seqs, chunksize=140)

    for seq, decoded in seqs:
        args.outfile.write('>{}\n{}\n'.format(seq.description, decoded))
示例#2
0
文件: rldecode.py 项目: crosenth/bioy
def action(args):
    # Ignore SIGPIPE, for head support
    utils.exit_on_sigpipe()
    utils.exit_on_sigint()

    rledict = {seqname: rle for seqname, rle in csv.reader(args.rle)}
    seqs = ((s, from_ascii(rledict[s.id])) for s in args.seqs)

    pool = Pool(processes=args.threads)
    seqs = pool.imap(seq_and_homodecode, seqs, chunksize=140)

    for seq, decoded in seqs:
        args.outfile.write('>{}\n{}\n'.format(seq.description, decoded))
示例#3
0
文件: rlencode.py 项目: crosenth/bioy
def action(args):
    # Ignore SIGPIPE, for head support
    utils.exit_on_sigpipe()
    utils.exit_on_sigint()

    pool = Pool(processes=args.threads)

    seqs = imap(fastalite, args.infiles)
    seqs = chain.from_iterable(seqs)
    seqs = pool.imap(seq_and_homoencode, seqs, chunksize=40)

    for seq, (seqstr, count) in seqs:
        assert len(seqstr) == len(count)

        args.outfile.write('>{}\n{}\n'.format(seq.description, seqstr))

        if args.rlefile:
            args.rlefile.writerow(dict(name=seq.id, rle=to_ascii(count)))
示例#4
0
文件: rlencode.py 项目: nhoffman/bioy
def action(args):
    # Ignore SIGPIPE, for head support
    utils.exit_on_sigpipe()
    utils.exit_on_sigint()

    pool = Pool(processes=args.threads)

    seqs = imap(fastalite, args.infiles)
    seqs = chain.from_iterable(seqs)
    seqs = pool.imap(seq_and_homoencode, seqs, chunksize=40)

    for seq, (seqstr, count) in seqs:
        assert len(seqstr) == len(count)

        args.outfile.write('>{}\n{}\n'.format(seq.description, seqstr))

        if args.rlefile:
            args.rlefile.writerow(dict(name=seq.id, rle=to_ascii(count)))