6 test_begin(-tests => 21);
8 use_ok 'Bio::PrimarySeq';
9 use_ok 'Bio::SeqFeature::Primer';
10 use_ok 'Bio::SeqFeature::Amplicon';
13 my ($amplicon, $amplicon_seq, $fwd_primer, $rev_primer, $template);
16 # Basic amplicon object
18 $amplicon = Bio::SeqFeature::Amplicon->new();
19 isa_ok $amplicon, 'Bio::SeqFeature::Amplicon';
20 isa_ok $amplicon, 'Bio::SeqFeature::SubSeq';
23 # Amplicon with explicit sequence (sequence string)
25 ok $amplicon = Bio::SeqFeature::Amplicon->new(
26 -seq => 'CCCCCAAAAAGGGGGTTTTT',
28 ok $amplicon_seq = $amplicon->seq;
29 isa_ok $amplicon_seq, 'Bio::PrimarySeq';
30 is $amplicon_seq->seq, 'CCCCCAAAAAGGGGGTTTTT';
33 # Amplicon with explicit sequence (sequence object)
35 $fwd_primer = Bio::SeqFeature::Primer->new(
41 $rev_primer = Bio::SeqFeature::Primer->new(
48 ok $amplicon = Bio::SeqFeature::Amplicon->new(
51 -seq => Bio::PrimarySeq->new( -seq => 'CCCCCAAAAAGGGGGTTTTT' ),
52 -fwd_primer => $fwd_primer,
55 ok $amplicon->rev_primer($rev_primer);
57 is_deeply $amplicon->fwd_primer(), $fwd_primer;
58 is_deeply $amplicon->rev_primer(), $rev_primer;
60 ok $amplicon_seq = $amplicon->seq;
61 isa_ok $amplicon_seq, 'Bio::PrimarySeq';
62 is $amplicon_seq->seq, 'CCCCCAAAAAGGGGGTTTTT';
65 # Amplicon with implicit sequence
67 $template = Bio::Seq->new( -seq => 'ATCGATCGATCCCCCAAAAAGGGGGTTTTTAGCTAGCTAT');
69 ok $amplicon = Bio::SeqFeature::Amplicon->new(
75 ok $template->add_SeqFeature($amplicon);
77 ok $amplicon_seq = $amplicon->seq;
78 isa_ok $amplicon_seq, 'Bio::PrimarySeq';
79 is $amplicon_seq->seq, 'AAAAACCCCCTTTTTGGGGG';