File: seqfeaturePrimer.t

package info (click to toggle)
bioperl 1.4-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 20,336 kB
  • ctags: 8,476
  • sloc: perl: 119,890; xml: 6,001; lisp: 121; makefile: 57
file content (71 lines) | stat: -rwxr-xr-x 2,500 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# -*-Perl-*-
## Bioperl Test Harness Script for Modules
## $Id: seqfeaturePrimer.t,v 1.3 2002/10/30 14:21:59 heikki Exp $
#
# modeled after the t/Allele.t test script

use strict;
#use Dumpvalue qw(dumpValue);

BEGIN {
    # to handle systems with no installed Test module
    # we include the t dir (where a copy of Test.pm is located)
    # as a fallback
    eval { require Test; };
    if( $@ ) {
        use lib 't';
    }
    use Test;
    plan tests => 8;
}

my $DEBUG = $ENV{'BIOPERLDEBUG'};
#my $dumper = new Dumpvalue();

print("Checking to see if Bio::SeqFeature::Primer is available.\n") if $DEBUG;
use Bio::SeqFeature::Primer;
ok(1);
print("Checking to see if a BSFP object can be created:\n") if $DEBUG;
     # yes sure, but first scope a few variables
my $seqsequence = "gcatcgatctagctagcta";
my $primersequence = "aaaaaacgatcgatcgtagctagct";

my $seqname = "chads_nifty_sequence";
my $primername = "chads_nifty_primer";
     # ok, and what about variables governing where the feature is located?
     # check the primer3docs, luke...
# TARGET=513,26
# PRIMER_FIRST_BASE_INDEX=1
# PRIMER_LEFT=484,20


print("Checking to see if the BSFP object can be constructed with a bio::seq object\n") if $DEBUG;
my $seq = new Bio::Seq( -seq => $seqsequence, -id =>$seqname);
my $bsfp_seq = new Bio::SeqFeature::Primer( -sequence => $seq,
                                             -TARGET => '5,3' );
ok(ref($bsfp_seq) eq "Bio::SeqFeature::Primer");

print("Checking to see if the BSFP object can be constructed with scalars\n") if $DEBUG;

my $bsfp_scalar = new Bio::SeqFeature::Primer( -sequence => $primersequence,
                                        -id => $primername,
                                             -TARGET => '5,3' );
ok(ref($bsfp_scalar) eq "Bio::SeqFeature::Primer");

print("Checking to see that seq() returns a Bio::Seq object and that the object is the right one.\n") if $DEBUG;
ok(ref($bsfp_scalar->seq()) eq "Bio::Seq");
print("First for the scalar-ily created one.\n") if $DEBUG;
print("id ok?\n") if $DEBUG;
ok($bsfp_scalar->seq()->id() eq $primername);
print("sequence ok?\n") if $DEBUG;
ok($bsfp_scalar->seq()->seq() eq $primersequence);
print("Now for the seq-ily created one\n") if $DEBUG;
print("id ok?\n") if $DEBUG;
ok($bsfp_seq->seq()->display_id() eq $seqname);
print("sequence ok?\n") if $DEBUG;
ok($bsfp_seq->seq()->seq() eq $seqsequence);

print("Here is the structure of the BSFP_scalar object:\n") if $DEBUG;
# $dumper->dumpValue($bsfp_scalar);