Advertisement
ProzacR

Untitled

Jul 7th, 2011
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.87 KB | None | 0 0
  1. #!/usr/bin/perl
  2. #VR
  3. #tikrina ar ligandai turi S ir yra netoli ZN is ZN.pdb
  4.  
  5. use Chemistry::MacroMol;
  6. use Chemistry::File::PDB;
  7.  
  8. if(!-d "geri_ligandai") {
  9. mkdir("geri_ligandai", 0777);
  10. }
  11.  
  12. while (@ARGV[$x]) {
  13. $macromol = Chemistry::MacroMol->read("@ARGV[$x]");
  14. print "\nTikrinamas ", @ARGV[$x], ": ";
  15. #imam Zn geroj padetyje
  16. $znmol = Chemistry::MacroMol->read("ZN.pdb");
  17. tikrinti();
  18. $x++;
  19. }
  20.  
  21. sub tikrinti {
  22. @all_atoms = $macromol->atoms;
  23. $a = 0;
  24. @S = ();
  25. while (@all_atoms[$a]) {
  26. push(@S, @all_atoms[$a]) if (@all_atoms[$a]->symbol eq 'S');
  27. $a++;
  28. }
  29.  
  30. #imam Zn
  31. $Zn = $znmol->atoms_by_name('ZN');
  32.  
  33. @d = ();
  34. $b = 0;
  35. while (@S[$b]) {
  36. #print @S[$b]->distance($Zn), " ";
  37. push (@d, @S[$b]->distance($Zn));
  38. $b++;
  39. }
  40.  
  41. sort (@d);
  42. #print @d[0], " A, ";
  43. if (@d[0] < 5 && @d[0] > 0) {
  44. print "geras";
  45. $h = $ARGV[$x];
  46. system ("mv $h geri_ligandai/");
  47. }
  48. print "\n";
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement