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(
42 $rev_primer = Bio::SeqFeature::Primer->new(
49 ok $amplicon = Bio::SeqFeature::Amplicon->new(
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(
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';