1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
use Test::Files;
BEGIN { unshift( @INC, './lib' ) }
BEGIN {
use Test::Most;
use_ok('Bio::Roary::AccessoryBinaryFasta');
}
my $dummy_annotate_groups = Bio::Roary::AnnotateGroups->new(
gff_files => ['t/data/query_1.gff','t/data/query_2.gff','t/data/query_3.gff'],
groups_filename => 't/data/query_groups',
);
my $dummy_analyse_groups = Bio::Roary::AnalyseGroups->new(
fasta_files => ['t/data/query_1.fa','t/data/query_2.fa','t/data/query_3.fa'],
groups_filename => 't/data/query_groups'
);
ok(
my $obj = Bio::Roary::AccessoryBinaryFasta->new(
input_files => [ 't/abc/aaa', 't/abc/bbb', 't/abc/ccc', 't/abc/ddd' ],
groups_to_files =>
{
group_1 => { 't/abc/aaa' => [1] },
group_2 => { 't/abc/aaa' => [1], 't/abc/bbb' => [2] },
group_3 => { 't/abc/aaa' => [1], 't/abc/bbb' => [2], 't/abc/ccc' => [3] },
group_4 => { 't/abc/aaa' => [1], 't/abc/bbb' => [2], 't/abc/ccc' => [3], 't/abc/ddd' => [4] },
},
_lower_bound_value => 0,
_upper_bound_value => 4,
annotate_groups_obj => $dummy_annotate_groups,
analyse_groups_obj => $dummy_analyse_groups
),
'initialise accessory binary fasta file'
);
ok( $obj->create_accessory_binary_fasta(), 'create output file' );
compare_ok( 'accessory_binary_genes.fa', 't/data/expected_accessory_binary_genes.fa','binary accessory fasta file created');
ok(
$obj = Bio::Roary::AccessoryBinaryFasta->new(
input_files => [ 'aaa', 'bbb', 'ccc', 'ddd' ],
groups_to_files =>
{
group_1 => { 'aaa' => [1] },
group_2 => { 'aaa' => [1], 'bbb' => [2] },
group_3 => { 'aaa' => [1], 'bbb' => [2], 'ccc' => [3] },
group_4 => { 'aaa' => [1], 'bbb' => [2], 'ccc' => [3], 'ddd' => [4] },
},
annotate_groups_obj => $dummy_annotate_groups,
analyse_groups_obj => $dummy_analyse_groups
),
'initialise accessory binary fasta file bounded'
);
is($obj->_lower_bound_value, 1, 'lower bound value');
is($obj->_upper_bound_value, 3, 'upper bound value');
ok( $obj->create_accessory_binary_fasta(), 'create output file bounded' );
compare_ok( 'accessory_binary_genes.fa', 't/data/expected_accessory_binary_genes_bounded.fa','binary accessory fasta file created bounded');
done_testing();
|