2 ## Bioperl Test Harness Script for Modules
5 # modeled after the t/Allele.t test script
8 #use Dumpvalue qw(dumpValue);
11 # to handle systems with no installed Test module
12 # we include the t dir (where a copy of Test.pm is located)
14 eval { require Test; };
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;
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...
38 # PRIMER_FIRST_BASE_INDEX=1
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,
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,
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);