| 1 | package MS::Peptide; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | use overload | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 19 | ▶ | '""' => sub{ $_[0]->as_string(fmt => 'original') }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 3 | ▶ | fallback => 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 3 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 3 | ▶ | use Storable qw/dclone/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 3 | ▶ | use List::Util qw/sum/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 3 | ▶ | use MS::Mass qw/:all/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 3 | my %light = ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | '2H' => 'H', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | '13C' => 'C', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | '15N' => 'N', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | '18O' => 'O', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 3 | my %heavy = ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 'H' => '2H', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 'C' => '13C', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 'N' => '15N', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 'O' => '18O', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | sub new { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 198 | ▶ | my ($class, $seq, %args) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 198 | $seq = uc $seq; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 198 | my $self = bless {seq => $seq} => $class; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 198 | my @atoms = map {atoms('aa', $_)} (split '', $seq); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 198 | $self->{atoms} = \@atoms; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 198 | $self->{length} = CORE::length $seq; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 198 | $self->{n_mod} = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 198 | $self->{c_mod} = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | # these can be undefined if not known or specified | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 198 | $self->{prev} = $args{prev}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 198 | $self->{next} = $args{next}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 198 | $self->{start} = $args{start}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 198 | $self->{end} = $args{end}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 198 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | #----------------------------------------------------------------------------# | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | # accessors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | #----------------------------------------------------------------------------# | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 786 | ▶ | sub length { return $_[0]->{length} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
length: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 589 | ▶ | sub seq { return $_[0]->{seq} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
seq: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | #----------------------------------------------------------------------------# | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | # accessors/modifiers | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | #----------------------------------------------------------------------------# | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | sub prev { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 2 | ▶ | my ($self, $new_val) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
prev: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 2 | ▶ | $self->{prev} = $new_val if (defined $new_val); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 2 | return $self->{prev}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | sub next { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 2 | ▶ | my ($self, $new_val) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
next: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 2 | ▶ | $self->{next} = $new_val if (defined $new_val); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 2 | return $self->{next}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | sub start { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 3 | ▶ | my ($self,$new_val) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
start: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 3 | ▶ | if (defined $new_val) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 2 | ▶ | croak "Value must be numeric\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | if ($new_val =~ /\D/); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 1 | $self->{start} = $new_val; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 2 | return $self->{start}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | sub end { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 3 | ▶ | my ($self,$new_val) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
end: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 3 | ▶ | if (defined $new_val) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 2 | ▶ | croak "Value must be numeric\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | if ($new_val =~ /\D/); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 1 | $self->{end} = $new_val; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 2 | return $self->{end}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | #----------------------------------------------------------------------------# | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | sub copy { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 3 | ▶ | return dclone($_[0]); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
copy: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | sub residue_positions { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 1 | ▶ | my ($self, @res) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
residue_positions: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 1 | my $res_str = join '', @res; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 1 | my @pos = (); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 1 | my $s = $self->seq; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 1 | ▶ | while ($s =~ /[$res_str]/g) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 3 | push @pos, $-[0]+1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 1 | return \@pos; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | sub range { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 196 | ▶ | my ($self, $start, $end) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
range: called CC=12 SCAR=27.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 196 | ▶ | croak "start must be less than or equal to end" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | if ($start > $end); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 196 | ▶ | croak "coordinate(s) out of range" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%3/9
$start < 1 or $end < 1 or $start > $self->length or $end > $self->length
$start < 1 or $end < 1 or $start > $self->length
$start < 1 or $end < 1
MC/DC0%0/4
$start < 1 or $end < 1 or $start > $self->length or $end > $self->length
$start < 1
$end < 1
$start > $self->length
$end > $self->length
Truth table20%1/5
A or B or C or D
A= $start < 1B= $end < 1C= $start > $self->lengthD= $end > $self->length
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | if ($start < 1 || $end < 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | || $start > $self->length || $end > $self->length); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 196 | my $seq = substr $self->seq, $start-1, $end-$start+1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 196 | ▶ | my $pep = MS::Peptide->new( $seq, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | prev => ( $start == 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | ? '' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | : substr $self->seq, $start-2, 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | next => ( $start == $self->length | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | ? '' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | : substr $self->seq, $end, 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | start => $start, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | end => $end, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 196 | ▶ | if ($start == 1) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 3 | $pep->{n_mod} = $self->{n_mod}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 196 | ▶ | if ($end == $self->length) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 2 | $pep->{c_mod} = $self->{c_mod}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 196 | for my $i ($start..$end) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 3504 | my $i2 = $i - $start + 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 3504 | for my $mod ($self->get_mods($i)) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 0 | $pep->add_mod( $i2, $mod ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 196 | return $pep; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | sub make_heavy { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 1 | ▶ | my ($self, $loc, $atom) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
make_heavy: called CC=8 SCAR=22.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | # $loc and $atom can be scalar or arrayref | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 1 | ▶ | my @locs = ref($loc) ? @$loc : ($loc); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 1 | ▶ | my @atoms = ref($atom) ? @$atom : ($atom); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 1 | for my $i (@locs) { # 1-based residue | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | croak "Residue index out of range\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 10 | ▶ | if ( $i < 1 && $i > $self->{length}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$i < 1 and $i > $self->{"length"}
MC/DC0%0/2
$i < 1 and $i > $self->{"length"}
$i < 1
$i > $self->{"length"}
Truth table33%1/3
A and B
A= $i < 1B= $i > $self->{"length"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 10 | for my $a (@atoms) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 10 | ▶ | my $heavy = $heavy{$a} or croak "No heavy atom defined for $a\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | $self->{atoms}->[$i-1]->{$heavy} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 10 | = delete $self->{atoms}->[$i-1]->{$a}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 1 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | sub mz { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | 4 | ▶ | my ($self, %args) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
mz: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 4 | ▶ | my $type = $args{type} // 'mono'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$args{"type"} // "mono"
MC/DC100%1/1
$args{"type"} // "mono"
$args{"type"}
Truth table100%2/2
A
A= $args{"type"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | 4 | ▶ | my $z = $args{charge} // 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$args{"charge"} // 1
MC/DC100%1/1
$args{"charge"} // 1
$args{"charge"}
Truth table100%2/2
A
A= $args{"charge"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | my $M = formula_mass('H2O', $type) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 4 | + sum map {atoms_mass($_, $type)} @{ $self->{atoms} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | 4 | return ($M + $z * elem_mass('H', $type))/$z; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | sub neutral_mass { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | 3 | ▶ | my ($self, %args) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
neutral_mass: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 3 | ▶ | my $type = $args{type} // 'mono'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$args{"type"} // "mono"
MC/DC100%1/1
$args{"type"} // "mono"
$args{"type"}
Truth table100%2/2
A
A= $args{"type"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | return formula_mass('H2O', $type) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | 3 | + sum map {atoms_mass($_, $type)} @{ $self->{atoms} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | sub add_mod { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | 5 | ▶ | my ($self, $loc, $mod) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_mod: called CC=10 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | # $loc and $atom can be scalar or arrayref | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 5 | ▶ | my @locs = ref($loc) ? @$loc : ($loc); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | 5 | ▶ | my $atoms = atoms('mod' => $mod) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
atoms("mod", $mod) // croak("Bad modification\n")
MC/DC0%0/2
atoms("mod", $mod) // croak("Bad modification\n")
atoms("mod", $mod)
croak("Bad modification\n")
Truth table33%1/3
A // B
A= atoms("mod", $mod)B= croak("Bad modification\n")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | // croak "Bad modification\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | 4 | for my $i (@locs) { # 1-based residue | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | croak "Residue index out of range\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 7 | ▶ | if ( $i < 1 || $i > $self->{length}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$i < 1 or $i > $self->{"length"}
MC/DC50%1/2
$i < 1 or $i > $self->{"length"}
$i < 1
$i > $self->{"length"}
Truth table66%2/3
A or B
A= $i < 1B= $i > $self->{"length"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 6 | for my $a (keys %$atoms) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | 18 | my $delta = $atoms->{$a}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | # removal of heavy atoms is a special case | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 18 | ▶ | if ( $delta < 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$delta < 0 and not exists $self->{"atoms"}[$i - 1]{$a} and exists $self->{"atoms"}[$i - 1]{$heavy{$a}}
$delta < 0 and not exists $self->{"atoms"}[$i - 1]{$a}
MC/DC0%0/3
$delta < 0 and not exists $self->{"atoms"}[$i - 1]{$a} and exists $self->{"atoms"}[$i - 1]{$heavy{$a}}
$delta < 0
not exists $self->{"atoms"}[$i - 1]{$a}
exists $self->{"atoms"}[$i - 1]{$heavy{$a}}
Truth table25%1/4
A and not(B) and C
A= $delta < 0B= not exists $self->{"atoms"}[$i - 1]{$a}C= exists $self->{"atoms"}[$i - 1]{$heavy{$a}}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | && ! exists $self->{atoms}->[$i-1]->{ $a } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | && exists $self->{atoms}->[$i-1]->{ $heavy{$a} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | 0 | $a = $heavy{$a}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | 18 | $self->{atoms}->[$i-1]->{$a} += $delta; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | 6 | ++$self->{mods}->[$i-1]->{$mod}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | 3 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | sub get_mods { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | 3504 | ▶ | my ($self, $loc) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_mods: called CC=4 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | croak "Residue index out of range\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | 3504 | ▶ | if ( $loc < 1 && $loc > $self->{length}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$loc < 1 and $loc > $self->{"length"}
MC/DC0%0/2
$loc < 1 and $loc > $self->{"length"}
$loc < 1
$loc > $self->{"length"}
Truth table33%1/3
A and B
A= $loc < 1B= $loc > $self->{"length"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | 3504 | ▶ | return () if ! defined $self->{mods}->[$loc-1]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | 0 | return keys %{ $self->{mods}->[$loc-1] }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | sub has_mod { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | 50 | ▶ | my ($self, $loc, $mod) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
has_mod: called CC=9 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | my @locs = ref($loc) ? @$loc | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | : defined $loc ? ($loc) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | 50 | ▶ | : (1..$self->{length}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 50 | ▶ | my @mods = ref($mod) ? @$mod : ($mod); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | 50 | my $ret_val = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | 50 | for my $i (@locs) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | croak "Residue index out of range\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | 50 | ▶ | if ( $i < 1 && $i > $self->{length}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$i < 1 and $i > $self->{"length"}
MC/DC0%0/2
$i < 1 and $i > $self->{"length"}
$i < 1
$i > $self->{"length"}
Truth table33%1/3
A and B
A= $i < 1B= $i > $self->{"length"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | 50 | for my $m (@mods) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | 50 | ▶ | if (! defined $m) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | 50 | $ret_val += defined $self->{mods}->[$i-1]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | 0 | $ret_val += defined $self->{mods}->[$i-1]->{$m}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | 50 | return $ret_val; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | sub as_string { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | 25 | ▶ | my ($self, %args) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
as_string: called CC=11 SCAR=30.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | 25 | ▶ | my $fmt = $args{fmt} // 'case'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$args{"fmt"} // "case"
MC/DC100%1/1
$args{"fmt"} // "case"
$args{"fmt"}
Truth table100%2/2
A
A= $args{"fmt"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 25 | my $str; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | #------------------------------------------------------------------------# | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | 25 | ▶ | if ($fmt eq 'original') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | 20 | $str = $self->{seq}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | #------------------------------------------------------------------------# | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | elsif ($fmt eq 'case') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | 5 | my @aa = split '', $self->{seq}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | $str = join '', map { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | 5 | ▶ | $self->has_mod($_+1) ? lc($aa[$_]) : $aa[$_] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | } 0..$#aa; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | #------------------------------------------------------------------------# | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | elsif ($fmt eq 'deltas') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | 0 | my @aa = split '', $self->{seq}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | 0 | my @mods = $self->mod_array; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | # move terminal mods to residues | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | 0 | my $n_mod = shift @mods; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | 0 | my $c_mod = pop @mods; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | 0 | $mods[0] += $n_mod; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | 0 | $mods[-1] += $c_mod; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | 0 | for my $i (0..$#aa) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | 0 | $str .= $aa[$i]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | 0 | my $delta = sprintf('%.0f', $mods[$i]); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | 0 | ▶ | $str .= "[$delta]" if ($delta != 0); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | #------------------------------------------------------------------------# | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | 25 | ▶ | if ($args{adjacent}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | croak "Can't form string - adjacent residues not defined" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | 3 | ▶ | if (! defined $self->{prev} || ! defined $self->{next}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $self->{"prev"} and defined $self->{"next"}
MC/DC0%0/2
defined $self->{"prev"} and defined $self->{"next"}
defined $self->{"prev"}
defined $self->{"next"}
Truth table33%1/3
A and B
A= defined $self->{"prev"}B= defined $self->{"next"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | 3 | $str = "$self->{prev}.$str.$self->{next}"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | 25 | return $str; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | sub mod_array { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | 1 | ▶ | my ($self, $type) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
mod_array: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | 1 | my @aa = split '', $self->{seq}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | 1 | my @delta = (0) x $self->{length}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | 1 | for my $i (0..$#aa) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | 10 | my $d = sprintf '%4f', atoms_mass($self->{atoms}->[$i], $type) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | - aa_mass($aa[$i], $type); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | 10 | ▶ | $delta[$i] = $d == 0 ? 0 : $d; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | 1 | push @delta, $self->{n_mod}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | 1 | unshift @delta, $self->{c_mod}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | 1 | return @delta; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | 3 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||