Skip to content

Commit

Permalink
fix #190 - error in handling location B after location A (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
Juke34 committed Nov 22, 2021
1 parent 8e14444 commit cb579e0
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions bin/agat_sp_sensitivity_specificity.pl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
print ("Parsing $gff1\n");
my ($omniscient1, $hash_mRNAGeneLink1) = slurp_gff3_file_JD({ input => $gff1
});
print ("\n\nParsing $gff2\n");
print ("\n\nParsing $gff2\n");
my ($omniscient2, $hash_mRNAGeneLink2) = slurp_gff3_file_JD({ input => $gff2
});
print ("-- Files parsed --\n");
Expand Down Expand Up @@ -274,7 +274,7 @@
print " shift location2 because before location A!\n" if ($verbose);
my $FP = $location2->[1] - $location2->[0] + 1; #size
$all{$chimere_type}{$level}{$type}{'FP'} += $FP;
print " FP => $FP\n" if ($verbose);
print " +FP => $FP\n" if ($verbose);
$previous_overlap = 0;
}

Expand Down Expand Up @@ -330,8 +330,8 @@
$all{$chimere_type}{$level}{$type}{'TP'} += $TP;
$all{$chimere_type}{$level}{$type}{'FN'} += $FN;
$all{$chimere_type}{$level}{$type}{'FP'} -= $TP;
print " FN: removing ".$TP."\n" if $verbose;
print " FP: ADDING ".$FP."\n" if $verbose;
print " FN: ADDING ".$FN."\n" if $verbose;
print " FP: removing ".$TP."\n" if $verbose;
print " TP: ADDING ".$TP."\n" if $verbose;
}
else{
Expand Down Expand Up @@ -375,19 +375,11 @@
else{
print " last because location2 after\n" if ($verbose);

if($previous_overlap){
my $FP = $location2->[1] - $location2->[0] + 1; #size
$all{$chimere_type}{$level}{$type}{'FP'} += $FP;
print " Take into account the current locationB! +FP FP;\n" if ($verbose);
}
else{
my $FN = $location1->[1] - $location1->[0] + 1; #size
$all{$chimere_type}{$level}{$type}{'FN'} += $FN;
print " Take into account the current locationA! +FN:$FN;\n" if ($verbose);
$shift_it = undef;
}
my $FN = $location1->[1] - $location1->[0] + 1; #size
$all{$chimere_type}{$level}{$type}{'FN'} += $FN;
print " Take into account the current locationA! +FN: $FN;\n" if ($verbose);
$shift_it = undef;

# If it was overlaping then we do not count it because it has been already taken into account
print "End2 TP: ".$all{$chimere_type}{$level}{$type}{'TP'}."\n" if $verbose;
print "End2 FN: ".$all{$chimere_type}{$level}{$type}{'FN'}."\n" if $verbose;
print "End2 FP: ".$all{$chimere_type}{$level}{$type}{'FP'}."\n\n" if $verbose;
Expand Down

0 comments on commit cb579e0

Please sign in to comment.