Using SYBYL scripts requires some knowledge of SYBYL commands and SPL. The following scripts are provided as a guide to performing particular operations, and should generally not be used as is. In many cases, the scripts are tailored to particular molecules in terms of numbering scheme, etc., and must be modified for use with your molecules.
############################################################################## # SYSMIN - Takes a Search table, and minimizes all the conformations, # keeping only those which are different # # Chris Van Dyke, Tripos Associates, Inc. 7/13/92 # Modified from $TA_ROOT/spl/dynmin.spl script by Tad Hurst. # Modified by Robert Pearlstein, NIH. # # This macro is not supported by TRIPOS, but is provided for our customer's # convenience. ############################################################################## uims define macro SYSMIN sybylbasic yes # Get the name of the Search table, and the name of the database to be created. setvar cgq_save $cgq_timeout set cgq 0 setvar default_save $default_area setvar sysname %promptif("$1" string "" "Search table name " \ "Name of the Search table for which a minimized database is desired") if %not("%array_npos($sysname %table_name())") if %not("%file_exists(%cat($sysname '.tbl'))") echo "Search table not found" return endif setvar table_close yes table recall $sysname m1 else setvar table_close no table default $sysname endif # Specify the maximum RMS value allowed during the match procedure. setvar match_spec %promptif("$2" positive "0.1" "Maximum RMS value" \ "Maximum RMS value allowed for match of minimized conformations") # # Set Maximin2 options. tailor set maximin2 simplex_iterations 0 | | tailor set maximin2 maximum_iterations 10000 | | tailor set maximin2 termination_option gradient | | echo Iterations: %tailor(maximin2 maximum_iterations) echo Termination option: %tailor(maximin2 termination_option) # # Create the database. setvar dbname %promptif("$3" string "" "New database name " \ "Name of the database to be created") data create $dbname # Get the names of all the molecules in the table. setvar mols %table() setvar namecounter 0 # Minimize each conformation in the table, and check against unique # conformations previously stored in the database. for index in $mols echo "Now minimizing and checking $index" tab export database save_user "$index" keep >$NULLDEV data get "%cat("*" "$index")" m100 >$NULLDEV data delete mol "%cat(* $index)" yes >$NULLDEV tailor set maximin2 minimization_method powell | | maxi m100 done inter tailor set maximin2 minimization_method bfgs | | maxi m100 done inter # setvar goodmols %database(*) setvar found 0 for goodone in $goodmols data get $goodone m101 >$NULLDEV fit m100(1) m101(1) 4 4 18 18 17 17 20 20 2 2 | solve exit >$NULLDEV # # Calculate RMS distances between specific atoms. setvar dist_accumulator 0.0 # # You must define the atom id's in your molecule, adding as # many "measure distance" lines as needed for your comparison. measure distance m100(3) m101(3) | >$NULLDEV setvar dist_squared %math($measure_distance * $measure_distance) setvar dist_accumulator %math( $dist_accumulator + $dist_squared ) measure distance m100(6) m101(6) | >$NULLDEV setvar dist_squared %math($measure_distance * $measure_distance) setvar dist_accumulator %math( $dist_accumulator + $dist_squared ) # Divide by the number of distances that you actually measure above. setvar rms_value1 %math($dist_accumulator / 2.0) setvar rms_value1 %sqrt($rms_value1) # echo "RMS trp: " $rms_value1 if %lt( $rms_value1 $match_spec ) setvar found 1 break endif endfor if %eq($found "0") setvar namecounter %math($namecounter + 1) modify mol name m100 %cat(Unique $namecounter) data add m100 >$NULLDEV endif endfor zap m100 >$NULLDEV zap m101 >$NULLDEV if %streql($table_close yes) table close $sysname no >$NULLDEV endif setvar mols %database(*) echo "Number of different structures found: " %count( $mols) database close set cgq $cgq_save default $default_save >$NULLDEV .
############################################################################## # send_molecules_to_mopac - generates .dat files (MOPAC format) from a set of molecules # already in the SYBYL molecule areas. ############################################################################## # uims define macro send_molecules_to_mopac sybylbasic yes # setvar old_timeout $CGQ_TIMEOUT set CGQ_TIMEOUT 0 # # create mopac .dat files for each molecule in the workspaces. # for index in %mols(*) echo "working on " %mol_info($index name) # # The following command sets up the MOPAC run. Since the SYBYL qualifier "run_other_mopac_ampac" is specified, SYBYL's # MOPAC (MOPAC 5.0) will not automatically run. You can modify or add keywords (see the MOPAC manual for a list and description). qcpe $index mopac setup %mol_info($index name) \ method_to_be_used "am1" \ geometry_optimization "all_bonds_and_angles" \ time_limit 100000 \ run_other_mopac_ampac yes \ convergence_options "precise_x100" yes done \ other_keywords "GNORM=0.1 EF" \ list_options \ done \ " " \ hawk.dcrt.nih.gov \ run_it_now > $NULLDEV endfor # set CGQ_TIMEOUT $old_timeout .
############################################################################## # retrieve_mopac_arcs - inputs .arc files from a series of mopac runs. # The .arc file names must be stored in a separate ascii file. # Note the structures may require repair after reading into SYBYL!! ############################################################################## # uims define macro retrieve_mopac_arcs sybylbasic yes # setvar old_timeout $CGQ_TIMEOUT set CGQ_TIMEOUT 0 # setvar list_file_name %prompt("filename" "" "Name of file containing .arc file names " "") setvar fh %open($list_file_name "r") # # read the list of names setvar mcount 0 for index in %range(1 10000) setvar arc_file %read($fh) if %eof($fh) break endif setvar mcount %math($mcount + 1) setvar list_of_arcs[$mcount] $arc_file endfor %close($fh) # # Create the new database. setvar dbname %prompt(filename "" "Name of database in which to store mopac structures " "") database create $dbname # for index in %range(1 $mcount) # Input an arc file. echo "working on " $list_of_arcs[$index] files mopac m1 $list_of_arcs[$index] setvar dot_pos %pos("." $list_of_arcs[$index]) setvar dot_pos %math($dot_pos - 1) setvar the_name %substr($list_of_arcs[$index] 1 $dot_pos) setvar the_name %cat($the_name "_mopac_minimized") modify molecule name m1 $the_name database add m1 >$NULLDEV endfor setvar mols %database(*) echo "Number of structures retrieved: " %count($mols) database close set CGQ_TIMEOUT $old_timeout echo " " echo "Please check all retrieved structures for incorrect atoms, missing bonds, etc." .
############################################################################## # filter_minimized_duplicates - Filters out duplicate minimized conformations # stored in a database file. Uses lowest energy conformation of each # duplicate set. Note: Cannot handle > 999 conformations. ############################################################################## # uims define macro filter_minimized_duplicates sybylbasic yes # setvar old_timeout $CGQ_TIMEOUT set CGQ_TIMEOUT 0 # # Specify the maximum RMS value used to distinguish conformations. setvar match_spec %promptif("$2" positive "0.1" "Maximum RMS value" \ "Maximum RMS value allowed to distinguish conformations") # # open the unfiltered molecule database and read the molecules. setvar molecule_database %prompt(DATABASE_FILE "" "Enter the old database file name") database open "$molecule_database" update >$nulldev # setvar area 0 for i in %database(*) setvar area %math($area+1) database get "$i" %cat(m $area) endfor # database close >$nulldev # # Create the new database. setvar dbname %promptif("$3" string "" "New database name " \ "Name of the database to be created") database create $dbname # setvar fh %open(filter_log "w") %write($fh $database_name) %write($fh " ") # setvar namecounter 0 # setvar done_counter 0 setvar done_list 0 # for index in %mols(*) # Copy a trial molecule into m1000. # Check if trial molecule is in any previously identified family. setvar duplicate 0 if %gt($done_counter 0) for index_4 in %range(1 $done_counter) if %streql($index $done_list[$index_4]) # No need to check any further. setvar duplicate 1 break endif endfor endif # if %eq($duplicate 1) continue endif # copy $index m1000 setvar lowest_energy 1000000.0 setvar family_counter 0 # Initialize family_members setvar family_members # for index_2 in %range(1 $area) setvar test_conformation %cat(M $index_2) # # Check if test_conformation is in a previously identified family. setvar duplicate 0 if %gt($done_counter 0) for index_4 in %range(1 $done_counter) if %streql($test_conformation $done_list[$index_4]) setvar duplicate 1 break endif endfor endif # if %eq($duplicate 1) continue endif # echo "Now checking %mol_info($index name) against %mol_info($test_conformation name)" %write($fh %mol_info($index name) "against" %mol_info($test_conformation name)) # Copy a test conformation to m1001 Copy $test_conformation m1001 # # Fit the conformations based on all heavy atoms. Note that this may not be # appropriate for your molecule. match m1000(*-(, )) m1001(*-( , )) >$NULLDEV echo "RMS: " $match_rms # %write($fh "RMS: " $match_rms) # if %lt( $match_rms $match_spec ) # Not unique, so store for later energy check! setvar family_counter %math($family_counter+1) setvar family_members[$family_counter] $test_conformation endif endfor # # Find the lowest energy family member. echo "List of Duplicates:" %write($fh "Family members: ") for index_3 in %range(1 $family_counter) energy $family_members[$index_3] | >$nulldev echo %mol_info($family_members[$index_3] name) " " $energy_total %write($fh %mol_info($family_members[$index_3] name) " Energy: " $energy_total) if %lt($energy_total $lowest_energy) setvar lowest_energy $energy_total setvar lowest_energy_molecule $family_members[$index_3] endif # # Accumulate conformations from all family_members. setvar done_counter %math($done_counter+1) setvar done_list[$done_counter] $family_members[$index_3] endfor # %write($fh "Lowest energy member: " %mol_info($lowest_energy_molecule name)) database add $lowest_energy_molecule >$NULLDEV # endfor # finished: setvar mols %database(*) echo "Number of different structures found: " %count( $mols) database close %close($fh) set CGQ_TIMEOUT $old_timeout .