/
SeqFeaturePrimer.t
executable file
·56 lines (43 loc) · 1.9 KB
/
SeqFeaturePrimer.t
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
# -*-Perl-*- Test Harness script for Bioperl
# $Id$
use strict;
BEGIN {
use lib '.';
use Bio::Root::Test;
test_begin(-tests => 8);
use_ok('Bio::SeqFeature::Primer');
}
my $DEBUG = test_debug();
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 = Bio::Seq->new( -seq => $seqsequence, -id => $seqname );
my $bsfp_seq = Bio::SeqFeature::Primer->new( -sequence => $seq,
-TARGET => '5,3' );
isa_ok $bsfp_seq, 'Bio::SeqFeature::Primer';
print("Checking to see if the BSFP object can be constructed with scalars\n") if $DEBUG;
my $bsfp_scalar = Bio::SeqFeature::Primer->new( -sequence => $primersequence,
-id => $primername,
-TARGET => '5,3' );
isa_ok $bsfp_scalar, 'Bio::SeqFeature::Primer';
print("Checking to see that seq() returns a Bio::Seq object and that the object is of the right type.\n") if $DEBUG;
isa_ok $bsfp_scalar->seq(), 'Bio::Seq';
print("First for the scalar-ily created one.\n") if $DEBUG;
print("id ok?\n") if $DEBUG;
is $bsfp_scalar->seq()->id(), $primername;
print("sequence ok?\n") if $DEBUG;
is $bsfp_scalar->seq()->seq(), $primersequence;
print("Now for the seq-ily created one\n") if $DEBUG;
print("id ok?\n") if $DEBUG;
is $bsfp_seq->seq()->display_id(), $seqname;
print("sequence ok?\n") if $DEBUG;
is $bsfp_seq->seq()->seq(), $seqsequence;