コード例 #1
0
ファイル: xyz_coord_bonds.py プロジェクト: kingm36/Surfactant
#! /usr/bin/env/ python

import sys
import numpy as np
import pdb_create
import variables

in_stream = open('surf.xyz', 'r')
out_stream = open('surf.lt', 'wa')
out_stream_2 = open('surf.mol2', 'wa')
structure = open(sys.argv[1], 'r')

xbox, ybox, zbox, w_filename, w_mol, pack_tol, bead_dist, boxx, boxy, boxz, bead_per, main_branch, equil_time, surf_x, surf_y, surf_zlow, surf_zhi, per_loop, steps, temp, z_distance, epsilon, sigma, r_distance, equil_dcd, prod_dcd, cutoff = variables.read_variables(
    sys.argv[2])

#Initialize string that will be appended to file with bond information
s = []
p = []
ilines, i, j, k, l = 0, 0, 0, 0, 0
ID = []
xyz = []
y = []
z = []
beads = int(bead_per)

#Write beginning of file
s = (
    """                                                                                                 
import "miesurf_ff.lt"                                                                                   

Surf {                                                                                                   
コード例 #2
0
#Define the location of the interface using each frame from dcd file
#Create array with location of each monomer from the surface and delete monomers that are X angstroms from the defined interface.

#!/usr/bin/env python

import sys
import numpy as np
import ReadDCD
import variables

f2 = open('trimmed_system.xyz', 'wa')  #Open in write and append format
outstream = f2

#Read in dcd file, define local surface, calculate distance from monomer
RDF, xbox, ybox, zbox, surface_filename, surface_mol, pack_tol, bead_dist, boxx, boxy, boxz, bead_per, main_branch, equil_time_short, equil_time_long, monomer_x, monomer_y, monomer_zlow, monomer_zhi, per_loop, steps, temp, z_distance, epsilon, sigma, r_distance, equil_dcd, prod_dcd, cutoff = variables.read_variables(
    'input/input_file.txt')

nAt, BoxD_frames, BoxAngle_frames, xyz_frames = ReadDCD.read_DCD(sys.argv[1])

#define total number of molecules, number of surface molecules, and number of monomers
total_molecules = nAt
surface_molecules = int(surface_mol)
bead_per_monomer = int(bead_per)
bead_in_main_branch = int(main_branch)
monomer_molecules = (total_molecules - surface_molecules) / bead_per_monomer
xyz_final_frame = xyz_frames[-1]

surface = []
surface_molecule = 0
for surface_molecule in range(surface_mol):
    surface.append(xyz_final_frame[surface_molecule, :])
コード例 #3
0
#!/usr/bin/env python

import def_surface
import variables

#print "Input file for moltemplate"
in_lt_file = open('system_trimmed.lt', 'w')

xbox, ybox, zbox, w_filename, w_mol, pack_tol, bead_dist, boxx, boxy, boxz, bead_per, equil_time, surf_x, surf_y, surf_zlow, surf_zhi, per_loop, steps, temp, z_distance, epsilon, sigma, r_distance, equil_dcd, prod_dcd = variables.read_variables(
    'input_file.txt')

g = 'import "wat.lt" \n'
g += 'import "surf.lt" \n'

g += '''
write_once("Data Boundary") {
  -%4.6f   %12.6f xlo xhi
    -%4.6f   %12.6f ylo yhi
    -%4.5f   %12.5f zlo zhi
} \n\n''' % (boxx, boxx, boxy, boxy, boxz, boxz)

g += "wat = new Wat [%i] \n\n" % (w_mol)

g += "surf = new Surf [%i]" % (int(def_surface.num_surf_mol))

in_lt_file.write(g)
in_lt_file.close()