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

« back to all changes in this revision

Viewing changes to t/LiveSeq/LiveSeq.t

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-03-10 07:19:11 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090310071911-fukqzw54pyb1f0bd
Tags: 1.6.0-2
* Removed patch system (not used):
  - removed instuctions in debian/rules;
  - removed quilt from Build-Depends in debian/control.
* Re-enabled tests:
  - uncommented test command in debian/rules;
  - uncommented previously missing build-dependencies in debian/control.
  - Re-enabled tests and uncommented build-dependencies accordingly.
* Removed libmodule-build-perl and libtest-harness-perl from
  Build-Depends-Indep (provided by perl-modules).
* Better cleaning of empty directories using find -type d -empty -delete
  instead of rmdir in debian/rules (LP: #324001).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*-Perl-*- Test Harness script for Bioperl
 
2
# $Id: LiveSeq.t 15112 2008-12-08 18:12:38Z sendu $
 
3
 
 
4
 
 
5
use strict;
 
6
 
 
7
BEGIN {     
 
8
    use lib '.';
 
9
    use Bio::Root::Test;
 
10
    
 
11
    test_begin(-tests => 48,
 
12
               -requires_module => 'IO::String');
 
13
        
 
14
        use_ok('Bio::LiveSeq::IO::BioPerl');
 
15
}
 
16
 
 
17
my $loader=Bio::LiveSeq::IO::BioPerl->load(-db=>"EMBL", 
 
18
                                           -file=>test_input_file('factor7.embl'));
 
19
ok $loader;
 
20
my $gene=$loader->gene2liveseq(-gene_name => "factor7");
 
21
ok $gene;
 
22
ok ref($gene), "Bio::LiveSeq::Gene";
 
23
is $gene->name, "factor7";
 
24
is $gene->get_DNA->alphabet, "dna";
 
25
is $gene->get_DNA->display_id, "HSCFVII";
 
26
is $gene->get_DNA->accession_number, "J02933";
 
27
is $gene, $gene->get_DNA->gene;
 
28
is $gene->get_DNA->desc, "Human blood coagulation factor VII gene, complete cds.";
 
29
is $gene->get_DNA->source, "Homo sapiens";
 
30
is $gene->get_DNA->start, 1;
 
31
is $gene->get_DNA->end, 12850;
 
32
is $gene->maxtranscript->start, 487;
 
33
is $gene->maxtranscript->end, 12686;
 
34
is $gene->upbound, 487;
 
35
is $gene->downbound, 12686;
 
36
ok not(defined($gene->get_Repeat_Units));
 
37
 
 
38
my @exons   = @{$gene->get_Exons};
 
39
my @introns = @{$gene->get_Introns};
 
40
is scalar(@exons), 9;
 
41
is scalar(@introns), 8;
 
42
is $introns[4]->desc, "Intron D";
 
43
is $introns[4]->start, 6592;
 
44
is $introns[4]->end, 8306;
 
45
is $exons[1]->desc, "optional";
 
46
is $exons[4]->end, 6591;
 
47
 
 
48
my $transcript  = $gene->get_Transcripts->[0];
 
49
my $translation = $gene->get_Translations->[0];
 
50
is $transcript , $translation->get_Transcript;
 
51
is $translation , $transcript->get_Translation;
 
52
 
 
53
@exons = $transcript->all_Exons;
 
54
is $exons[4]->end , 6591;
 
55
is $exons[4]->length , 114;
 
56
is $transcript->upstream_seq, "tcaacaggcaggggcagcactgcagagatttcatc";
 
57
is substr($transcript->downstream_seq,0,16), "cccagcagccctggcc";
 
58
is $transcript->position($transcript->label(666)), 666;
 
59
is $transcript->position($transcript->label(666),9419), 95;
 
60
is $transcript->labelsubseq(8447,undef,9419), "gt";
 
61
is $transcript->labelsubseq(8447,2), "gt";
 
62
is $gene->get_DNA->labelsubseq(8447,2), "gg";
 
63
is substr($gene->get_DNA->labelsubseq(8447,undef,9419),0,16), "ggtgaccaggcttcat";
 
64
is $gene->get_DNA, $transcript->{seq};
 
65
my ($nothing,$whichexon) = $transcript->in_which_Exon(9419);
 
66
is $whichexon , 7;
 
67
is $transcript->frame(9419) , 1;
 
68
is $transcript->frame(9420) , 2;
 
69
is substr($translation->seq,0,16), "MVSQALRLLCLLLGLQ";
 
70
is substr($transcript->seq,0,32), "atggtctcccaggccctcaggctcctctgcct";
 
71
ok $transcript->translation_table(2);
 
72
is $transcript->translation_table , 2;
 
73
is substr($translation->seq,0,16), "MVSQAL*"; # mitochondrial table creates stop codon
 
74
is $gene->verbose(2), 2;
 
75
ok $gene->delete_Obj(); # to free all memory, deleting circular references