Esempio n. 1
0
    def test_0(self):
        from pytraj import io

        fname = "./data/tz2.pdb"
        traj = io.load(fname, fname)
        ptpdb = pt.read_pdb_from_frame(traj.top, traj[0])
        spdb = smd.read_pdb_saxs(fname)[0]

        print (ptpdb)
        print (spdb[0][0])
Esempio n. 2
0
    def test_1(self):
        from pytraj import io
        import numpy as np

        print ("use pytraj")
        # load traj
        traj = io.load("./test.pdb", "test.pdb")
        n_atoms = traj.top.n_atoms

        # creat dummy B-factors
        b_array = np.zeros(n_atoms)

        # create dummy r_array
        r_array = np.asarray([atom.gb_radius for atom in traj.top])
        #print (r_array[0])

        # read pdb for 1st frame
        pdb = read_pdb_from_frame(traj.top, traj[0], b_array, r_array) 
        #print (len(pdb))
        #print (pdb[0])
        #print (pdb)

        # read dx, find all guv.* files in current folder
        v_dx = sx.read_dx("./")

        # v_dx is a list of dictionary
        # in C++ saxs, this is a vector of struct
        print (len(v_dx))
        d1 = v_dx[0]
        print (d1.keys())

        # get info
        x, y, z = d1['ngrid']
        print (x * y * z)
        print (d1['conc'])
        print (d1['type'])
        print (d1['delta'])
        print (d1['origin'])
        arr0 = np.asarray(d1['value'])
        assert arr0.shape[0] == (x * y * z)

        # calculate vcoor_max, vcoor_min: dummy example
        v_max, v_min = sx.calc_extreme_pdb(pdb)