def logodds(args):
    '\n    %prog logodds cnt1 cnt2\n\n    Compute log likelihood between two db.\n    '
    from math import log
    from jcvi.formats.base import DictFile
    p = OptionParser(logodds.__doc__)
    (opts, args) = p.parse_args(args)
    if (len(args) != 2):
        sys.exit((not p.print_help()))
    (cnt1, cnt2) = args
    d = DictFile(cnt2)
    fp = open(cnt1)
    for row in fp:
        (scf, c1) = row.split()
        c2 = d[scf]
        (c1, c2) = (float(c1), float(c2))
        c1 += 1
        c2 += 1
        score = int((100 * (log(c1) - log(c2))))
        print('{0}\t{1}'.format(scf, score))
%prog logodds cnt1 cnt2

Compute log likelihood between two db.
def logodds(args):
    '\n    %prog logodds cnt1 cnt2\n\n    Compute log likelihood between two db.\n    '
    from math import log
    from jcvi.formats.base import DictFile
    p = OptionParser(logodds.__doc__)
    (opts, args) = p.parse_args(args)
    if (len(args) != 2):
        sys.exit((not p.print_help()))
    (cnt1, cnt2) = args
    d = DictFile(cnt2)
    fp = open(cnt1)
    for row in fp:
        (scf, c1) = row.split()
        c2 = d[scf]
        (c1, c2) = (float(c1), float(c2))
        c1 += 1
        c2 += 1
        score = int((100 * (log(c1) - log(c2))))
        print('{0}\t{1}'.format(scf, score))