| 1 | package Bio::DB::GFF::Adaptor::memory::feature_serializer; | ||||||||||
| 2 | 5 | $Bio::DB::GFF::Adaptor::memory::feature_serializer::VERSION = '1.7.4'; | |||||||||
| 3 | |||||||||||
| 4 | =head1 NAME | ||||||||||
| 5 | |||||||||||
| 6 | Bio::DB::GFF::Adaptor::memory::feature_serializer - utility methods for serializing and deserializing GFF features | ||||||||||
| 7 | |||||||||||
| 8 | =cut | ||||||||||
| 9 | |||||||||||
| 10 | 5 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 5 | require Exporter; | |||||||||
| 13 | 5 | ▶ | use vars qw(@EXPORT @EXPORT_OK @hash2array_map); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | 5 | ▶ | use base qw(Exporter); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | 5 | @EXPORT_OK = qw(feature2string string2feature @hash2array_map); | |||||||||
| 16 | 5 | @EXPORT = @EXPORT_OK; | |||||||||
| 17 | |||||||||||
| 18 | 5 | @hash2array_map = qw(ref start stop source method score strand phase gclass gname tstart tstop feature_id group_id bin); | |||||||||
| 19 | |||||||||||
| 20 | 0 | ▶ | sub feature2string { | ||||||||
|
Subroutine
feature2string: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 21 | 0 | my $feature = shift; | |||||||||
| 22 | 0 | local $^W = 0; | |||||||||
| 23 | 0 | my @a = @{$feature}{@hash2array_map}; | |||||||||
| 24 | 0 | ▶ | push @a,map {join "\0",@$_} @{$feature->{attributes}} if $feature->{attributes}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | 0 | return join $;,@a; | |||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | 0 | ▶ | sub string2feature { | ||||||||
|
Subroutine
string2feature: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 29 | 0 | my $string = shift; | |||||||||
| 30 | 0 | my (@attributes,%feature); | |||||||||
| 31 | 0 | (@feature{@hash2array_map},@attributes) = split $;,$string; | |||||||||
| 32 | 0 | $feature{attributes} = [map {[split "\0",$_]} @attributes]; | |||||||||
| 33 | 0 | undef $feature{group_id}; | |||||||||
| 34 | 0 | \%feature; | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 5 | 1; | |||||||||