comparison hbonds.py @ 4:36babbdd7818 draft

"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 3b99f08f22b9e0c16c0a0adc82f8c16c1a25cedf"
author chemteam
date Mon, 07 Oct 2019 12:51:57 -0400
parents 49dac57d004a
children
comparison
equal deleted inserted replaced
3:49dac57d004a 4:36babbdd7818
2 2
3 import argparse 3 import argparse
4 import csv 4 import csv
5 import sys 5 import sys
6 6
7 import MDAnalysis as mda
7 import MDAnalysis.analysis.hbonds 8 import MDAnalysis.analysis.hbonds
8 9
9 import pandas as pd 10 import pandas as pd
10 11
11 12
12 def parse_command_line(argv): 13 def parse_command_line(argv):
13 parser = argparse.ArgumentParser() 14 parser = argparse.ArgumentParser()
14 parser.add_argument('--idcd', help='input dcd') 15 parser.add_argument('--itraj', help='input traj')
15 parser.add_argument('--ipdb', help='input pdb') 16 parser.add_argument('--istr', help='input str')
17 parser.add_argument('--itrajext', help='input traj ext')
18 parser.add_argument('--istrext', help='input str ext')
16 parser.add_argument('--isegid1', help='segid 1') 19 parser.add_argument('--isegid1', help='segid 1')
17 parser.add_argument('--isegid2', help='segid 2') 20 parser.add_argument('--isegid2', help='segid 2')
18 parser.add_argument('--idistance', help='cutoff distance') 21 parser.add_argument('--idistance', help='cutoff distance')
19 parser.add_argument('--iangle', help='ctoff angle') 22 parser.add_argument('--iangle', help='ctoff angle')
20 parser.add_argument('--output', help='output') 23 parser.add_argument('--output', help='output')
29 selection1 = "segid %s" % args.isegid1 32 selection1 = "segid %s" % args.isegid1
30 selection2 = "segid %s" % args.isegid2 33 selection2 = "segid %s" % args.isegid2
31 distance = float(args.idistance) 34 distance = float(args.idistance)
32 angle = float(args.iangle) 35 angle = float(args.iangle)
33 36
34 u = MDAnalysis.Universe( 37 u = mda.Universe(args.istr, args.itraj,
35 args.ipdb, args.idcd, topology_format="PDB", format="DCD") 38 topology_format=args.istrext, format=args.itrajext)
36 39
37 h = MDAnalysis.analysis.hbonds.HydrogenBondAnalysis( 40 h = MDAnalysis.analysis.hbonds.HydrogenBondAnalysis(
38 u, selection1, selection2, distance=distance, angle=angle) 41 u, selection1, selection2, distance=distance, angle=angle)
39 h.run() 42 h.run()
40 h.generate_table() 43 h.generate_table()