Example #1
0
            ) for method in methods
        )
        auc50s = dict(
            (
                method,
                R.auc50(
                    scores[(method, fragment)],
                    scores[(method, fragment, bg)],
                    num_negative=num_negative,
                    num_points=options.num_points
                )
            ) for method in methods
        )
        aucs[bg] = dict()
        aucs[bg]['AUC'] = dict(
            (method, R.area_under_curve([roc for roc, t in roc_thresholds[method]]))
            for method in methods
        )
        aucs[bg]['AUC50'] = dict(
            (method, auc50s[method][0])
            for method in methods
        )


        # ROC curves
        P.figure()
        for method in methods:
            rocs = [roc for roc, t in roc_thresholds[method]]
            auc = aucs[bg]['AUC'][method]
            auc50 = aucs[bg]['AUC50'][method]
            R.plot_roc_points(rocs, label=method, marker=markers[method], color=colors[method])
Example #2
0
        return 'Ungapped'
    if 'GLAM2-i7' == method:
        return 'GLAM2'
    return method

for bg in backgrounds:

    # ROC curves
    P.figure()
    for method in methods:
        rocs = R.picked_rocs_from_thresholds(
            scores[(method,)],
            scores[(method, bg)],
            num_points=options.num_points
        )
        auc = R.area_under_curve(rocs)
        R.plot_roc_points(rocs, label='%.2f %s'%(auc,name(method)), marker=markers[method])
    R.plot_random_classifier(label='0.50 Random')
    R.label_plot()
    P.legend(loc='lower right')
    P.title('Full Sp1 - %s' % bg)
    P.savefig('ROC-Sp1-%s.png' % bg)
    P.savefig('ROC-Sp1-%s.eps' % bg)

    # precision-recall curves
    P.figure()
    for method in methods:
        rocs = R.picked_rocs_from_thresholds(
            scores[(method,)],
            scores[(method, bg)],
            num_points=options.num_points
Example #3
0
        roc_thresholds = dict(
            (method,
             R.create_rocs_from_thresholds(scores[(method, fragment)],
                                           scores[(method, fragment, bg)],
                                           num_points=options.num_points))
            for method in methods)
        auc50s = dict((method,
                       R.auc50(scores[(method, fragment)],
                               scores[(method, fragment, bg)],
                               num_negative=num_negative,
                               num_points=options.num_points))
                      for method in methods)
        aucs[bg] = dict()
        aucs[bg]['AUC'] = dict(
            (method,
             R.area_under_curve([roc for roc, t in roc_thresholds[method]]))
            for method in methods)
        aucs[bg]['AUC50'] = dict(
            (method, auc50s[method][0]) for method in methods)

        # ROC curves
        P.figure()
        for method in methods:
            rocs = [roc for roc, t in roc_thresholds[method]]
            auc = aucs[bg]['AUC'][method]
            auc50 = aucs[bg]['AUC50'][method]
            R.plot_roc_points(rocs,
                              label=method,
                              marker=markers[method],
                              color=colors[method])
        R.plot_random_classifier(label='Random')
Example #4
0
    if 'Ungapped-new' == method:
        return 'Ungapped'
    if 'GLAM2-i7' == method:
        return 'GLAM2'
    return method


for bg in backgrounds:

    # ROC curves
    P.figure()
    for method in methods:
        rocs = R.picked_rocs_from_thresholds(scores[(method, )],
                                             scores[(method, bg)],
                                             num_points=options.num_points)
        auc = R.area_under_curve(rocs)
        R.plot_roc_points(rocs,
                          label='%.2f %s' % (auc, name(method)),
                          marker=markers[method])
    R.plot_random_classifier(label='0.50 Random')
    R.label_plot()
    P.legend(loc='lower right')
    P.title('Full Sp1 - %s' % bg)
    P.savefig('ROC-Sp1-%s.png' % bg)
    P.savefig('ROC-Sp1-%s.eps' % bg)

    # precision-recall curves
    P.figure()
    for method in methods:
        rocs = R.picked_rocs_from_thresholds(scores[(method, )],
                                             scores[(method, bg)],