| 1 | package Bio::Water; | ||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use 5.012003; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||
| 7 | 1 | require Exporter; | |||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||
| 9 | #Intially the module Named as Water now its moved to Bio::Water | ||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||
| 11 | 1 | our @ISA = qw(Exporter); | |||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||
| 13 | 1 | our %EXPORT_TAGS = ( 'all' => [ qw( | |||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||
| 15 | ) ] ); | ||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||
| 17 | 1 | our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); | |||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||
| 19 | 1 | our @EXPORT = qw(wbridge); | |||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||
| 21 | 1 | our $VERSION = '0.02'; | |||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||
| 23 | 0 | ▶ | sub wbridge{ | ||||||||||||||||||||||||||||||
|
Subroutine
wbridge: not called CC=15 SCAR=54.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 24 | 0 | my ($v,$file,$dstart,$dend)=@_; | |||||||||||||||||||||||||||||||
| 25 | 0 | chomp($file); | |||||||||||||||||||||||||||||||
| 26 | 0 | chomp($dstart); | |||||||||||||||||||||||||||||||
| 27 | 0 | chomp($dend); | |||||||||||||||||||||||||||||||
| 28 | 0 | my @h=(); | |||||||||||||||||||||||||||||||
| 29 | 0 | my @tmp=(); | |||||||||||||||||||||||||||||||
| 30 | 0 | my @result=(); | |||||||||||||||||||||||||||||||
| 31 | 0 | ▶ | open(RD,"$file") or die "Cannot open the file"; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 32 | 0 | ▶ | while(<RD>){ | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 33 | 0 | ▶ | push(@h,$_),if($_=~/^HETATM.*HOH/); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||
| 35 | 0 | my $len=$#h; | |||||||||||||||||||||||||||||||
| 36 | 0 | ▶ | for(my $i=0;$i<$len;$i++){ | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 37 | 0 | my $flag=0; | |||||||||||||||||||||||||||||||
| 38 | 0 | my @tmp=(); | |||||||||||||||||||||||||||||||
| 39 | 0 | my $val=''; | |||||||||||||||||||||||||||||||
| 40 | 0 | my $tmp1=$h[$i]; | |||||||||||||||||||||||||||||||
| 41 | 0 | ▶ | for(my $j=0;$j<$len;$j++){ | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 42 | 0 | my $di=calc($tmp1,$h[$j]); | |||||||||||||||||||||||||||||||
| 43 | 0 | ▶ | if($di >=$dstart && $di <=$dend){if($flag==0){push(@tmp,$h[$i]);delete $h[$i];$flag++;}else{ | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
$di >= $dstart and $di <= $dend
MC/DC0%0/2
$di >= $dstart and $di <= $dend
$di >= $dstart
$di <= $dend
Truth table0%0/3
A and B
A= $di >= $dstartB= $di <= $dend
| |||||||||||||||||||||||||||||||||
| 44 | 0 | push(@tmp,$h[$j]);delete $h[$j]; | |||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||||||
| 48 | 0 | ▶ | for(my $k=0;$k<scalar(@tmp);$k++){ | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 49 | 0 | ▶ | for(my $j=0;$j<scalar(@h);$j++){ | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 50 | 0 | my $di=calc($tmp[$k],$h[$j]); | |||||||||||||||||||||||||||||||
| 51 | 0 | ▶ | if($di >=$dstart && $di <=$dend){ | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$di >= $dstart and $di <= $dend
MC/DC0%0/2
$di >= $dstart and $di <= $dend
$di >= $dstart
$di <= $dend
Truth table0%0/3
A and B
A= $di >= $dstartB= $di <= $dend
| |||||||||||||||||||||||||||||||||
| 52 | 0 | push(@tmp,$h[$j]);delete $h[$j]; | |||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||||||
| 56 | 0 | foreach my $dd (@tmp){ | |||||||||||||||||||||||||||||||
| 57 | 0 | $val.=substr($dd,21,5).",";$val=~s/\s//g; | |||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||
| 59 | 0 | chop $val; | |||||||||||||||||||||||||||||||
| 60 | #print($val."\n")if($val); | ||||||||||||||||||||||||||||||||
| 61 | 0 | ▶ | push(@result,$val."\n")if($val); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||||||
| 63 | 0 | return @result; | |||||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||||||
| 65 | 0 | ▶ | sub calc{ | ||||||||||||||||||||||||||||||
|
Subroutine
calc: not called CC=1 SCAR=4.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 66 | 1 | ▶ | no warnings; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 67 | 0 | my ($tmpv,$hv)=@_; | |||||||||||||||||||||||||||||||
| 68 | 0 | my $x1=substr($tmpv,30,8);$x1=~s/\s//g; | |||||||||||||||||||||||||||||||
| 69 | 0 | my $x2=substr($hv,30,8);$x2=~s/\s+//; | |||||||||||||||||||||||||||||||
| 70 | 0 | my $y1=substr($tmpv,38,8);$y1=~s/\s+//; | |||||||||||||||||||||||||||||||
| 71 | 0 | my $y2=substr($hv,38,8);$y2=~s/\s+//; | |||||||||||||||||||||||||||||||
| 72 | 0 | my $z1=substr($tmpv,46,8);$z1=~s/\s+//; | |||||||||||||||||||||||||||||||
| 73 | 0 | my $z2=substr($hv,46,8);$z2=~s/\s+//; | |||||||||||||||||||||||||||||||
| 74 | 0 | my $dis=sqrt((($x2-$x1)**2)+(($y2-$y1)**2)+(($z2-$z1)**2)); | |||||||||||||||||||||||||||||||
| 75 | 0 | return $dis; | |||||||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||
| 79 | 1 | 1; | |||||||||||||||||||||||||||||||
| 80 | __END__ | ||||||||||||||||||||||||||||||||