<commit_before>#!/usr/bin/env perl

use strict;
use v5.10;

die "$0 <installDIR>" unless $#ARGV == 0;

my $installDIR = $ARGV[0];
my %kohash;

open my $allkos, "<", "$installDIR/misc/ko_nodedetails" || die "$! no such file: $installDIR/misc/ko_nodedetails";
while(my $entry = <$allkos>)
{
    my $ko = (split /\t/, $entry)[0];
    $kohash{$ko} = $entry;
}

open my $metabkos, "<", "$installDIR/out/nodes/newkonodes" || die "$! no such file: $installDIR/out/nodes/newkonodes";
while(my $entry = <$metabkos>)
{
    unless($. == 1)
    {
        my $ko = (split /\t/, $entry)[0];
        delete $kohash{$ko};
    }
}
close $metabkos;

open my $final, ">>", "$installDIR/out/nodes/newkonodes" || die "$! no such file: $installDIR/out/nodes/newkonodes";
print $final $kohash{$_} foreach (keys %kohash);

#allKOs  = read.table("misc/ko_nodedetails",sep="\t",comment.char="", h=F, fill=T)
#metabKO = read.table("out/nodes/newkonodes")<commit_msg>edit kegg 0400 to have label<commit_after>#!/usr/bin/env perl

use strict;
use v5.10;

die "$0 <installDIR>" unless $#ARGV == 0;

my $installDIR = $ARGV[0];
my %kohash;

open my $allkos, "<", "$installDIR/misc/ko_nodedetails" || die "$! no such file: $installDIR/misc/ko_nodedetails";
while(my $entry = <$allkos>)
{
    chomp $entry
    my $ko = (split /\t/, $entry)[0];
    $kohash{$ko} = $entry."\tko\n";
}

open my $metabkos, "<", "$installDIR/out/nodes/newkonodes" || die "$! no such file: $installDIR/out/nodes/newkonodes";
while(my $entry = <$metabkos>)
{
    unless($. == 1)
    {
        my $ko = (split /\t/, $entry)[0];
        delete $kohash{$ko};
    }
}
close $metabkos;

open my $final, ">>", "$installDIR/out/nodes/newkonodes" || die "$! no such file: $installDIR/out/nodes/newkonodes";
print $final $kohash{$_} foreach (keys %kohash);

#allKOs  = read.table("misc/ko_nodedetails",sep="\t",comment.char="", h=F, fill=T)
#metabKO = read.table("out/nodes/newkonodes")
{'fraction_non_alphanumeric': 0.21573736321000522, 'fraction_numerical': 0.011464304325169358, 'mean_word_length': 4.065963060686016, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '7217863', 'n_tokens_mistral': 813, 'n_tokens_neox': 787, 'n_words': 166}