~ubuntu-branches/ubuntu/lucid/bioperl/lucid

« back to all changes in this revision

Viewing changes to t/seqfeaturePrimer.t

  • Committer: Bazaar Package Importer
  • Author(s): Matt Hope
  • Date: 2004-04-18 14:24:11 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040418142411-gr92uexquw4w8liq
Tags: 1.4-1
* New upstream release
* Examples and working code are installed by default to usr/bin,
  this has been moved to usr/share/doc/bioperl/bin

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*-Perl-*-
 
2
## Bioperl Test Harness Script for Modules
 
3
## $Id: seqfeaturePrimer.t,v 1.3 2002/10/30 14:21:59 heikki Exp $
 
4
#
 
5
# modeled after the t/Allele.t test script
 
6
 
 
7
use strict;
 
8
#use Dumpvalue qw(dumpValue);
 
9
 
 
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;
 
20
}
 
21
 
 
22
my $DEBUG = $ENV{'BIOPERLDEBUG'};
 
23
#my $dumper = new Dumpvalue();
 
24
 
 
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";
 
32
 
 
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
 
40
 
 
41
 
 
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");
 
47
 
 
48
print("Checking to see if the BSFP object can be constructed with scalars\n") if $DEBUG;
 
49
 
 
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");
 
54
 
 
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);
 
67
 
 
68
print("Here is the structure of the BSFP_scalar object:\n") if $DEBUG;
 
69
# $dumper->dumpValue($bsfp_scalar);
 
70
 
 
71