New INSTALL.WIN doc (from wiki)
[bioperl-live.git] / t / seqfeaturePrimer.t
blob7e8c999a2c489c85bf2eddbc2493150b799c5ab5
1 # -*-Perl-*-
2 ## Bioperl Test Harness Script for Modules
3 ## $Id$
5 # modeled after the t/Allele.t test script
7 use strict;
8 #use Dumpvalue qw(dumpValue);
10 BEGIN {
11     # to handle systems with no installed Test module
12     # we include the t dir (where a copy of Test.pm is located)
13     # as a fallback
14     eval { require Test; };
15     if( $@ ) {
16         use lib 't';
17     }
18     use Test;
19     plan tests => 8;
22 my $DEBUG = $ENV{'BIOPERLDEBUG'};
23 #my $dumper = new Dumpvalue();
25 print("Checking to see if Bio::SeqFeature::Primer is available.\n") if $DEBUG;
26 use Bio::SeqFeature::Primer;
27 ok(1);
28 print("Checking to see if a BSFP object can be created:\n") if $DEBUG;
29      # yes sure, but first scope a few variables
30 my $seqsequence = "gcatcgatctagctagcta";
31 my $primersequence = "aaaaaacgatcgatcgtagctagct";
33 my $seqname = "chads_nifty_sequence";
34 my $primername = "chads_nifty_primer";
35      # ok, and what about variables governing where the feature is located?
36      # check the primer3docs, luke...
37 # TARGET=513,26
38 # PRIMER_FIRST_BASE_INDEX=1
39 # PRIMER_LEFT=484,20
42 print("Checking to see if the BSFP object can be constructed with a bio::seq object\n") if $DEBUG;
43 my $seq = new Bio::Seq( -seq => $seqsequence, -id =>$seqname);
44 my $bsfp_seq = new Bio::SeqFeature::Primer( -sequence => $seq,
45                                              -TARGET => '5,3' );
46 ok(ref($bsfp_seq) eq "Bio::SeqFeature::Primer");
48 print("Checking to see if the BSFP object can be constructed with scalars\n") if $DEBUG;
50 my $bsfp_scalar = new Bio::SeqFeature::Primer( -sequence => $primersequence,
51                                         -id => $primername,
52                                              -TARGET => '5,3' );
53 ok(ref($bsfp_scalar) eq "Bio::SeqFeature::Primer");
55 print("Checking to see that seq() returns a Bio::Seq object and that the object is the right one.\n") if $DEBUG;
56 ok(ref($bsfp_scalar->seq()) eq "Bio::Seq");
57 print("First for the scalar-ily created one.\n") if $DEBUG;
58 print("id ok?\n") if $DEBUG;
59 ok($bsfp_scalar->seq()->id() eq $primername);
60 print("sequence ok?\n") if $DEBUG;
61 ok($bsfp_scalar->seq()->seq() eq $primersequence);
62 print("Now for the seq-ily created one\n") if $DEBUG;
63 print("id ok?\n") if $DEBUG;
64 ok($bsfp_seq->seq()->display_id() eq $seqname);
65 print("sequence ok?\n") if $DEBUG;
66 ok($bsfp_seq->seq()->seq() eq $seqsequence);
68 print("Here is the structure of the BSFP_scalar object:\n") if $DEBUG;
69 # $dumper->dumpValue($bsfp_scalar);