1 # -*-Perl-*- Test Harness script for Bioperl
9 test_begin(-tests => 47);
10 use_ok('Bio::SeqFeature::Primer');
11 use_ok('Bio::PrimarySeq');
14 my ($primer, $primer_seq, $location, $start, $end, $strand, $id, $tm, $tme, $template, $seq);
16 # Implied primer sequence
17 $template = Bio::Seq->new( -seq => 'AAAAACCCCCGGGGGTTTTT' );
18 ok $primer = Bio::SeqFeature::Primer->new( -start => 6, -end => 10 ), 'Implied primer sequence';
19 isa_ok $primer, 'Bio::SeqFeature::Primer';
20 isa_ok $primer, 'Bio::SeqFeature::SubSeq';
21 ok $template->add_SeqFeature($primer); # $primer->attach_seq($template);
22 ok $primer_seq = $primer->seq;
23 isa_ok $primer_seq, 'Bio::PrimarySeqI';
24 is $primer_seq->seq, 'CCCCC';
27 # Bio::PrimarySeq primer
28 $template = Bio::Seq->new( -seq => 'AAAAACCCCCGGGGGTTTTT' );
29 $seq = Bio::PrimarySeq->new(-seq => 'CTTTTCATTCTGACTGCAACG');
30 ok $primer = Bio::SeqFeature::Primer->new(-seq => $seq), 'PrimarySeq primer';
31 ok $template->add_SeqFeature($primer); # $primer->attach_seq($template);
32 ok $primer_seq = $primer->seq;
33 isa_ok $primer_seq, 'Bio::PrimarySeqI';
34 is $primer_seq->seq, 'CTTTTCATTCTGACTGCAACG';
37 # Initialize with a sequence string
38 ok $primer = Bio::SeqFeature::Primer->new(
39 -seq => 'CTTTTCATTCTGACTGCAACG',
44 ok $primer_seq = $primer->seq;
45 is $primer_seq->isa('Bio::PrimarySeqI'), 1;
46 is $primer_seq->seq, 'CTTTTCATTCTGACTGCAACG';
47 is $primer_seq->id, 'myid';
48 is $primer->primary_tag, 'Primer';
49 ok $primer->display_name('test');
50 is $primer->display_name, 'test';
58 ok $primer->strand(-1);
59 is $primer->strand, -1;
60 ok $location = $primer->location;
61 isa_ok $location, 'Bio::LocationI';
64 # Melting temperatures
67 ok $tm = $primer->Tm(-salt => 0.05, -oligo => 0.0000001);
68 ok $tme = $primer->Tm_estimate;
70 ok $tm = $primer->Tm_estimate(-salt => 0.05);
74 # * initializing with -sequence
75 # * passing a string to location()
77 local $SIG{'__WARN__'} = sub { }; # Silence deprecation warnings
78 ok $primer = Bio::SeqFeature::Primer->new(
79 -sequence => 'CTTTTCATTCTGACTGCAACG',
81 ok $location = $primer->location('3,25');
88 -seq => 'gcatcgatctagctagcta' ,
89 -id => 'chads_nifty_sequence',
91 $primer = Bio::SeqFeature::Primer->new(
95 isa_ok $primer, 'Bio::SeqFeature::Primer';
96 is $primer->seq->display_id, 'chads_nifty_sequence';
97 is $primer->seq->seq, 'gcatcgatctagctagcta';
98 $primer = Bio::SeqFeature::Primer->new(
99 -seq => 'aaaaaacgatcgatcgtagctagct',
100 -id => 'chads_nifty_primer',
103 isa_ok $primer, 'Bio::SeqFeature::Primer';
104 isa_ok $primer->seq(), 'Bio::PrimarySeq';
105 is $primer->seq->id, 'chads_nifty_primer';
106 is $primer->seq->seq, 'aaaaaacgatcgatcgtagctagct';