f = open(filename, 'r') for line in f: protein_id = line.strip("\n") plot_title = ("BLAST(e=" + str(evalue) + ") " + protein_id + " (" + method.fname() + ")") plot_filename = "roc_plot_" + method.name() + "_" + protein_id b = benchmark.benchmark(protein_id, golden_standard=method, search_method=benchmark.Blast(evalue, max_alignments)) b_random = benchmark.benchmark(protein_id, golden_standard=method, search_method=benchmark.RandomUniprot()) roc_plot.roc_plot(b, title=plot_title, filename=plot_filename, random=b_random) def usage(): print """This is a script that draws roc plots of using BLAST for homology search compared to a golden standard (GeneOntology, Pfam or SCOP). One filename is expected as an argument that contains a list of uniprot protein ids to use. Command line options: -n --maxalignments The number maximum number of alignments to get from SCOP. Default is 100. -e --e-value The results from blast are filtered by e-value. BLAST results with a e-value higher than this are thrown away. Default is 0.1.
from roc_plot import roc_plot from sklearn.datasets import load_breast_cancer from sklearn.model_selection import train_test_split from sklearn.tree import DecisionTreeClassifier X_train, X_test, y_train, y_test = train_test_split(*load_breast_cancer(return_X_y=True)) roc_plot( DecisionTreeClassifier, 'max_depth', [1, 2, 3, 4, 5, 9, 12, 16, 20, 25, 30, 35], X_train, y_train, X_test, y_test, fname='depth_roc.html' )