<commit_before>package XrefParser::HUGOParser;
  
use strict;
use POSIX qw(strftime);
use File::Basename;
  
use XrefParser::BaseParser;
  
use vars qw(@ISA);
@ISA = qw(XrefParser::BaseParser);
 
my $xref_sth ;
my $dep_sth;
  
 
  
# --------------------------------------------------------------------------------
# Parse command line and run if being run directly
  
if (!defined(caller())) {
  
  if (scalar(@ARGV) != 1) {
    print "\nUsage: HUGOParser.pm file\n\n";
    exit(1);
  }
  
  run(@ARGV);
}
  
 
sub run {
  my $self = shift if (defined(caller(1)));
  my $file = shift;
 
  my $source_id = shift;
  my $species_id = shift;

  print STDERR $file."\n";
  if(!defined($source_id)){
    $source_id = XrefParser::BaseParser->get_source_id_for_filename($file);
    print "source id is $source_id \n";
  }
  if(!defined($species_id)){
    $species_id = XrefParser::BaseParser->get_species_id_for_filename($file);
    print "species id is $species_id \n";
  }

  my $dir = dirname($file);
 
  my %hugo;
    
  open (ENS4, $dir."/ens4.txt") || die "Can't open hugo ens4 $dir/ens4.txt\n";
  #HGNC    Symbol  Literature Aliases      Withdrawn Symbols
  #5       A1BG
  #7       A2M
  <ENS4>;  #header line
  while(<ENS4>){
    chomp;
    my @array = split(/\t/,$_);
    my $hgnc = $array[0];
    my $label = $array[1];
    
    $hugo{$hgnc} = $label
  }
  close ENS4;

  
  my (%swiss)  = BaseParser->get_valid_codes("uniprot",$species_id);
  my (%refseq) = BaseParser->get_valid_codes("refseq",$species_id);
 

  my $count = 0;
  my $mismatch = 0;
  open (ENS1, $dir."/ens1.txt") || die "Can't open hugo ens1  $dir/ens1.txt\n";
  #HGNC    SWISSPROT       Ref Seq
  #5       P04217  NM_130786
  #7       P01023  NM_000014
  <ENS1>;
  while (<ENS1>) {
    chomp;
    my @array = split(/\t/,$_);
    my $hgnc = $array[0];
    
    if ($array[1]) {  #swissprot<commit_msg>package missed of a couple of calls, this added<commit_after>package XrefParser::HUGOParser;
  
use strict;
use POSIX qw(strftime);
use File::Basename;
  
use XrefParser::BaseParser;
  
use vars qw(@ISA);
@ISA = qw(XrefParser::BaseParser);
 
my $xref_sth ;
my $dep_sth;
  
 
  
# --------------------------------------------------------------------------------
# Parse command line and run if being run directly
  
if (!defined(caller())) {
  
  if (scalar(@ARGV) != 1) {
    print "\nUsage: HUGOParser.pm file\n\n";
    exit(1);
  }
  
  run(@ARGV);
}
  
 
sub run {
  my $self = shift if (defined(caller(1)));
  my $file = shift;
 
  my $source_id = shift;
  my $species_id = shift;

  print STDERR $file."\n";
  if(!defined($source_id)){
    $source_id = XrefParser::BaseParser->get_source_id_for_filename($file);
    print "source id is $source_id \n";
  }
  if(!defined($species_id)){
    $species_id = XrefParser::BaseParser->get_species_id_for_filename($file);
    print "species id is $species_id \n";
  }

  my $dir = dirname($file);
 
  my %hugo;
    
  open (ENS4, $dir."/ens4.txt") || die "Can't open hugo ens4 $dir/ens4.txt\n";
  #HGNC    Symbol  Literature Aliases      Withdrawn Symbols
  #5       A1BG
  #7       A2M
  <ENS4>;  #header line
  while(<ENS4>){
    chomp;
    my @array = split(/\t/,$_);
    my $hgnc = $array[0];
    my $label = $array[1];
    
    $hugo{$hgnc} = $label
  }
  close ENS4;

  
  my (%swiss)  =  XrefParser::BaseParser->get_valid_codes("uniprot",$species_id);
  my (%refseq) =  XrefParser::BaseParser->get_valid_codes("refseq",$species_id);
 

  my $count = 0;
  my $mismatch = 0;
  open (ENS1, $dir."/ens1.txt") || die "Can't open hugo ens1  $dir/ens1.txt\n";
  #HGNC    SWISSPROT       Ref Seq
  #5       P04217  NM_130786
  #7       P01023  NM_000014
  <ENS1>;
  while (<ENS1>) {
    chomp;
    my @array = split(/\t/,$_);
    my $hgnc = $array[0];
    
    if ($array[1]) {  #swissprot
{'fraction_non_alphanumeric': 0.19721638655462184, 'fraction_numerical': 0.026260504201680673, 'mean_word_length': 2.491292392300642, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3132603', 'n_tokens_mistral': 1594, 'n_tokens_neox': 1485, 'n_words': 333}