File: vecscreen.t

package info (click to toggle)
libbio-featureio-perl 1.6.905-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 344 kB
  • sloc: perl: 1,479; makefile: 2
file content (117 lines) | stat: -rw-r--r-- 3,042 bytes parent folder | download
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# -*-Perl-*- Test Harness script for Bioperl
# $Id: FeatureIO.t 15112 2008-12-08 18:12:38Z sendu $

use strict;
use warnings;
use Bio::Root::Test;
use Bio::FeatureIO;

{
    my @expected_features =
    (
        {
         'seq_id' => 'C02HBa0072A04.1',
         'primary_tag' => 'moderate_match',
         'end' => '60548',
         'start' => '60522'
        },
        {
         'seq_id' => 'SL_FOS91h17_SP6_0',
         'primary_tag' => 'strong_match',
         'end' => '122',
         'start' => '60'
        },
        {
         'seq_id' => 'SL_FOS91h18_T7_0',
         'primary_tag' => 'strong_match',
         'end' => '102',
         'start' => '35'
        },
        {
         'seq_id' => 'SL_FOS91h18_T7_0',
         'primary_tag' => 'moderate_match',
         'end' => '103',
         'start' => '76'
        },
        {
         'seq_id' => 'SL_FOS91h18_T7_0',
         'primary_tag' => 'weak_match',
         'end' => '104',
         'start' => '82'
        },
        {
         'seq_id' => 'SL_FOS91h18_T7_0',
         'primary_tag' => 'suspect_origin',
         'end' => '34',
         'start' => '1'
        },
        {
         'seq_id' => 'SL_FOS91i01_SP6_0',
         'primary_tag' => 'strong_match',
         'end' => '110',
         'start' => '46'
        },
        {
         'seq_id' => 'SL_FOS91i01_SP6_0',
         'primary_tag' => 'suspect_origin',
         'end' => '45',
         'start' => '1'
        },
        {
         'seq_id' => 'SL_FOS92b12_T7_0',
         'primary_tag' => 'strong_match',
         'end' => '108',
         'start' => '41'
        },
        {
         'seq_id' => 'SL_FOS92b12_T7_0',
         'primary_tag' => 'moderate_match',
         'end' => '109',
         'start' => '82'
        },
        {
         'seq_id' => 'SL_FOS92b12_T7_0',
         'primary_tag' => 'weak_match',
         'end' => '110',
         'start' => '88'
        },
        {
         'seq_id' => 'SL_FOS92b12_T7_0',
         'primary_tag' => 'weak_match',
         'end' => '1329',
         'start' => '1313'
        },
        {
         'seq_id' => 'SL_FOS92b12_T7_0',
         'primary_tag' => 'suspect_origin',
         'end' => '40',
         'start' => '1'
        },
        {
         'seq_id' => 'SL_FOS92b12_T7_0',
         'primary_tag' => 'suspect_origin',
         'end' => '1334',
         'start' => '1330'
        }
    );
    my @vs_features;
    my $vs_in = Bio::FeatureIO->new( -file => test_input_file('vecscreen_simple.test_output'),
                     -format => 'vecscreen_simple',
                   );
    ok( $vs_in );
    while(my $feat = $vs_in->next_feature) {
      push @vs_features,$feat;
    }
  
    #convert the array of feature objects to something that can more easily be checked with is_deeply
    @vs_features = map {
        my $f = $_;
        my $rec = { map {$_ => $f->$_()} qw/start end primary_tag seq_id/ };
    } @vs_features;
  
    is_deeply(\@vs_features,\@expected_features,'vecscreen_simple gets the correct features');
}

done_testing();

exit;