File: rocplot.pl

package info (click to toggle)
hmmer 3.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 37,260 kB
  • sloc: ansic: 139,162; perl: 10,213; sh: 3,344; makefile: 2,187; python: 1,110
file content (41 lines) | stat: -rwxr-xr-x 707 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#! /usr/bin/perl

$nsearches = 2809;

require "getopts.pl";
&Getopts('n:X:x:');

if ($opt_n) { $nsearches = $opt_n; }
if ($opt_X) { 
    open(EXCLUDEFILE,$opt_X) || die;
    while (<EXCLUDEFILE>) {
	if (/^\s*(\S+)/) { $nsearches--; $excluded{$1} = 1; }
    }
    close EXCLUDEFILE;
}
if ($opt_x) { $nsearches--; $excluded{$opt_x} = 1; }


$fp = 0;
$tp = 0;
while (<>)
{
    ($Eval, $bitscore, $target, $query) = split;

    if ($excluded{$query}) { next; }

    if ($target =~ /^decoy\d+$/) # a false positive
    {
	$fp++;
	printf("%.4f %d\n", $fp / $nsearches, $tp);
    }

    if ($target =~ /^$query\//)  # a true positive
    {
	$tp++;
    }

    if ($fp >= $nsearches * 10) { last; }
}

print "&\n";