| 1 | package Bio::ToolBox::SeqFeature; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use Carp qw(carp cluck croak confess); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use constant { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 2 | SEQID => 0, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | START => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | STOP => 2, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | STRND => 3, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | NAME => 4, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | ID => 5, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | TYPE => 6, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | SRC => 7, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | SCORE => 8, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | PHASE => 9, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | ATTRB => 10, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | SUBF => 11, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 2 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 2 | our $VERSION = '2.03'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | #### Aliases #### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | # to maintain compatibility with Bio::SeqFeature::Lite and Bio::SeqFeatureI we | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | # put in plenty of aliases to some of the methods | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 2 | *stop = \&end; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 2 | *name = \&display_name; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 2 | *id = \&primary_id; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 2 | *method = \&primary_tag; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 2 | *source = \&source_tag; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 2 | *add_segment = \&add_SeqFeature; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 2 | *get_all_SeqFeatures = *segments = \&get_SeqFeatures; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 2 | *each_tag_value = \&get_tag_values; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 2 | *get_all_tags = \&all_tags; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 2 | *gff3_string = \&gff_string; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | # avoid once warning errors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 2 | *stop if 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 2 | *name if 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 2 | *id if 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 2 | *method if 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 2 | *source if 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 2 | *add_segment if 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 2 | *get_all_SeqFeatures if 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 2 | *segments if 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 2 | *each_tag_value if 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 2 | *get_all_tags if 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 2 | *gff3_string if 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | #### METHODS #### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 1696 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=39 SCAR=42.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 1696 | my $class = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 1696 | ▶ | if ( ref $class ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 761 | $class = ref $class; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 1696 | my %args = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 1696 | my $self = bless [], $class; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | # bless ourselves early to take advantage of some methods | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | # but otherwise do what we can simply and quickly | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | # primary options | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | $self->[SEQID] = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | $args{-seq_id} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | || $args{-seqid} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | || $args{'-ref'} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | || $args{chrom} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 1696 | ▶ | || undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition36%4/11
$args{'-seq_id'} || $args{'-seqid'} || $args{'-ref'} || $args{'chrom'} || undef
$args{"-seq_id"} or $args{"-seqid"} or $args{"-ref"} or $args{"chrom"}
$args{"-seq_id"} or $args{"-seqid"} or $args{"-ref"}
$args{"-seq_id"} or $args{"-seqid"}
MC/DC0%0/4
$args{'-seq_id'} || $args{'-seqid'} || $args{'-ref'} || $args{'chrom'} || undef
$args{"-seq_id"}
$args{"-seqid"}
$args{"-ref"}
$args{"chrom"}
Truth table20%1/5
A or B or C or D
A= $args{"-seq_id"}B= $args{"-seqid"}C= $args{"-ref"}D= $args{"chrom"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 1696 | ▶ | $self->[START] = int $args{-start} || undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
int $args{'-start'} || undef
MC/DC0%0/1
int $args{'-start'} || undef
int $args{'-start'}
Truth table50%1/2
A
A= int $args{'-start'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 1696 | ▶ | $self->[STOP] = int $args{-end} || $args{-stop} || undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition40%2/5
int $args{'-end'} || $args{'-stop'} || undef
int $args{"-end"} or $args{"-stop"}
MC/DC0%0/2
int $args{'-end'} || $args{'-stop'} || undef
int $args{"-end"}
$args{"-stop"}
Truth table33%1/3
A or B
A= int $args{"-end"}B= $args{"-stop"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 1696 | ▶ | $self->[NAME] = $args{-display_name} || $args{-name} || undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%5/5
$args{'-display_name'} || $args{'-name'} || undef
$args{"-display_name"} or $args{"-name"}
MC/DC100%2/2
$args{'-display_name'} || $args{'-name'} || undef
$args{"-display_name"}
$args{"-name"}
Truth table100%3/3
A or B
A= $args{"-display_name"}B= $args{"-name"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 1696 | ▶ | $self->[ID] = $args{-primary_id} || $args{-id} || undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%5/5
$args{'-primary_id'} || $args{'-id'} || undef
$args{"-primary_id"} or $args{"-id"}
MC/DC100%2/2
$args{'-primary_id'} || $args{'-id'} || undef
$args{"-primary_id"}
$args{"-id"}
Truth table100%3/3
A or B
A= $args{"-primary_id"}B= $args{"-id"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 1696 | ▶ | if ( exists $args{-strand} and defined $args{-strand} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
exists $args{"-strand"} and defined $args{"-strand"}
MC/DC0%0/2
exists $args{"-strand"} and defined $args{"-strand"}
exists $args{"-strand"}
defined $args{"-strand"}
Truth table33%1/3
A and B
A= exists $args{"-strand"}B= defined $args{"-strand"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 1696 | $self->strand( $args{-strand} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | # check orientation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 1696 | ▶ | if ( defined $self->[START] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
defined $self->[1] and defined $self->[2] and $self->[1] > $self->[2]
defined $self->[1] and defined $self->[2]
MC/DC0%0/3
defined $self->[1] and defined $self->[2] and $self->[1] > $self->[2]
defined $self->[1]
defined $self->[2]
$self->[1] > $self->[2]
Truth table25%1/4
A and B and C
A= defined $self->[1]B= defined $self->[2]C= $self->[1] > $self->[2]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | and defined $self->[STOP] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | and $self->[START] > $self->[STOP] ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | # flip the coordinates around | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 0 | ( $self->[START], $self->[STOP] ) = ( $self->[STOP], $self->[START] ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | ▶ | if ( defined $self->[STRND] ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | $self->[STRND] *= -1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | $self->[STRND] = -1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | # additional options | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 1696 | ▶ | $args{-type} ||= $args{-primary_tag} || undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%5/5
$args{"-type"} ||= $args{"-primary_tag"} || undef
$args{'-primary_tag'} || undef
MC/DC100%2/2
$args{"-type"} ||= $args{"-primary_tag"} || undef
$args{"-type"}
$args{'-primary_tag'}
Truth table100%3/3
A ||= B
A= $args{"-type"}B= $args{'-primary_tag'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 1696 | ▶ | if ( defined $args{-type} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 1680 | $self->type( $args{-type} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 1696 | ▶ | $args{-source} ||= $args{-source_tag} || undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%5/5
$args{"-source"} ||= $args{"-source_tag"} || undef
$args{'-source_tag'} || undef
MC/DC100%2/2
$args{"-source"} ||= $args{"-source_tag"} || undef
$args{"-source"}
$args{'-source_tag'}
Truth table100%3/3
A ||= B
A= $args{"-source"}B= $args{'-source_tag'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 1696 | ▶ | if ( defined $args{-source} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 1447 | $self->[SRC] = $args{-source}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 1696 | ▶ | if ( exists $args{-score} and defined $args{-score} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
exists $args{"-score"} and defined $args{"-score"}
MC/DC100%2/2
exists $args{"-score"} and defined $args{"-score"}
exists $args{"-score"}
defined $args{"-score"}
Truth table100%3/3
A and B
A= exists $args{"-score"}B= defined $args{"-score"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 16 | $self->[SCORE] = $args{-score}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 1696 | ▶ | if ( exists $args{-phase} and defined $args{-phase} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
exists $args{"-phase"} and defined $args{"-phase"}
MC/DC50%1/2
exists $args{"-phase"} and defined $args{"-phase"}
exists $args{"-phase"}
defined $args{"-phase"}
Truth table66%2/3
A and B
A= exists $args{"-phase"}B= defined $args{"-phase"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 278 | $self->phase( $args{-phase} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 1696 | ▶ | if ( exists $args{-attributes} or exists $args{-tags} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
exists $args{"-attributes"} or exists $args{"-tags"}
MC/DC50%1/2
exists $args{"-attributes"} or exists $args{"-tags"}
exists $args{"-attributes"}
exists $args{"-tags"}
Truth table66%2/3
A or B
A= exists $args{"-attributes"}B= exists $args{"-tags"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 1 | ▶ | $args{-attributes} ||= $args{-tags}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$args{"-attributes"} ||= $args{"-tags"}
MC/DC0%0/2
$args{"-attributes"} ||= $args{"-tags"}
$args{"-attributes"}
$args{"-tags"}
Truth table33%1/3
A ||= B
A= $args{"-attributes"}B= $args{"-tags"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 1 | ▶ | if ( $args{-attributes} and ref( $args{-attributes} ) eq 'HASH' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$args{"-attributes"} and ref $args{"-attributes"} eq "HASH"
MC/DC0%0/2
$args{"-attributes"} and ref $args{"-attributes"} eq "HASH"
$args{"-attributes"}
ref $args{"-attributes"} eq "HASH"
Truth table33%1/3
A and B
A= $args{"-attributes"}B= ref $args{"-attributes"} eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 1 | $self->[ATTRB] = $args{-attributes}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 1696 | ▶ | if ( exists $args{-segments} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%4/6
exists $args{"-segments"} and $args{"-segments"} and ref $args{"-segments"} eq "ARRAY"
exists $args{"-segments"} and $args{"-segments"}
MC/DC33%1/3
exists $args{"-segments"} and $args{"-segments"} and ref $args{"-segments"} eq "ARRAY"
exists $args{"-segments"}
$args{"-segments"}
ref $args{"-segments"} eq "ARRAY"
Truth table50%2/4
A and B and C
A= exists $args{"-segments"}B= $args{"-segments"}C= ref $args{"-segments"} eq "ARRAY"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | and $args{-segments} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | and ref( $args{-segments} ) eq 'ARRAY' ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 2 | $self->[SUBF] = []; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 2 | foreach my $s ( @{ $args{-segments} } ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 16 | ▶ | unless ( ref($s) eq $class ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | croak "FATAL: segments should be passed as $class objects!"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 16 | push @{ $self->[SUBF] }, $s; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 1696 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 2076 | ▶ | sub seq_id { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
seq_id: called CC=3 SCAR=12.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 2076 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 2076 | ▶ | if ( defined $_[0] ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 0 | $self->[SEQID] = $_[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 2076 | ▶ | return defined $self->[SEQID] ? $self->[SEQID] : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 7382 | ▶ | sub start { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
start: called CC=3 SCAR=12.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 7382 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 7382 | ▶ | if ( defined $_[0] ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 0 | $self->[START] = int $_[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 7382 | ▶ | return defined $self->[START] ? $self->[START] : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 2657 | ▶ | sub end { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
end: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 2657 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 2657 | ▶ | if ( defined $_[0] ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 9 | $self->[STOP] = int $_[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 2657 | ▶ | return defined $self->[STOP] ? $self->[STOP] : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 4556 | ▶ | sub strand { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
strand: called CC=8 SCAR=20.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 4556 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 4556 | ▶ | if ( defined $_[0] ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 1737 | my $str = $_[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 1737 | ▶ | if ( $str eq '+' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 5 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 262 | $self->[STRND] = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | elsif ( $str eq '-' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 116 | $self->[STRND] = -1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | elsif ( $str eq '.' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 16 | $self->[STRND] = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | elsif ( $str =~ /^[\+\-]?1$/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | 1245 | $self->[STRND] = $str; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | elsif ( $str eq '0' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 98 | $self->[STRND] = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 4556 | ▶ | return defined $self->[STRND] ? $self->[STRND] : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 1808 | ▶ | sub display_name { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
display_name: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 1808 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 1808 | ▶ | if ( defined $_[0] ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 225 | $self->[NAME] = $_[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 1808 | ▶ | return defined $self->[NAME] ? $self->[NAME] : $self->primary_id; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 2447 | ▶ | sub primary_id { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
primary_id: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | 2447 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 2447 | ▶ | if ( defined $_[0] ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 443 | $self->[ID] = $_[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | elsif ( not defined $self->[ID] ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | # automatically assign a new ID | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | 1 | $self->[ID] = | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | sprintf( "%s:%d-%d", $self->[SEQID], $self->[START], $self->[STOP] ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 2447 | return $self->[ID]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 12761 | ▶ | sub primary_tag { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
primary_tag: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | 12761 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 12761 | ▶ | if ( defined $_[0] ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 92 | $self->[TYPE] = $_[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 12761 | ▶ | return defined $self->[TYPE] ? $self->[TYPE] : 'feature'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 2414 | ▶ | sub source_tag { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
source_tag: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 2414 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | 2414 | ▶ | if ( defined $_[0] ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | 135 | $self->[SRC] = $_[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 2414 | ▶ | return defined $self->[SRC] ? $self->[SRC] : q(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 1789 | ▶ | sub type { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
type: called CC=6 SCAR=18.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | 1789 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 1789 | ▶ | if ( defined $_[0] ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | 1680 | my $type = $_[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 1680 | ▶ | if ( $type =~ /:/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | 0 | my ( $t, $s ) = split /:/, $type; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | $self->[TYPE] = $t; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | 0 | $self->[SRC] = $s; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 1680 | $self->[TYPE] = $type; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 1789 | ▶ | $self->[TYPE] ||= undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->[6] ||= undef
MC/DC0%0/1
$self->[6] ||= undef
$self->[6]
Truth table50%1/2
A
A= $self->[6]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | 1789 | ▶ | $self->[SRC] ||= undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->[7] ||= undef
MC/DC100%1/1
$self->[7] ||= undef
$self->[7]
Truth table100%2/2
A
A= $self->[7]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | 1789 | ▶ | if ( defined $self->[SRC] ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | 91 | return join( ':', $self->[TYPE], $self->[SRC] ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 1698 | return $self->[TYPE]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | 318 | ▶ | sub score { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
score: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | 318 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | 318 | ▶ | if ( defined $_[0] ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 68 | $self->[SCORE] = $_[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 318 | ▶ | return defined $self->[SCORE] ? $self->[SCORE] : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 715 | ▶ | sub phase { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
phase: called CC=4 SCAR=14.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 715 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | 715 | ▶ | if ( defined $_[0] ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | 394 | my $p = $_[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | 394 | ▶ | unless ( $p =~ /^[012\.]$/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 0 | carp 'ERROR: phase must be 0, 1, 2 or .!'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | 394 | $self->[PHASE] = $p; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | 715 | ▶ | return defined $self->[PHASE] ? $self->[PHASE] : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | 471 | ▶ | sub duplicate { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
duplicate: called CC=3 SCAR=11.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | 471 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | 471 | my $n = $self->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | -seq_id => $self->[SEQID], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | -start => $self->[START], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | -end => $self->[STOP], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | -strand => $self->strand, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | -type => $self->primary_tag, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | -source => $self->source_tag, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | -display_name => $self->name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | 471 | ▶ | $n->score( $self->[SCORE] ) if defined $self->[SCORE]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | 471 | ▶ | $n->phase( $self->[PHASE] ) if defined $self->[PHASE]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | 471 | return $n; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | 773 | ▶ | sub add_SeqFeature { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_SeqFeature: called CC=8 SCAR=21.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | 773 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | 773 | ▶ | return unless (@_); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | 773 | ▶ | $self->[SUBF] ||= []; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->[11] ||= []
MC/DC100%1/1
$self->[11] ||= []
$self->[11]
Truth table100%2/2
A
A= $self->[11]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | 773 | my $count = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | 773 | foreach my $s (@_) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 773 | ▶ | if ( ref($s) eq ref($self) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | 773 | ▶ | $s->seq_id( $self->seq_id ) unless ( $s->seq_id ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | 773 | ▶ | $s->strand( $self->strand ) unless ( $s->strand ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | 773 | ▶ | $s->source_tag( $self->source_tag ) unless ( $s->source_tag ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | 773 | push @{ $self->[SUBF] }, $s; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | 773 | $count++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | 0 | carp 'ERROR: use SeqFeature objects when adding sub features!'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | 773 | return $count; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | 1412 | ▶ | sub get_SeqFeatures { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_SeqFeatures: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | 1412 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | 1412 | ▶ | return unless $self->[SUBF]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | 1264 | my @children; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | 1264 | foreach ( @{ $self->[SUBF] } ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | 13417 | push @children, $_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | 1264 | ▶ | return wantarray ? @children : \@children; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | 0 | ▶ | sub delete_SeqFeature { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
delete_SeqFeature: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | 0 | my $id = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | 0 | ▶ | return unless $id; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | 0 | ▶ | return unless $self->[SUBF]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | 0 | my $d; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | 0 | my $i = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | 0 | foreach ( @{ $self->[SUBF] } ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 0 | ▶ | if ( $_->[ID] eq $id ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | 0 | $d = $i; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | 0 | $i++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | 0 | ▶ | if ( defined $d ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | 0 | splice( @{ $self->[SUBF] }, $d, 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | 0 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | 813 | ▶ | sub add_tag_value { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_tag_value: called CC=6 SCAR=24.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | 813 | my ( $self, $key, $value ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | 813 | ▶ | return unless ( defined $key and defined $value ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $key and defined $value
MC/DC0%0/2
defined $key and defined $value
defined $key
defined $value
Truth table33%1/3
A and B
A= defined $keyB= defined $value
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | 813 | ▶ | $self->[ATTRB] ||= {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->[10] ||= {}
MC/DC100%1/1
$self->[10] ||= {}
$self->[10]
Truth table100%2/2
A
A= $self->[10]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | 813 | ▶ | if ( exists $self->[ATTRB]->{$key} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | 0 | ▶ | if ( ref( $self->[ATTRB]->{$key} ) eq 'ARRAY' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | 0 | push @{ $self->[ATTRB]->{$key} }, $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | 0 | my $current = $self->[ATTRB]->{$key}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | 0 | $self->[ATTRB]->{$key} = [ $current, $value ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | 813 | $self->[ATTRB]->{$key} = $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | 759 | ▶ | sub has_tag { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
has_tag: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | 759 | my ( $self, $key ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | 759 | ▶ | return unless $key; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | 759 | ▶ | return unless $self->[ATTRB]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | 627 | return exists $self->[ATTRB]->{$key}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | 400 | ▶ | sub get_tag_values { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_tag_values: called CC=6 SCAR=19.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | 400 | my ( $self, $key ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | 400 | ▶ | return unless $key; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | 400 | ▶ | return unless $self->[ATTRB]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | 373 | ▶ | if ( exists $self->[ATTRB]->{$key} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | 321 | ▶ | if ( ref( $self->[ATTRB]->{$key} ) eq 'ARRAY' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | 0 | ▶ | return wantarray ? @{ $self->[ATTRB]->{$key} } : $self->[ATTRB]->{$key}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | 321 | return $self->[ATTRB]->{$key}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | 52 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | 1 | ▶ | sub attributes { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
attributes: called CC=3 SCAR=16.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | 1 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | 1 | ▶ | return unless $self->[ATTRB]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | 0 | ▶ | return wantarray ? %{ $self->[ATTRB] } : $self->[ATTRB]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | 49 | ▶ | sub all_tags { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
all_tags: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | 49 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | 49 | ▶ | return unless $self->[ATTRB]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | 15 | my @k = keys %{ $self->[ATTRB] }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | 15 | ▶ | return wantarray ? @k : \@k; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | 0 | ▶ | sub remove_tag { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
remove_tag: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | 0 | my ( $self, $key ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | 0 | ▶ | return unless $key; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | 0 | ▶ | return unless $self->[ATTRB]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | 0 | ▶ | if ( exists $self->[ATTRB]->{$key} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | 0 | delete $self->[ATTRB]->{$key}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | ### Range Methods | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | # Borrowed from Bio::RangeI, but does not do strong/weak strand checks | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | 271 | ▶ | sub length { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
length: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | 271 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | 271 | return $self->end - $self->start + 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | 0 | ▶ | sub overlaps { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
overlaps: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | 0 | my ( $self, $other ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | 0 | ▶ | return unless ( $other and ref($other) =~ /seqfeature|range/xi ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$other and ref($other) =~ /seqfeature|range/xi
MC/DC0%0/2
$other and ref($other) =~ /seqfeature|range/xi
$other
ref($other) =~ /seqfeature|range/xi
Truth table0%0/3
A and B
A= $otherB= ref($other) =~ /seqfeature|range/xi
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | 0 | ▶ | return unless ( $self->seq_id eq $other->seq_id ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | 0 | ▶ | return not( $self->start > $other->end | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$self->start > $other->end || $self->end < $other->start
MC/DC0%0/2
$self->start > $other->end || $self->end < $other->start
$self->start > $other->end
$self->end < $other->start
Truth table0%0/3
A || B
A= $self->start > $other->endB= $self->end < $other->start
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 399 | or $self->end < $other->start ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 400 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | 0 | ▶ | sub contains { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
contains: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | 0 | my ( $self, $other ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | 0 | ▶ | return unless ( $other and ref($other) =~ /seqfeature|range/xi ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$other and ref($other) =~ /seqfeature|range/xi
MC/DC0%0/2
$other and ref($other) =~ /seqfeature|range/xi
$other
ref($other) =~ /seqfeature|range/xi
Truth table0%0/3
A and B
A= $otherB= ref($other) =~ /seqfeature|range/xi
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 405 | 0 | ▶ | return unless ( $self->seq_id eq $other->seq_id ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 406 | 0 | ▶ | return ( $other->start >= $self->start and $other->end <= $self->end ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$other->start >= $self->start && $other->end <= $self->end
MC/DC0%0/2
$other->start >= $self->start && $other->end <= $self->end
$other->start >= $self->start
$other->end <= $self->end
Truth table0%0/3
A && B
A= $other->start >= $self->startB= $other->end <= $self->end
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 407 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 408 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 409 | 0 | ▶ | sub equals { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
equals: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 410 | 0 | my ( $self, $other ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 411 | 0 | ▶ | return unless ( $other and ref($other) =~ /seqfeature|range/xi ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$other and ref($other) =~ /seqfeature|range/xi
MC/DC0%0/2
$other and ref($other) =~ /seqfeature|range/xi
$other
ref($other) =~ /seqfeature|range/xi
Truth table0%0/3
A and B
A= $otherB= ref($other) =~ /seqfeature|range/xi
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 412 | 0 | ▶ | return unless ( $self->seq_id eq $other->seq_id ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 413 | 0 | ▶ | return ( $other->start == $self->start and $other->end == $self->end ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$other->start == $self->start && $other->end == $self->end
MC/DC0%0/2
$other->start == $self->start && $other->end == $self->end
$other->start == $self->start
$other->end == $self->end
Truth table0%0/3
A && B
A= $other->start == $self->startB= $other->end == $self->end
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 414 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 415 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 416 | 0 | ▶ | sub intersection { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
intersection: not called CC=7 SCAR=40.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 417 | 0 | my ( $self, $other ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 418 | 0 | ▶ | return unless ( $other and ref($other) =~ /seqfeature|range/xi ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$other and ref($other) =~ /seqfeature|range/xi
MC/DC0%0/2
$other and ref($other) =~ /seqfeature|range/xi
$other
ref($other) =~ /seqfeature|range/xi
Truth table0%0/3
A and B
A= $otherB= ref($other) =~ /seqfeature|range/xi
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 419 | 0 | ▶ | return unless ( $self->seq_id eq $other->seq_id ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 420 | 0 | my ( $start, $stop ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 421 | 0 | ▶ | if ( $self->start >= $other->start ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 422 | 0 | $start = $self->start; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 423 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 424 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 425 | 0 | $start = $other->start; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 426 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 427 | 0 | ▶ | if ( $self->end <= $other->end ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 428 | 0 | $stop = $self->end; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 429 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 430 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 431 | 0 | $stop = $other->end; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 432 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 433 | 0 | ▶ | return if $start > $stop; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 434 | 0 | return $self->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 435 | -seq_id => $self->seq_id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 436 | -start => $start, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 437 | -end => $stop, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 438 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 439 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 440 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 441 | 0 | ▶ | sub union { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
union: not called CC=7 SCAR=40.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 442 | 0 | my ( $self, $other ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 443 | 0 | ▶ | return unless ( $other and ref($other) =~ /seqfeature|range/xi ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$other and ref($other) =~ /seqfeature|range/xi
MC/DC0%0/2
$other and ref($other) =~ /seqfeature|range/xi
$other
ref($other) =~ /seqfeature|range/xi
Truth table0%0/3
A and B
A= $otherB= ref($other) =~ /seqfeature|range/xi
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 444 | 0 | ▶ | return unless ( $self->seq_id eq $other->seq_id ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 445 | 0 | my ( $start, $stop ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 446 | 0 | ▶ | if ( $self->start <= $other->start ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 447 | 0 | $start = $self->start; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 448 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 449 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 450 | 0 | $start = $other->start; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 451 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 452 | 0 | ▶ | if ( $self->end >= $other->end ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 453 | 0 | $stop = $self->end; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 454 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 455 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 456 | 0 | $stop = $other->end; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 457 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 458 | 0 | ▶ | return if $start > $stop; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 459 | 0 | return $self->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | -seq_id => $self->seq_id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 461 | -start => $start, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 462 | -end => $stop, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 463 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 464 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 465 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 466 | 0 | ▶ | sub subtract { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
subtract: not called CC=9 SCAR=45.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 467 | 0 | my ( $self, $other ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 468 | 0 | ▶ | return unless ( $other and ref($other) =~ /seqfeature|range/xi ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$other and ref($other) =~ /seqfeature|range/xi
MC/DC0%0/2
$other and ref($other) =~ /seqfeature|range/xi
$other
ref($other) =~ /seqfeature|range/xi
Truth table0%0/3
A and B
A= $otherB= ref($other) =~ /seqfeature|range/xi
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 469 | 0 | ▶ | return unless ( $self->seq_id eq $other->seq_id ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 470 | 0 | ▶ | return if $self->equals($other); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 471 | 0 | my @pieces; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 472 | 0 | ▶ | if ( $self->overlaps($other) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 473 | 0 | my $int = $self->intersection($other); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 474 | 0 | ▶ | if ( $self->start < $int->start ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 475 | 0 | push @pieces, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 476 | $self->new( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 477 | -seq_id => $self->seq_id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 478 | -start => $self->start, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 479 | -end => $int->start - 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 480 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 481 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 482 | 0 | ▶ | if ( $self->end > $int->end ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 483 | 0 | push @pieces, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 484 | $self->new( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 485 | -seq_id => $self->seq_id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 486 | -start => $int->end + 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 487 | -end => $self->end, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 488 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 489 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 490 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 491 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 492 | 0 | push @pieces, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 493 | $self->new( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 494 | -seq_id => $self->seq_id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 495 | -start => $self->start, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 496 | -end => $self->end, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 497 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 498 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 499 | 0 | ▶ | return wantarray ? @pieces : \@pieces; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 500 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 501 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 502 | ### Export methods | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 503 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 504 | 2 | ▶ | sub version { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
version: called CC=3 SCAR=13.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 505 | 2 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 506 | 2 | ▶ | if ( @_ and $_[0] ne '3' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
@_ and $_[0] ne 3
MC/DC0%0/2
@_ and $_[0] ne 3
@_
$_[0] ne 3
Truth table33%1/3
A and B
A= @_B= $_[0] ne 3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 507 | 0 | carp 'sorry, only GFF version 3 is currently supported!'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 508 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 509 | 2 | return 3; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 510 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 511 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 512 | 101 | ▶ | sub gff_string { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
gff_string: called CC=28 SCAR=36.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 513 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 514 | # exports version 3 GFF, sorry, no mechanism for others.... | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 515 | 101 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 516 | 101 | ▶ | my $recurse = shift || 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
shift() || 0
MC/DC0%0/1
shift() || 0
shift()
Truth table50%1/2
A
A= shift()
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 517 | 101 | ▶ | my $childIDs = shift || undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
shift() || undef
MC/DC100%1/1
shift() || undef
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 518 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 519 | # skip myself if we've already printed myself | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 520 | return if ( $recurse | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 521 | and $childIDs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 522 | 101 | ▶ | and not exists $childIDs->{ $self->primary_id } ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
$recurse and $childIDs and not exists $$childIDs{$self->primary_id}
$recurse and $childIDs
MC/DC66%2/3
$recurse and $childIDs and not exists $$childIDs{$self->primary_id}
$recurse
$childIDs
not exists $$childIDs{$self->primary_id}
Truth table75%3/4
A and B and not(C)
A= $recurseB= $childIDsC= not exists $$childIDs{$self->primary_id}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 523 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 524 | # map all parent-child relationships | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 525 | 49 | ▶ | if ( $recurse and not defined $childIDs ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$recurse and not defined $childIDs
MC/DC50%1/2
$recurse and not defined $childIDs
$recurse
not defined $childIDs
Truth table66%2/3
A and not(B)
A= $recurseB= not defined $childIDs
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 526 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 527 | # we have a top level SeqFeature and we need to go spelunking for IDs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 528 | 2 | $childIDs = {}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 529 | 2 | foreach my $f ( $self->get_SeqFeatures ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 530 | 14 | $f->_spelunk( $self->primary_id, $childIDs ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 531 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 532 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 533 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 534 | # basics | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 535 | 49 | ▶ | my $string = join( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
Condition50%4/8
$self->seq_id || '.'
$self->source_tag || '.'
$self->start || 1
$self->end || 1
MC/DC0%0/1
$self->seq_id || '.'
$self->seq_id
MC/DC0%0/1
$self->source_tag || '.'
$self->source_tag
MC/DC0%0/1
$self->start || 1
$self->start
MC/DC0%0/1
$self->end || 1
$self->end
Truth table50%1/2
A
A= $self->seq_id
Truth table50%1/2
A
A= $self->source_tag
Truth table50%1/2
A
A= $self->start
Truth table50%1/2
A
A= $self->end
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 536 | "\t", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 537 | ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 538 | $self->seq_id || '.', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 539 | $self->source_tag || '.', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 540 | $self->primary_tag, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 541 | $self->start || 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 542 | $self->end || 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 543 | defined $self->score ? $self->score : '.', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 544 | $self->strand > 0 ? '+' : $self->strand < 0 ? '-' : '.', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 545 | defined $self->phase ? $self->phase : '.', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 546 | ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 547 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 548 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 549 | # group attributes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 550 | 49 | my $attributes; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 551 | 49 | my $name = $self->display_name; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 552 | 49 | ▶ | if ($name) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 553 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 554 | # names are optional and may not exist | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 555 | 49 | $attributes = sprintf "Name=%s;ID=%s", $self->_encode($name), | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 556 | $self->_encode( $self->primary_id ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 557 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 558 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 559 | # IDs always exist | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 560 | 0 | $attributes = sprintf "ID=%s", $self->_encode( $self->primary_id ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 561 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 562 | 49 | ▶ | if ($childIDs) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 563 | 49 | ▶ | if ( exists $childIDs->{ $self->primary_id } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 564 | $attributes .= ';Parent=' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 565 | . join( ',', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 566 | 100 | sort { $a cmp $b } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 567 | 99 | map { $self->_encode($_) } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 568 | 47 | keys %{ $childIDs->{ $self->primary_id } } ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 569 | 47 | delete $childIDs->{ $self->primary_id }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 570 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 571 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 572 | 49 | foreach my $tag ( $self->all_tags ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 573 | 67 | ▶ | next if $tag eq 'Name'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 574 | 67 | ▶ | next if $tag eq 'ID'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 575 | 67 | ▶ | next if $tag eq 'Parent'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 576 | 53 | my $value = $self->get_tag_values($tag); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 577 | 53 | ▶ | if ( ref($value) eq 'ARRAY' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 578 | 0 | $value = join( ',', map { $self->_encode($_) } @{$value} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 579 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 580 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 581 | 53 | $value = $self->_encode($value); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 582 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 583 | 53 | $attributes .= ";$tag=$value"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 584 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 585 | 49 | $string .= "\t$attributes\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 586 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 587 | # recurse | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 588 | 49 | ▶ | if ($recurse) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 589 | 49 | foreach my $f ( $self->get_SeqFeatures ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 590 | 99 | my $s = $f->gff_string( 1, $childIDs ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 591 | 99 | ▶ | $string .= $s if $s; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 592 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 593 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 594 | 49 | return $string; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 595 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 596 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 597 | 250 | ▶ | sub _encode { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_encode: called CC=1 SCAR=0.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 598 | 250 | my ( $self, $value ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 599 | 0 | $value =~ s/( [\t\n\r%&\=;,\ ] ) /sprintf("%%%X", ord($1) )/xge; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 600 | 250 | return $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 601 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 602 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 603 | 99 | ▶ | sub _spelunk { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_spelunk: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 604 | 99 | my ( $self, $parentID, $childIDs ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 605 | 99 | $childIDs->{ $self->primary_id }{$parentID} += 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 606 | 99 | foreach my $f ( $self->get_SeqFeatures ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 607 | 85 | $f->_spelunk( $self->primary_id, $childIDs ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 608 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 609 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 610 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 611 | 0 | ▶ | sub bed_string { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
bed_string: not called CC=7 SCAR=40.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 612 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 613 | 0 | ▶ | my $string = join( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/9
$self->seq_id || '.'
$self->start || 1
$self->end || 1
$self->display_name || $self->primary_id
MC/DC0%0/1
$self->seq_id || '.'
$self->seq_id
MC/DC0%0/1
$self->start || 1
$self->start
MC/DC0%0/1
$self->end || 1
$self->end
MC/DC0%0/2
$self->display_name || $self->primary_id
$self->display_name
$self->primary_id
Truth table0%0/2
A
A= $self->seq_id
Truth table0%0/2
A
A= $self->start
Truth table0%0/2
A
A= $self->end
Truth table0%0/3
A || B
A= $self->display_nameB= $self->primary_id
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 614 | "\t", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 615 | ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 616 | $self->seq_id || '.', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 617 | ( $self->start || 1 ) - 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 618 | $self->end || 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 619 | $self->display_name || $self->primary_id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 620 | defined $self->score ? $self->score : 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 621 | $self->strand >= 0 ? '+' : '-', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 622 | ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 623 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 624 | 0 | return "$string\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 625 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 626 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 627 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 628 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 629 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||