None available.
sub run
{
my $self = shift if (defined(caller(1)));
my $source_id = shift;
my $species_id = shift;
my $files = shift;
my $release_file = shift;
my $verbose = shift;
my $file = @{$files}[0];
my $syn_file = @{$files}[1];
if(!defined($source_id)){
$source_id = XrefParser::BaseParser->get_source_id_for_filename($file);
}
if(!defined($species_id)){
$species_id = XrefParser::BaseParser->get_species_id_for_filename($file);
}
my $mgi_io = $self->get_filehandle($file);
if ( !defined $mgi_io ) {
print STDERR "ERROR: Could not open $file\n";
return 1; }
my $xref_count =0;
my $syn_count =0;
my %acc_to_xref;
while ( $_ = $mgi_io->getline() ) {
chomp;
if($_ =~ /^ MGI:/){
my ($junk, $acc, $chr, $pos, $label, $status, @part_desc) = split(/\s+/,$_);
my $desc= join(" ",@part_desc);
$acc_to_xref{$acc} = $self->add_xref($acc,"",$label,$desc,$source_id,$species_id,"MISC");
if($verbose and $desc eq ""){
print "$acc has no description\n";
}
$xref_count++;
}
}
$mgi_io->close();
print $xref_count." MGI Description Xrefs added\n" if($verbose);
my $mgi_io = $self->get_filehandle($syn_file);
if ( !defined $mgi_io ) {
print STDERR "ERROR: Could not open $file\n";
return 1; }
my $syn_count = 0;
while ( $_ = $mgi_io->getline() ) {
chomp;
if($_ =~ /^ MGI:/){
my ($junk, $acc, $chr, $pos, $symbol, @part_synonym) = split(/\s+/,$_);
my $syn = join(" ",@part_synonym);
if(defined($acc_to_xref{$acc})){
$self->add_synonym($acc_to_xref{$acc}, $syn);
$syn_count++;
}
}
}
$mgi_io->close();
print $syn_count." synonyms added\n" if($verbose);
return 0; }
1; } |