Bio::Align::Graphics: move into its own distribution and drop dependency on GD
[bioperl-live.git] / t / SeqFeature / Amplicon.t
blob26d9f4ce64849428441409166cb70c92b2d6dd31
1 use strict;
3 BEGIN {
4     use lib '.';
5     use Bio::Root::Test;
6     
7     test_begin(-tests => 21);
9     use_ok 'Bio::PrimarySeq';
10     use_ok 'Bio::SeqFeature::Primer';
11     use_ok 'Bio::SeqFeature::Amplicon';
14 my ($amplicon, $amplicon_seq, $fwd_primer, $rev_primer, $template);
17 # Basic amplicon object
19 $amplicon = Bio::SeqFeature::Amplicon->new();
20 isa_ok $amplicon, 'Bio::SeqFeature::Amplicon';
21 isa_ok $amplicon, 'Bio::SeqFeature::SubSeq';
24 # Amplicon with explicit sequence (sequence string)
26 ok $amplicon = Bio::SeqFeature::Amplicon->new(
27     -seq => 'CCCCCAAAAAGGGGGTTTTT',
29 ok $amplicon_seq = $amplicon->seq;
30 isa_ok $amplicon_seq, 'Bio::PrimarySeq';
31 is $amplicon_seq->seq, 'CCCCCAAAAAGGGGGTTTTT';
34 # Amplicon with explicit sequence (sequence object)
36 $fwd_primer = Bio::SeqFeature::Primer->new(
37     -start  => 1,
38     -end    => 4,
39     -strand => 1
42 $rev_primer = Bio::SeqFeature::Primer->new(
43     -seq    => 'GATTA',
44     -start  => 16,
45     -end    => 20,
46     -strand => -1
49 ok $amplicon = Bio::SeqFeature::Amplicon->new(
50     -start      => 1,
51     -end        => 20,
52     -seq        => Bio::PrimarySeq->new( -seq => 'CCCCCAAAAAGGGGGTTTTT' ),
53     -fwd_primer => $fwd_primer,
56 ok $amplicon->rev_primer($rev_primer);
58 is_deeply $amplicon->fwd_primer(), $fwd_primer;
59 is_deeply $amplicon->rev_primer(), $rev_primer;
61 ok $amplicon_seq = $amplicon->seq;
62 isa_ok $amplicon_seq, 'Bio::PrimarySeq';
63 is $amplicon_seq->seq, 'CCCCCAAAAAGGGGGTTTTT';
66 # Amplicon with implicit sequence
68 $template = Bio::Seq->new( -seq => 'ATCGATCGATCCCCCAAAAAGGGGGTTTTTAGCTAGCTAT');
70 ok $amplicon = Bio::SeqFeature::Amplicon->new(
71     -start  => 11,
72     -end    => 30,
73     -strand => -1
76 ok $template->add_SeqFeature($amplicon);
78 ok $amplicon_seq = $amplicon->seq;
79 isa_ok $amplicon_seq, 'Bio::PrimarySeq';
80 is $amplicon_seq->seq, 'AAAAACCCCCTTTTTGGGGG';