File: FeaturePair.t

package info (click to toggle)
bioperl 1.7.7-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 35,888 kB
  • sloc: perl: 94,151; xml: 14,982; makefile: 20
file content (61 lines) | stat: -rw-r--r-- 1,325 bytes parent folder | download | duplicates (2)
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
# -*-Perl-*- Test Harness script for Bioperl
# $Id$

use strict;

BEGIN { 
    use Bio::Root::Test;
    
    test_begin(-tests => 19);

    use_ok('Bio::SeqFeature::Generic');
    use_ok('Bio::SeqFeature::FeaturePair');
}


my ($feat, $feat2, $pair);

ok $pair = Bio::SeqFeature::FeaturePair->new();

ok $feat = Bio::SeqFeature::Generic->new(
    -start => 40,
    -end => 80,
    -strand => 1,
    -primary => 'exon',
    -source => 'internal',
    -display_name => 'my exon feature',
    -tag => {
        silly => 20,
        new => 1
    }
);

ok $feat2 = Bio::SeqFeature::Generic->new(
    -start => 400,
    -end => 440,
    -strand => 1,
    -primary => 'other',
    -source => 'program_a',
    -phase => 1,
    -tag => {
        silly => 20,
        new => 1
    }
);

ok $pair->feature1($feat);
ok $pair->feature2($feat2);

is $pair->feature1, $feat, 'feature1 of pair stored';
is $pair->feature2, $feat2, 'feature2 of pair stored';
is $pair->start, 40, 'feature start';
is $pair->end, 80, 'feature end';
is $pair->primary_tag, 'exon', 'primary tag';
is $pair->source_tag, 'internal', 'source tag';
is $pair->hstart, 400, 'hstart';
is $pair->hend, 440, 'hend';
is $pair->hprimary_tag, 'other', 'hprimary tag';
is $pair->hsource_tag, 'program_a', 'hsource tag';

ok $pair->invert;
is $pair->end, 440, 'inverted end';