thanks Nick, i hope i've answered your questions and i'm going back to
work with info that you have proviede to me;
the first question: "foreach" opens all the molecules with mol2 extension almost at once, is that correct? i mean if it will change when i add other lines of the script? that way it will insert one mol2 molecule, it will follow the process of inserting protein and measuring distances and then it will read second mol2 molecule, insert protein, measure distances ...etc.? (which is what i want to do)
the information i found is:
"If you want obtain a value of a VEGA ZZ environment variable, you must use the Get or PluginGet VEGA ZZ commands" so i assume there is no significant difference...
-the command "TotAtm" gives total number of atoms of the current loaded molecule, it is a standard command in Vega ZZ.
-.msf files contain info about molecules (properties), it is a Quanta MSF chemical modeller input file.
-the loop "for i 1 10 1" is just an example ( 10 - to save the time when i run experimental calculations),
in the end it should measure the distances between all the atoms of the molecule and selected atoms of protein (as i've mentioned before i will think about selecting later, as it will be in my opinion small problem when i wil have the rest);
this is the example code to measure distances in vega:
REBOL [
Title: "Distances"
Date: 03-Sep-2006
Author: "Alessandro Pedretti"
Version: 1.2.0
Usage: {
This script measures all atoms distances.
}
History: [
1.0.0 15-Jan-2003 "First release"
1.1.0 19-Jun-2005 "Fix file path iussue"
1.2.0 03-Sep-2006 "Calculation check"
]
Email:
alessandro.pedretti@vegazz.net]
; Load the VEGA interface
do %..\Common\Vega.r
; Open the comunication port
VegaOpen VegaDefHost VegaDefPort VegaDefUser VegaDefPass
; Check if a calculation is already running
VegaCmd "PluginGet IsRunning"
if equal? VegaRes "1" [
VegaCmd rejoin[{MessageBox "Calculation already running" "ERROR" 16}]
VegaClose
quit
]
; Change the mouse cursor
VegaCmd {Cursor Busy}
; Print into the VEGA console
VegaCmd {Text "" 1}
VegaCmd {Text "**** Interatomic distances ****" 1}
VegaCmd {Text "" 1}
; Clear all molecules
VegaCmd {New}
; Get the VEGA installation directory
VegaCmd {Get VegaDir}
MolPath: join VegaRes "Molecules\"
; Load the molecule
VegaCmd rejoin [{Open "} MolPath {a3.msf"}]
VegaCmd {mNormalize}
VegaCmd {mColorByAtom}
; Get the number of atoms
VegaCmd {Get TotAtm}
TotAtm: to-integer VegaRes
VegaCmd {Text "**** Rebol demo start ****" 1}
; Measure the distances
;this one measures distances between all atoms of only one molecule
for i 1 TotAtm 1 [ ; it gives first atom in pair to measure distance; starting with atom nr 1, stops with the last atom (TotAtm) in step of 1, so if there will be "for i 2 10 2" it will measure starting from atom number 2 ending with no. 10, in step of 2 (every second atom)
for j (i + 1) TotAtm 1 [ ; it gives the second atom in pair - so distance is being measured between atoms chosen above, and atoms chosen it this command
VegaCmd rejoin ["Distance " i " " j " 1"]
VegaCmd rejoin [{Text "} i {<->} j { } VegaRes {" 1}]
] ; End of for (j)
VegaCmd {mPickRemMon}
] ; End of for (i)
; Change the mouse cursor to default
VegaCmd {Cursor Default}
; Close the comunication port
VegaClose
this is the folder screenshot
http://s2.screenshots.cc/thumb/thumb_c3b22a00.jpghttp://s2.screenshots.cc/upload/c3b22a00.jpg; code to "read in (merge) protein (pdb) count number of protein atoms" goes here.
; (I don't understand this process yet...)
;to merge them - it is enough to open the molecule file first (mol2) and protein file as a second one in the same window, to count atoms: VegaCmd "PluginGet TotAtm" or VegaCmd {Get TotAtm};