def make(self):
        curr_path = os.getcwd()
        all_path = curr_path + "/all"
        if os.path.exists(all_path):
            os.system('rm -r ./all')
        os.makedirs(all_path)

        if self.n_s0 > 0:
            self.copy_s0()

        self.select_coord_many()
        self.copy()

        if self.n_ci > 0:
            self.copy_ci()

        # """Save the list to a file named list_file.dat"""
        list_file = self.list_file
        num = self.num
        sl = self.savelist
        curr_path = os.getcwd()
        all_path = curr_path + "/all"
        workfile = all_path + "/" + list_file
        fp = open(workfile, "w")
        for i in range(num):
            print("%10d%10d%10d" % (sl[i][0], sl[i][1], sl[i][2]), file=fp)
        fp.close()
        print("The total geom selected is %10d" % self.num)
        self.inp['n_geom'] = self.num
        json.dump_json('inp.json', self.inp)
        print("The select work is done")
Пример #2
0
 def make(self):
     curr_path = os.getcwd()
     work_path = curr_path + '/all'
     os.chdir(work_path)
     self.rmsd_matrix = np.loadtxt('rmsd_all.dat')
     self.savelist = np.loadtxt('list_file_save.dat')
     command1 = 'cp rmsd_all.dat rmsd_all.dat_old'
     command2 = 'cp list_file_save.dat list_file_save.dat_old'
     os.system(command1)
     os.system(command2)
     if self.inp['job_select'] == 'isomap':
         self.isomap_epsilon()
     else:
         self.classical_analy()
     os.chdir(curr_path)
     json.dump_json('inp.json', self.inp)
Пример #3
0
#! /usr/bin/env python
import rmsd_analys
import mds_cla
import mds_analys
import sub_inp_json as json
import os
import shutil

inp = json.load_json('inp.json')
inp['job_select'] = raw_input(
    "which job do u choose,classical or isomap(classical/isomap):")
inp['rmsd_cutoff'] = raw_input("Input the rmsd_cutoff value:")
if inp['job_select'] == 'isomap':
    inp['mds_cutoff'] = raw_input("Input the mds_cutoff value:")
inp['mds_dimension'] = raw_input("Choose mds dimension:")
json.dump_json('inp.json', inp)

if inp['job_select'] == 'isomap':
    file_name = inp['job_select'] + '_rmsdcut_' + inp[
        'rmsd_cutoff'] + '_mdscut_' + inp['mds_cutoff']
if inp['job_select'] == 'classical':
    file_name = inp['job_select'] + '_rmsdcut_' + inp['rmsd_cutoff']
curr_dir = os.getcwd()
workdir = curr_dir + '/' + file_name
if os.path.exists(workdir):
    shutil.rmtree(workdir)
os.mkdir(workdir)
command1 = 'cp -r all ' + workdir
command2 = 'cp inp.json ' + workdir
os.system(command1)
os.system(command2)
#!/usr/bin/env python

import os

import sub_inp_json
import numpy as np
from sub_kkr_prediction_tool import kkr_single_all_step

filename = 'kkr.input'
xxx = sub_inp_json.read_dat_with_label(filename)
sub_inp_json.dump_json('kkr.json', xxx)


def kkr_single_geom_all():
    kkrname = "kkr.json"
    xxx_input = sub_inp_json.load_json(kkrname)
    n_x_dim = int(xxx_input['n_x_dim'])
    n_y_dim = int(xxx_input['n_y_dim'])
    label_x_descriptor = int(xxx_input['label_x_descriptor'])
    para_kernel = xxx_input['para_kernel']
    rescale = xxx_input['rescale']
    label_grad = xxx_input['label_grad']
    para_alpha = float(xxx_input['para_alpha'])
    para_gamma = float(xxx_input['para_gamma'])
    energy_zero = float(xxx_input['energy_zero'])

    curr_dir = os.getcwd()

    kkr_path = './kkr'

    x_train = np.loadtxt('./kkr/x_train.dat')
Пример #5
0
#!/usr/bin/env python


import os

import sub_inp_json

filename = 'fitting.input'
xxx = sub_inp_json.read_dat_with_label(filename)
sub_inp_json.dump_json('input_initial.json', xxx)

os.system('cp input_initial.json  ../input_initial.json')