| Summary | Included libraries | Package variables | Synopsis | Description | General documentation | Methods |
| new | Description | Code |
| segment | No description | Code |
| refclass | No description | Code |
| load_from_embl | No description | Code |
| get_attributes | No description | Code |
| new | code | next | Top |
Title : new Usage : $db = Bio::DB::GFF->new(-adaptor=>'biofetch',@args) Function: create a new adaptor Returns : a Bio::DB::GFF object Args : see below Status : PublicThis is the constructor for the adaptor. It is called automatically by Bio::DB::GFF->new. In addition to arguments that are common among all adaptors, the following class-specific arguments are recgonized: Argument Description -------- ----------- -dsn the DBI data source, e.g. 'dbi:mysql:ens0040' -user username for authentication -pass the password for authentication -proxy [['http','ftp'],'http://proxy:8080']-dsn,-user and -pass indicate the local database to cache results in, and as are per Bio::DB::GFF::Adaptor::dbi. The -proxy argument allows you to set the biofetch web proxy, and uses the same syntax described for the proxy() method of Bio::DB::WebDBSeqI, except that the argument must be passed as an array reference. |
| new | description | prev | next | Top |
my $class = shift; my $self = $class->SUPER::new(@_); my ($proxy) = rearrange(['PROXY'],@_); if ($proxy) { my @args = ref($proxy) ? @$proxy : eval $proxy; $self->{_proxy} =\@ args if @args; } $self;}
| segment | description | prev | next | Top |
my $self = shift; my @segments = $self->SUPER::segment(@_); if (!@segments) { my $refclass = $self->refclass; my %args = $self->setup_segment_args(@_); if ($args{-class} && $args{-class} =~ /$refclass/oi) { return unless $self->load_from_embl('embl'=>$args{-name}); @segments = $self->SUPER::segment(@_); } elsif ($args{-class} && $args{-class} =~ /refseq|swall|embl/i) { #hack to get refseq names}
return unless $self->load_from_embl(lc($args{-class})=>$args{-name}); $args{-class} = $self->refclass; @segments = $self->SUPER::segment(%args); } } $self->_multiple_return_args(@segments);
| refclass | description | prev | next | Top |
my $self = shift; my $refname = shift; 'Accession';}
| load_from_embl | description | prev | next | Top |
my $self = shift; my $db = shift; my $acc = shift or $self->throw('Must provide an accession ID'); my $biofetch; if ($self->{_biofetch}{$db}) { $biofetch = $self->{_biofetch}{$db}; } else { $biofetch = $self->{_biofetch}{$db} = Bio::DB::BioFetch->new(-db=>$db); $biofetch->retrieval_type('tempfile'); $biofetch->proxy(@{$self->{_proxy}}) if $self->{_proxy}; } my $seq = eval {$biofetch->get_Seq_by_id($acc)} or return; my $refclass = $self->refclass; # begin loading}
$self->setup_load(); # first synthesize the entry for the top-level feature
my @aliases; foreach ($seq->accession,$seq->get_secondary_accessions) { next if lc($_) eq lc($acc); push @aliases,[Alias => $_]; } $self->load_gff_line( { ref => $acc, class => $refclass, source => 'EMBL', method => 'origin', start => 1, stop => $seq->length, score => undef, strand => '.', phase => '.', gclass => $self->refclass, gname => $acc, tstart => undef, tstop => undef, attributes => [[Note => $seq->desc],@aliases], } ); # now load each feature in turn
for my $feat ($seq->all_SeqFeatures) { my $attributes = $self->get_attributes($feat); my $first = (shift @$attributes); my $location = $feat->location; my @segments = map {[$_->start,$_->end]} $location->can('sub_Location') ? $location->sub_Location : $location; for my $segment (@segments) { $self->load_gff_line( { ref => $acc, class => $refclass, source => 'EMBL', method => $feat->primary_tag, start => $segment->[0], stop => $segment->[1], score => $feat->score || undef, strand => $feat->strand > 0 ? '+' : ($feat->strand < 0 ? '-' : '.'), phase => $feat->frame || '.', gclass => $first->[0], gname => $first->[1], tstart => undef, tstop => undef, attributes => $attributes, } ); } } # finish loading
$self->finish_load(); # now load the DNA
$self->load_sequence_string($acc,$seq->seq); 1;
| get_attributes | description | prev | next | Top |
my $self = shift; my $seq = shift; my @tags = $seq->all_tags or return; my @result; foreach my $tag (@tags) { foreach my $value ($seq->each_tag_value($tag)) { push @result,[$tag=>$value]; } }\@ result;}
| AUTHOR | Top |