MMTSB
Tool Set Documentation

Analyze.pl

From MMTSB
Revision as of 22:37, 13 September 2010 by Feig (talk | contribs)
(diff) ←Older revision | view current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Usage

usage: analyze.pl -function file [pdbFile]

Show source


Description

This tool runs the perl function given in the script file for the structure given as argument. The perl function has to be named analyze. It is passed a Molecule object as argument and expects one or more values to be returned.

An example for a function that calculates the end-to-end distance between N- and C-terminal C-alpha atoms of the first chain from a given structure is given in the following:

 sub analyze {
   my $mol=shift;
   my @data=();  
   my $res=$mol->{chain}->[0]->{res};
   my $atom=$mol->{chain}->[0]->{atom};

   my $ca1;
   for (my $ia=$res->[0]->{start}; $ia<=$res->[0]->{end}; $ia++) {
     $ca1=$atom->[$ia] if ($atom->[$ia]->{atomname} eq "CA");
   }

   my $ca2;
   for (my $ia=$res->[$#{$res}]->{start}; $ia<=$res->[$#{$res}]->{end}; $ia++) {
     $ca2=$atom->[$ia] if ($atom->[$ia]->{atomname} eq "CA");
   }

   my $dx=$ca1->{xcoor}-$ca2->{xcoor};
   my $dy=$ca1->{ycoor}-$ca2->{ycoor};
   my $dz=$ca1->{zcoor}-$ca2->{zcoor};

   push(@data, sqrt($dx*$dx+$dy*$dy+$dz*$dz));

   return @data;
 }

 1;

An example of how to use such a function is given below.

Options

-help 
usage information
-function file 
perl script file with function named analyze

Examples

analyze.pl -function end2end.distance 1vii.exp.pdb
runs the script end2end.distance which in this case calculates the end-to-end distance between the N- and C-terminal C-alpha atoms.

9.29078990183289