small pod fix
[bioperl-live.git] / t / seqfeaturePrimer.t
blob401981107e48105cbc62c8b1693b6cab8a6d9ac3
1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id$
4 use strict;
6 BEGIN {
7     use lib 't/lib';
8     use BioperlTest;
9     
10     test_begin(-tests => 8);
11         
12     use_ok('Bio::SeqFeature::Primer');
15 my $DEBUG = test_debug();
17 print("Checking to see if a BSFP object can be created:\n") if $DEBUG;
18 # yes sure, but first scope a few variables
19 my $seqsequence = "gcatcgatctagctagcta";
20 my $primersequence = "aaaaaacgatcgatcgtagctagct";
22 my $seqname = "chads_nifty_sequence";
23 my $primername = "chads_nifty_primer";
24 # ok, and what about variables governing where the feature is located?
25 # check the primer3docs, luke...
26 # TARGET=513,26
27 # PRIMER_FIRST_BASE_INDEX=1
28 # PRIMER_LEFT=484,20
31 print("Checking to see if the BSFP object can be constructed with a bio::seq object\n") if $DEBUG;
32 my $seq = Bio::Seq->new( -seq => $seqsequence, -id =>$seqname);
33 my $bsfp_seq = Bio::SeqFeature::Primer->new( -sequence => $seq,
34                                              -TARGET => '5,3' );
35 isa_ok $bsfp_seq, "Bio::SeqFeature::Primer";
37 print("Checking to see if the BSFP object can be constructed with scalars\n") if $DEBUG;
39 my $bsfp_scalar = Bio::SeqFeature::Primer->new( -sequence => $primersequence,
40                                         -id => $primername,
41                                              -TARGET => '5,3' );
42 isa_ok $bsfp_scalar, "Bio::SeqFeature::Primer";
44 print("Checking to see that seq() returns a Bio::Seq object and that the object is the right one.\n") if $DEBUG;
45 isa_ok $bsfp_scalar->seq(), "Bio::Seq";
46 print("First for the scalar-ily created one.\n") if $DEBUG;
47 print("id ok?\n") if $DEBUG;
48 is $bsfp_scalar->seq()->id(), $primername;
49 print("sequence ok?\n") if $DEBUG;
50 is $bsfp_scalar->seq()->seq(), $primersequence;
51 print("Now for the seq-ily created one\n") if $DEBUG;
52 print("id ok?\n") if $DEBUG;
53 is $bsfp_seq->seq()->display_id(), $seqname;
54 print("sequence ok?\n") if $DEBUG;
55 is $bsfp_seq->seq()->seq(), $seqsequence;