comparison dihedrals.py @ 4:d8178fe9aaff draft

"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 3b99f08f22b9e0c16c0a0adc82f8c16c1a25cedf"
author chemteam
date Mon, 07 Oct 2019 12:52:20 -0400
parents 554f60da9c8f
children 0493024c3318
comparison
equal deleted inserted replaced
3:554f60da9c8f 4:d8178fe9aaff
14 import numpy as np 14 import numpy as np
15 15
16 16
17 def parse_command_line(argv): 17 def parse_command_line(argv):
18 parser = argparse.ArgumentParser() 18 parser = argparse.ArgumentParser()
19 parser.add_argument('--idcd', help='input dcd') 19 parser.add_argument('--itraj', help='input traj')
20 parser.add_argument('--ipdb', help='input pdb') 20 parser.add_argument('--istr', help='input str')
21 parser.add_argument('--itrajext', help='input traj ext')
22 parser.add_argument('--istrext', help='input str ext')
21 parser.add_argument('--isegid1', help='segid 1') 23 parser.add_argument('--isegid1', help='segid 1')
22 parser.add_argument('--iresid1', help='resid 1') 24 parser.add_argument('--iresid1', help='resid 1')
23 parser.add_argument('--iname1', help='name 1') 25 parser.add_argument('--iname1', help='name 1')
24 parser.add_argument('--isegid2', help='segid 2') 26 parser.add_argument('--isegid2', help='segid 2')
25 parser.add_argument('--iresid2', help='resid 2') 27 parser.add_argument('--iresid2', help='resid 2')
54 D = u.select_atoms(atom4).positions 56 D = u.select_atoms(atom4).positions
55 psi = calc_dihedrals(A, B, C, D) 57 psi = calc_dihedrals(A, B, C, D)
56 return np.rad2deg(psi) 58 return np.rad2deg(psi)
57 59
58 60
59 u = mda.Universe(args.ipdb, args.idcd, topology_format="PDB", format="DCD") 61 u = mda.Universe(args.istr, args.itraj,
62 topology_format=args.istrext, format=args.itrajext)
60 data = np.array([(u.trajectory.frame, psi(u)) for ts in u.trajectory]) 63 data = np.array([(u.trajectory.frame, psi(u)) for ts in u.trajectory])
61 frame, psi = data.T 64 frame, psi = data.T
62 PSI = np.concatenate(psi, axis=0) 65 PSI = np.concatenate(psi, axis=0)
63 66
64 zip(frame, PSI) 67 zip(frame, PSI)