Skip to content
Snippets Groups Projects
Commit 71de25f7 authored by Glenn Proctor's avatar Glenn Proctor
Browse files

Added statistics for number of names projected from each source.

parent 509fa4b4
No related branches found
No related tags found
No related merge requests found
......@@ -140,6 +140,7 @@ if ($compara) {
my $from_ga = Bio::EnsEMBL::Registry->get_adaptor($from_species, 'core', 'Gene');
my %projections_by_evidence_type;
my %projections_by_source;
foreach my $to_species (@to_multi) {
......@@ -209,21 +210,7 @@ foreach my $to_species (@to_multi) {
print "\n$to_species, after projection: \n";
print_stats($to_ga);
# print statistics if required
if ($full_stats) {
print "Projected terms by evidence code:\n";
my $total;
foreach my $et (sort keys %projections_by_evidence_type) {
next if (!grep(/$et/, @evidence_codes));
if ($et) {
print $et . "\t" . $projections_by_evidence_type{$et} . "\n";
$total += $projections_by_evidence_type{$et};
}
}
print "Total:\t$total\n";
}
print_full_stats() if ($full_stats);
}
......@@ -316,6 +303,9 @@ sub project_display_names {
# update the gene so that the display_xref_id is set
$to_ga->update($to_gene) if (!$print);
# keep track of where each projection came from
$projections_by_source{$dbEntry->dbname()}++;
}
}
......@@ -450,6 +440,45 @@ sub print_stats {
}
# ----------------------------------------------------------------------
sub print_full_stats {
# GO terms
if ($go_terms) {
print "\nProjected terms by evidence code:\n";
my $total;
foreach my $et (sort keys %projections_by_evidence_type) {
next if (!grep(/$et/, @evidence_codes));
if ($et) {
print $et . "\t" . $projections_by_evidence_type{$et} . "\n";
$total += $projections_by_evidence_type{$et};
}
}
print "Total:\t$total\n";
}
# display names
if ($names) {
print "\nProjected display names by source:\n";
my $total;
foreach my $source (sort keys %projections_by_source) {
print $source . "\t" . $projections_by_source{$source} . "\n";
$total += $projections_by_source{$source};
}
print "Total:\t$total\n";
}
}
# ----------------------------------------------------------------------
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment