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

use 5.012;
use strict;
use warnings;
use lib qw(../../blib/lib t/lib);
use Transposome;
use Transposome::Run::Blast;
use TestUtils;

use Test::More tests => 2;

my $test = TestUtils->new( seq_file     => 't/test_data/t_reads.fas',
			   repeat_db    => 't/test_data/t_db.fas', 
			   destroy      => 0,
                           build_proper => 1 );

my $conf = $test->config_constructor;
my ($conf_file) = @$conf;

my $trans_obj = Transposome->new( config => $conf_file );
ok ( $trans_obj->get_config, 'Configuration data loaded from file correctly' );
my $config = $trans_obj->get_config;

#ok( system("formatdb"), 'Can create database for mgblast' ); # test loading attributes instead
#ok( system("mgblast"),  'Can execute mgblast' );

my $blast = Transposome::Run::Blast->new( file      => $config->{sequence_file},
					  dir       => $config->{output_directory},
					  threads   => 1,
					  cpus      => 1,
					  seq_num   => $config->{sequence_num} );
#                                          report    => $config->{report_file} );

my $blastdb = $blast->run_allvall_blast;
ok ( defined($blastdb), 'Can execute all vs. all blast correctly' );

system("rm -rf t/test_transposome_cli_out t/transposome_config* t/transposome_mgblast*");<commit_msg>modify tests now that logging is taking place<commit_after>#!/usr/bin/env perl

use 5.012;
use strict;
use warnings;
use lib qw(../../blib/lib t/lib);
use Transposome;
use Transposome::Run::Blast;
use TestUtils;
use Log::Log4perl;

use Test::More tests => 2;

my $test = TestUtils->new( seq_file     => 't/test_data/t_reads.fas',
			   repeat_db    => 't/test_data/t_db.fas', 
			   destroy      => 0,
                           build_proper => 1 );

my $conf = $test->config_constructor;
my ($conf_file) = @$conf;

my $trans_obj = Transposome->new( config => $conf_file );
ok ( $trans_obj->get_config, 'Configuration data loaded from file correctly' );
my $config = $trans_obj->get_config;

my $log_conf = qq{
    log4perl.category.Transposome       = INFO, Logfile

    log4perl.appender.Logfile           = Log::Log4perl::Appender::File
    log4perl.appender.Logfile.filename  = t/$config->{run_log_file}
    log4perl.appender.Logfile.layout   = Log::Log4perl::Layout::PatternLayout
    log4perl.appender.Logfile.layout.ConversionPattern = %m%n
  };

Log::Log4perl::init( \$log_conf );

my $blast = Transposome::Run::Blast->new( file      => $config->{sequence_file},
					  dir       => $config->{output_directory},
					  threads   => 1,
					  cpus      => 1,
					  seq_num   => $config->{sequence_num} );

my $blastdb = $blast->run_allvall_blast;
ok ( defined($blastdb), 'Can execute all vs. all blast correctly' );

system("rm -rf t/test_transposome_cli_out t/transposome_config* t/transposome_mgblast* t/$config->{run_log_file} t_log.txt");
{'fraction_non_alphanumeric': 0.15225035161744022, 'fraction_numerical': 0.00949367088607595, 'mean_word_length': 3.2399403874813713, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 49, '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': '1301964', 'n_tokens_mistral': 1072, 'n_tokens_neox': 973, 'n_words': 214}