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 72 73 74 75 76 77 78 79
|
use strict;
BEGIN {
use Bio::Root::Test;
test_begin(-tests => 21);
use_ok 'Bio::PrimarySeq';
use_ok 'Bio::SeqFeature::Primer';
use_ok 'Bio::SeqFeature::Amplicon';
}
my ($amplicon, $amplicon_seq, $fwd_primer, $rev_primer, $template);
# Basic amplicon object
$amplicon = Bio::SeqFeature::Amplicon->new();
isa_ok $amplicon, 'Bio::SeqFeature::Amplicon';
isa_ok $amplicon, 'Bio::SeqFeature::SubSeq';
# Amplicon with explicit sequence (sequence string)
ok $amplicon = Bio::SeqFeature::Amplicon->new(
-seq => 'CCCCCAAAAAGGGGGTTTTT',
);
ok $amplicon_seq = $amplicon->seq;
isa_ok $amplicon_seq, 'Bio::PrimarySeq';
is $amplicon_seq->seq, 'CCCCCAAAAAGGGGGTTTTT';
# Amplicon with explicit sequence (sequence object)
$fwd_primer = Bio::SeqFeature::Primer->new(
-start => 1,
-end => 4,
-strand => 1
);
$rev_primer = Bio::SeqFeature::Primer->new(
-seq => 'GATTA',
-start => 16,
-end => 20,
-strand => -1
);
ok $amplicon = Bio::SeqFeature::Amplicon->new(
-start => 1,
-end => 20,
-seq => Bio::PrimarySeq->new( -seq => 'CCCCCAAAAAGGGGGTTTTT' ),
-fwd_primer => $fwd_primer,
);
ok $amplicon->rev_primer($rev_primer);
is_deeply $amplicon->fwd_primer(), $fwd_primer;
is_deeply $amplicon->rev_primer(), $rev_primer;
ok $amplicon_seq = $amplicon->seq;
isa_ok $amplicon_seq, 'Bio::PrimarySeq';
is $amplicon_seq->seq, 'CCCCCAAAAAGGGGGTTTTT';
# Amplicon with implicit sequence
$template = Bio::Seq->new( -seq => 'ATCGATCGATCCCCCAAAAAGGGGGTTTTTAGCTAGCTAT');
ok $amplicon = Bio::SeqFeature::Amplicon->new(
-start => 11,
-end => 30,
-strand => -1
);
ok $template->add_SeqFeature($amplicon);
ok $amplicon_seq = $amplicon->seq;
isa_ok $amplicon_seq, 'Bio::PrimarySeq';
is $amplicon_seq->seq, 'AAAAACCCCCTTTTTGGGGG';
|