Skip to content

Instantly share code, notes, and snippets.

@standage
Created April 18, 2013 17:52
Show Gist options
  • Save standage/5414796 to your computer and use it in GitHub Desktop.
Save standage/5414796 to your computer and use it in GitHub Desktop.
Given CSV output from ParsEval, categorize each comparison as a perfect match, a CDS match, an exon structure match, a UTR structure match, or a non-match.
#!/usr/bin/env perl
use strict;
while(my $line = <STDIN>)
{
chomp($line);
my @values = split(/,/, $line);
my $page = sprintf("%s/%d-%d.html", $values[0], $values[1], $values[2]);
my $cds_match_coef = $values[33];
my $utr_match_coef = $values[39];
my $overall_match_coef = $values[32];
my $correct_exons = $values[16];
my $refr_exons = $values[14];
my $wrong_exons = $values[18];
my $missing_exons = $values[17];
my $refr_trans = $values[3];
my $pred_trans = $values[4];
my $class;
if($cds_match_coef == 1 and $utr_match_coef == 1)
{
if($overall_match_coef == 1)
{
$class = "perfect match";
}
else
{
$class = "perfect match, mislabeled UTRs";
}
}
elsif($cds_match_coef == 1)
{
$class = "CDS match";
}
elsif($correct_exons == $refr_exons and $wrong_exons + $missing_exons == 0)
{
$class = "exon match";
}
elsif($utr_match_coef == 1)
{
$class = "UTR match";
}
else
{
$class = "non-match";
}
printf("%s\t%s\t%s\t%s\n", $class, $page, $refr_trans, $pred_trans);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment