lib/Bio/DB/GFF/Adaptor/dbi/oracleace.pm

filter: Statementstmt 26.8% 11 / 41 Branchbran 0.0% 0 / 22 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 3 / 6 Podpod 100% 3 / 3 totaltotal 23.6% 17 / 72 CC 12 SCAR 34.9
CC
12
Cov
17%
new
56.0
make_object
30.0
get_dna
6.0
CRAP 32.8
« lib/Bio/DB/GFF/Adaptor/dbi/mysqlace.pm ↑ Summary lib/Bio/DB/Ace.pm »
1 package Bio::DB::GFF::Adaptor::dbi::oracleace;
2 1 $Bio::DB::GFF::Adaptor::dbi::oracleace::VERSION = '1.7.3';
3 =head1 NAME
4  
5 Bio::DB::GFF::Adaptor::dbi::oracleace -- Unholy union between oracle GFF database and acedb database
6  
7 =head1 SYNOPSIS
8  
9 Pending
10  
11 See L<Bio::DB::GFF> and L<Bio::DB::GFF::Adaptor::dbi::oracle>
12  
13 =head1 SEE ALSO
14  
15 L<Bio::DB::GFF>, L<bioperl>
16  
17 =head1 AUTHOR
18  
19 Lincoln Stein E<lt>lstein@cshl.orgE<gt>.
20  
21 Copyright (c) 2002 Cold Spring Harbor Laboratory.
22  
23 This library is free software; you can redistribute it and/or modify
24 it under the same terms as Perl itself.
25  
26 =cut
27  
28 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
29 1 ▶use Bio::DB::GFF::Util::Rearrange; # for rearrange()
Subroutine BEGIN: called CC=1 SCAR=0.0
30  
31 1 ▶use base qw(Bio::DB::GFF::Adaptor::ace Bio::DB::GFF::Adaptor::dbi::oracle);
Subroutine BEGIN: called CC=1 SCAR=0.0
32  
33 # Create a new Bio::DB::GFF::Adaptor::dbi object
34 0 ▶sub new {
Subroutine new: not called CC=7 SCAR=40.3
Pod documented
35 0 my $class = shift;
36 0 my $self = $class->SUPER::new(@_);
37 0 my ($dna_db,$acedb) = rearrange([[qw(DNADB DNA FASTA FASTA_DIR)],'ACEDB'],@_);
38 0 ▶ if ($dna_db) {
Branch: 1 branch
BranchTrueFalseTotal
if ($dna_db) 0 0 0
39 0 ▶ if (!ref($dna_db)) {
Branch: 1 branch
BranchTrueFalseTotal
if (not ref $dna_db) { } 0 0 0
40 0 require Bio::DB::Fasta;
41 0 my $fasta_dir = $dna_db;
42 0 $dna_db = Bio::DB::Fasta->new($fasta_dir);
43 0 ▶ $dna_db or $class->throw("new(): Failed to create new Bio::DB::Fasta from files in $fasta_dir");
Branch: 1 branch
BranchTrueFalseTotal
$dna_db or $class->throw("new(): Failed to create new Bio::DB::Fasta from files in $fasta_dir") 0 0 0
44 } else {
45 0 ▶ $dna_db->isa('Bio::DB::Fasta') or $class->throw("new(): $dna_db is not a Bio::DB::Fasta object");
Branch: 1 branch
BranchTrueFalseTotal
$dna_db->isa("Bio::DB::Fasta") or $class->throw("new(): $dna_db is not a Bio::DB::Fasta object") 0 0 0
46 }
47 0 $self->dna_db($dna_db);
48 }
49  
50 0 ▶ if ($acedb) {
Branch: 1 branch
BranchTrueFalseTotal
if ($acedb) 0 0 0
51 0 ▶ $acedb->isa('Ace') or $class->throw("$acedb is not an acedb accessor object");
Branch: 1 branch
BranchTrueFalseTotal
$acedb->isa("Ace") or $class->throw("$acedb is not an acedb accessor object") 0 0 0
52 0 $self->acedb($acedb);
53 }
54 0 $self;
55 }
56  
57 0 ▶sub make_object {
Subroutine make_object: not called CC=5 SCAR=34.0
Pod documented
58 0 my $self = shift;
59 0 my ($class,$name,$start,$stop) = @_;
60  
61 0 ▶ if (my $db = $self->acedb) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $db = $self->acedb) 0 0 0
62  
63 # for Notes we just return a text, no database associated
64 0 ▶ return $class->new(Text=>$name) if $class eq 'Note';
Branch: 1 branch
BranchTrueFalseTotal
if $class eq "Note" 0 0 0
65  
66 # for homols, we create the indicated Protein or Sequence object
67 # then generate a bogus Homology object (for future compatability??)
68 0 ▶ if ($start ne '') {
Branch: 1 branch
BranchTrueFalseTotal
if ($start ne "") 0 0 0
69 0 require Ace::Sequence::Homol;
70 0 return Ace::Sequence::Homol->new_homol($class,$name,$db,$start,$stop);
71 }
72  
73 # General case:
74 0 my $obj = $db->class->new($class=>$name,$self->acedb);
75  
76 0 ▶ return $obj if defined $obj;
Branch: 1 branch
BranchTrueFalseTotal
if defined $obj 0 0 0
77  
78 # Last resort, return a Text
79 0 return $class->new(Text=>$name);
80 }
81  
82 0 return $self->SUPER::make_object($class,$name,$start,$stop);
83 }
84  
85 0 ▶sub get_dna {
Subroutine get_dna: not called CC=2 SCAR=17.9
Pod documented
86 0 my $self = shift;
87 0 my ($ref,$start,$stop,$class) = @_;
88 0 ▶ my $dna_db = $self->dna_db or return $self->SUPER::get_dna(@_);
Branch: 1 branch
BranchTrueFalseTotal
my $dna_db = $self->dna_db or return $self->SUPER::get_dna(@_) 0 0 0
89 0 return $dna_db->seq($ref,$start,$stop,$class);
90 }
91  
92 =head2 freshen_ace
93  
94 Title : freshen
95 Usage : $flag = Bio::DB::GFF->freshen_ace;
96 Function: Refresh internal acedb handle
97 Returns : flag if correctly freshened
98 Args : none
99 Status : Public
100  
101 ACeDB has an annoying way of timing out, leaving dangling database
102 handles. This method will invoke the ACeDB reopen() method, which
103 causes dangling handles to be refreshed. It has no effect if you are
104 not using ACeDB to create ACeDB objects.
105  
106 =cut
107  
108 1 1;
« lib/Bio/DB/GFF/Adaptor/dbi/mysqlace.pm ↑ Summary lib/Bio/DB/Ace.pm »