<commit_before>#!/usr/bin/env perl
########################################################################
# Authors: <NAME>, <NAME>, <NAME>
# Contact email: <EMAIL>
# Development location: Mathematics and Computer Science Division, Argonne National Lab
########################################################################
use strict;
use warnings;
use Bio::KBase::workspaceService::Helpers qw(auth get_ws_client workspace workspaceURL parseObjectMeta parseWorkspaceMeta printObjectMeta);
use Bio::KBase::fbaModelServices::Helpers qw(get_fba_client runFBACommand universalFBAScriptCode );
#Defining globals describing behavior
my $primaryArgs = ["Genome ID","Translation file","ID type"];
my $servercommand = "add_feature_translation";
my $script = "kbfba-importtranslation";
my $translation = {
	"ID type" => "id_type",
	"Genome ID" => "genome",
	genomews => "genome_workspace",
	workspace => "workspace",
	auth => "auth",
	overwrite => "overwrite"
};
#Defining usage and options
my $specs = [
    [ 'genomews:s', 'Workspace with genome object' ],
    [ 'workspace|w:s', 'Workspace to save imported model in', { "default" => workspace() } ],
    [ 'overwrite|o', 'Overwrite any existing phenotypes with same name' ]
];
my ($opt,$params) = universalFBAScriptCode($specs,$script,$primaryArgs,$translation);
$params->{translations} = [];
if (!-e $opt->{"Translation file"}) {
	print "Could not find input translation file!\n";
	exit();
}
open(my $fh, "<", $opt->{"Translation file"}) || return;<commit_msg>Document input file format in help text<commit_after>#!/usr/bin/env perl
########################################################################
# Authors: <NAME>, <NAME>, <NAME>
# Contact email: <EMAIL>
# Development location: Mathematics and Computer Science Division, Argonne National Lab
########################################################################
use strict;
use warnings;
use Bio::KBase::workspaceService::Helpers qw(auth get_ws_client workspace workspaceURL parseObjectMeta parseWorkspaceMeta printObjectMeta);
use Bio::KBase::fbaModelServices::Helpers qw(get_fba_client runFBACommand universalFBAScriptCode );
#Defining globals describing behavior
my $primaryArgs = ["Genome ID","Translation file","ID type"];
my $servercommand = "add_feature_translation";
my $script = "kbfba-importtranslation";
my $translation = {
	"ID type" => "id_type",
	"Genome ID" => "genome",
	genomews => "genome_workspace",
	workspace => "workspace",
	auth => "auth",
	overwrite => "overwrite"
};
#Defining usage and options
my $specs = [
    [ 'Genome ID: ID for a genome in the workspace' ],
    [ 'Translation file: Two-column tab-delimited file: alias (1st column) and feature ID (2nd column)'],
    [ 'ID type: Any string (?)'],
    [ "\n" ],
    [ 'genomews:s', 'Workspace with genome object' ],
    [ 'workspace|w:s', 'Workspace to save imported model in', { "default" => workspace() } ],
    [ 'overwrite|o', 'Overwrite any existing phenotypes with same name' ]
];
my ($opt,$params) = universalFBAScriptCode($specs,$script,$primaryArgs,$translation);
$params->{translations} = [];
if (!-e $opt->{"Translation file"}) {
	print "Could not find input translation file!\n";
	exit();
}
open(my $fh, "<", $opt->{"Translation file"}) || return;
{'fraction_non_alphanumeric': 0.2305564094681832, 'fraction_numerical': 0.0006148170919151552, 'mean_word_length': 6.63849765258216, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3610023', 'n_tokens_mistral': 946, 'n_tokens_neox': 922, 'n_words': 268}