~ubuntu-branches/ubuntu/trusty/bioperl/trusty

« back to all changes in this revision

Viewing changes to t/SeqFeature/Amplicon.t

  • Committer: Package Import Robot
  • Author(s): Charles Plessy
  • Date: 2013-09-22 13:39:48 UTC
  • mfrom: (3.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20130922133948-c6z62zegjyp7ztou
Tags: 1.6.922-1
* New upstream release.
* Replaces and Breaks grinder (<< 0.5.3-3~) because of overlaping contents.
  Closes: #722910
* Stop Replacing and Breaking bioperl ( << 1.6.9 ): not needed anymore. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
use strict;
 
2
 
 
3
BEGIN {
 
4
    use lib '.';
 
5
    use Bio::Root::Test;
 
6
    
 
7
    test_begin(-tests => 21);
 
8
 
 
9
    use_ok 'Bio::PrimarySeq';
 
10
    use_ok 'Bio::SeqFeature::Primer';
 
11
    use_ok 'Bio::SeqFeature::Amplicon';
 
12
}
 
13
 
 
14
my ($amplicon, $amplicon_seq, $fwd_primer, $rev_primer, $template);
 
15
 
 
16
 
 
17
# Basic amplicon object
 
18
 
 
19
$amplicon = Bio::SeqFeature::Amplicon->new();
 
20
isa_ok $amplicon, 'Bio::SeqFeature::Amplicon';
 
21
isa_ok $amplicon, 'Bio::SeqFeature::SubSeq';
 
22
 
 
23
 
 
24
# Amplicon with explicit sequence (sequence string)
 
25
 
 
26
ok $amplicon = Bio::SeqFeature::Amplicon->new(
 
27
    -seq => 'CCCCCAAAAAGGGGGTTTTT',
 
28
);
 
29
ok $amplicon_seq = $amplicon->seq;
 
30
isa_ok $amplicon_seq, 'Bio::PrimarySeq';
 
31
is $amplicon_seq->seq, 'CCCCCAAAAAGGGGGTTTTT';
 
32
 
 
33
 
 
34
# Amplicon with explicit sequence (sequence object)
 
35
 
 
36
$fwd_primer = Bio::SeqFeature::Primer->new(
 
37
    -start  => 1,
 
38
    -end    => 4,
 
39
    -strand => 1
 
40
);
 
41
 
 
42
$rev_primer = Bio::SeqFeature::Primer->new(
 
43
    -seq    => 'GATTA',
 
44
    -start  => 16,
 
45
    -end    => 20,
 
46
    -strand => -1
 
47
);
 
48
 
 
49
ok $amplicon = Bio::SeqFeature::Amplicon->new(
 
50
    -start      => 1,
 
51
    -end        => 20,
 
52
    -seq        => Bio::PrimarySeq->new( -seq => 'CCCCCAAAAAGGGGGTTTTT' ),
 
53
    -fwd_primer => $fwd_primer,
 
54
);
 
55
 
 
56
ok $amplicon->rev_primer($rev_primer);
 
57
 
 
58
is_deeply $amplicon->fwd_primer(), $fwd_primer;
 
59
is_deeply $amplicon->rev_primer(), $rev_primer;
 
60
 
 
61
ok $amplicon_seq = $amplicon->seq;
 
62
isa_ok $amplicon_seq, 'Bio::PrimarySeq';
 
63
is $amplicon_seq->seq, 'CCCCCAAAAAGGGGGTTTTT';
 
64
 
 
65
 
 
66
# Amplicon with implicit sequence
 
67
 
 
68
$template = Bio::Seq->new( -seq => 'ATCGATCGATCCCCCAAAAAGGGGGTTTTTAGCTAGCTAT');
 
69
 
 
70
ok $amplicon = Bio::SeqFeature::Amplicon->new(
 
71
    -start  => 11,
 
72
    -end    => 30,
 
73
    -strand => -1
 
74
);
 
75
 
 
76
ok $template->add_SeqFeature($amplicon);
 
77
 
 
78
ok $amplicon_seq = $amplicon->seq;
 
79
isa_ok $amplicon_seq, 'Bio::PrimarySeq';
 
80
is $amplicon_seq->seq, 'AAAAACCCCCTTTTTGGGGG';