<commit_before>package OntologySupport;
use strict;
use DBI;
use Exporter;
use vars qw($VERSION @ISA @EXPORT);

$VERSION     = 1.00;
@ISA         = qw(Exporter);
@EXPORT      = qw(getGoSize);


sub getGoSize { 
    (my $goIDList, my $domainList, my $ecList) = @_;

    my $dbh = DBI->connect("DBI:mysql:networks_pdev;host=db1.chicago.kbase.us",'networks_pdev', '',  { RaiseError => 1 } );
  
    if(defined $dbh->err && $dbh->err != 0) { # if there is any error
      return []; # return empty list
    }

    my %domainMap = map {$_ => 1} @{$domainList};
    my %ecMap = map {$_ => 1} @{$ecList};

    my %goID2Count = (); # gene to id list
    my $pstmt = $dbh->prepare("select TranscriptID, OntologyDomain, OntologyEvidenceCode from ontologies where OntologyID = ? and OntologyType = 'GO'");
    foreach my $goID (@{$goIDList}) {
      $pstmt->bind_param(1, $goID);
      $pstmt->execute();
      while( my @data = $pstmt->getchrow_array()) {
        next if ! defined $domainMap{$data[2]};
        next if ! defined $ecMap{$data[3]};
        $goID2Count{$goID} = 0 if(! defined $goID2Count{$goID});
        $goID2Count{$goID} = $goID2Count{$goID} + 1;<commit_msg>fixed minor typo<commit_after>package OntologySupport;
use strict;
use DBI;
use Exporter;
use vars qw($VERSION @ISA @EXPORT);

$VERSION     = 1.00;
@ISA         = qw(Exporter);
@EXPORT      = qw(getGoSize);


sub getGoSize { 
    (my $goIDList, my $domainList, my $ecList) = @_;

    my $dbh = DBI->connect("DBI:mysql:networks_pdev;host=db1.chicago.kbase.us",'networks_pdev', '',  { RaiseError => 1 } );
  
    if(defined $dbh->err && $dbh->err != 0) { # if there is any error
      return []; # return empty list
    }

    my %domainMap = map {$_ => 1} @{$domainList};
    my %ecMap = map {$_ => 1} @{$ecList};

    my %goID2Count = (); # gene to id list
    my $pstmt = $dbh->prepare("select TranscriptID, OntologyDomain, OntologyEvidenceCode from ontologies where OntologyID = ? and OntologyType = 'GO'");
    foreach my $goID (@{$goIDList}) {
      $pstmt->bind_param(1, $goID);
      $pstmt->execute();
      while( my @data = $pstmt->fetchrow_array()) {
        next if ! defined $domainMap{$data[2]};
        next if ! defined $ecMap{$data[3]};
        $goID2Count{$goID} = 0 if(! defined $goID2Count{$goID});
        $goID2Count{$goID} = $goID2Count{$goID} + 1;
{'fraction_non_alphanumeric': 0.17372700042789901, 'fraction_numerical': 0.01540436456996149, 'mean_word_length': 3.289908256880734, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, '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': '1965098', 'n_tokens_mistral': 883, 'n_tokens_neox': 843, 'n_words': 203}