packmol-memgen-minimal 1.1.16__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. packmol_memgen/__init__.py +2 -0
  2. packmol_memgen/__version__.py +34 -0
  3. packmol_memgen/data/LICENSE.Apache-2.0 +201 -0
  4. packmol_memgen/data/extra_solvents.lib +789 -0
  5. packmol_memgen/data/frcmod.lipid_ext +97 -0
  6. packmol_memgen/data/frcmod.solvents +129 -0
  7. packmol_memgen/data/insane_lipids.txt +138 -0
  8. packmol_memgen/data/insane_solvents.txt +45 -0
  9. packmol_memgen/data/leaprc.extra_solvents +42 -0
  10. packmol_memgen/data/leaprc.lipid_ext +48 -0
  11. packmol_memgen/data/lipid_ext.lib +12312 -0
  12. packmol_memgen/data/martini_v3.0.0.itp +356605 -0
  13. packmol_memgen/data/memgen.parm +4082 -0
  14. packmol_memgen/data/pdbs.tar.gz +0 -0
  15. packmol_memgen/data/solvent.parm +14 -0
  16. packmol_memgen/example/example.sh +31 -0
  17. packmol_memgen/lib/__init__.py +0 -0
  18. packmol_memgen/lib/amber.py +77 -0
  19. packmol_memgen/lib/charmmlipid2amber/__init__.py +0 -0
  20. packmol_memgen/lib/charmmlipid2amber/charmmlipid2amber.csv +7164 -0
  21. packmol_memgen/lib/charmmlipid2amber/charmmlipid2amber.py +225 -0
  22. packmol_memgen/lib/pdbremix/LICENSE +21 -0
  23. packmol_memgen/lib/pdbremix/__init__.py +0 -0
  24. packmol_memgen/lib/pdbremix/_version.py +1 -0
  25. packmol_memgen/lib/pdbremix/amber.py +1103 -0
  26. packmol_memgen/lib/pdbremix/asa.py +227 -0
  27. packmol_memgen/lib/pdbremix/data/aminoacid.pdb +334 -0
  28. packmol_memgen/lib/pdbremix/data/binaries.json +26 -0
  29. packmol_memgen/lib/pdbremix/data/charmm22.parameter +2250 -0
  30. packmol_memgen/lib/pdbremix/data/charmm22.topology +1635 -0
  31. packmol_memgen/lib/pdbremix/data/color_b.py +682 -0
  32. packmol_memgen/lib/pdbremix/data/hin.lib +130 -0
  33. packmol_memgen/lib/pdbremix/data/hydroxide.lib +88 -0
  34. packmol_memgen/lib/pdbremix/data/make_chi.py +92 -0
  35. packmol_memgen/lib/pdbremix/data/opls.parameter +1108 -0
  36. packmol_memgen/lib/pdbremix/data/opls.topology +1869 -0
  37. packmol_memgen/lib/pdbremix/data/phd.frcmod +82 -0
  38. packmol_memgen/lib/pdbremix/data/phd.leaprc +4 -0
  39. packmol_memgen/lib/pdbremix/data/phd.prepin +35 -0
  40. packmol_memgen/lib/pdbremix/data/template.pdb +334 -0
  41. packmol_memgen/lib/pdbremix/data/znb.frcmod +24 -0
  42. packmol_memgen/lib/pdbremix/data/znb.leaprc +7 -0
  43. packmol_memgen/lib/pdbremix/data/znb.lib +69 -0
  44. packmol_memgen/lib/pdbremix/data.py +264 -0
  45. packmol_memgen/lib/pdbremix/fetch.py +102 -0
  46. packmol_memgen/lib/pdbremix/force.py +627 -0
  47. packmol_memgen/lib/pdbremix/gromacs.py +978 -0
  48. packmol_memgen/lib/pdbremix/lib/__init__.py +0 -0
  49. packmol_memgen/lib/pdbremix/lib/docopt.py +579 -0
  50. packmol_memgen/lib/pdbremix/lib/pyqcprot.py +305 -0
  51. packmol_memgen/lib/pdbremix/namd.py +1078 -0
  52. packmol_memgen/lib/pdbremix/pdbatoms.py +543 -0
  53. packmol_memgen/lib/pdbremix/pdbtext.py +120 -0
  54. packmol_memgen/lib/pdbremix/protein.py +311 -0
  55. packmol_memgen/lib/pdbremix/pymol.py +480 -0
  56. packmol_memgen/lib/pdbremix/rmsd.py +203 -0
  57. packmol_memgen/lib/pdbremix/simulate.py +420 -0
  58. packmol_memgen/lib/pdbremix/spacehash.py +73 -0
  59. packmol_memgen/lib/pdbremix/trajectory.py +286 -0
  60. packmol_memgen/lib/pdbremix/util.py +273 -0
  61. packmol_memgen/lib/pdbremix/v3.py +16 -0
  62. packmol_memgen/lib/pdbremix/v3array.py +482 -0
  63. packmol_memgen/lib/pdbremix/v3numpy.py +350 -0
  64. packmol_memgen/lib/pdbremix/volume.py +155 -0
  65. packmol_memgen/lib/utils.py +1017 -0
  66. packmol_memgen/main.py +2827 -0
  67. packmol_memgen_minimal-1.1.16.dist-info/METADATA +664 -0
  68. packmol_memgen_minimal-1.1.16.dist-info/RECORD +71 -0
  69. packmol_memgen_minimal-1.1.16.dist-info/WHEEL +4 -0
  70. packmol_memgen_minimal-1.1.16.dist-info/entry_points.txt +2 -0
  71. packmol_memgen_minimal-1.1.16.dist-info/licenses/LICENSE +338 -0
@@ -0,0 +1,225 @@
1
+ #!/usr/bin/python
2
+
3
+ ###############################################################################
4
+ # charmmlipid2amber.py
5
+ # Version 2.0.3
6
+ # 2014-06-05
7
+ # Benjamin D. Madej
8
+ #
9
+ # Usage:
10
+ # charmmlipid2amber.py [-c charmmlipid2amber.csv] -i input.pdb -o output.pdb
11
+ #
12
+ # Description:
13
+ # Processes PDB files for use with Lipid14. This program processes only ATOM,
14
+ # HETATM, and TER lines of a PDB file. Other lines will be removed from PDB.
15
+ ###############################################################################
16
+ #Mod. by Stephan Schott V. // Added the possibility to recognize between
17
+ #different chain IDs.
18
+
19
+
20
+ # Includes
21
+ import sys
22
+ import csv
23
+ import re
24
+ import getopt
25
+ import os
26
+
27
+ # Main
28
+ def charmmlipid2amber(inputpdb,outputpdb=None,csv_dict=os.path.abspath(os.path.dirname(sys.argv[0]))+"/charmmlipid2amber.csv"):
29
+ #print os.path.abspath(os.path.dirname(sys.argv[0]))+"/charmmlipid2amber.csv"
30
+ # Process options
31
+ input_file_name=inputpdb
32
+ if outputpdb is not None:
33
+ output_file_name=outputpdb
34
+ else:
35
+ output_file_name=inputpdb.replace(".pdb","_amber.pdb")
36
+ convert_file_name=csv_dict
37
+ if convert_file_name == '':
38
+ print("Error: charmmlipid2amber.py substitution file not set. Provide -c or pass a valid csv_dict path.")
39
+ print("Usage: charmmlipid2amber.py [-c charmmlipid2amber.csv] -i input.pdb -o output.pdb")
40
+ sys.exit(2)
41
+ if os.path.isfile(convert_file_name) != True:
42
+ print("Error: No substitution file found. Check that the file set with -c is correct.")
43
+ sys.exit(1)
44
+ try:
45
+ input_file = open(input_file_name, 'r') # File to be processed
46
+ except IOError as err:
47
+ print("Error: ", str(err))
48
+ sys.exit(1)
49
+ input_file_list = [] # File to be processed as a list
50
+ for line in input_file:
51
+ input_file_list.append(line)
52
+ input_file.close()
53
+
54
+ # Process residues
55
+ residue_list = [] # List of residue numbers
56
+ residue_start = [] # List of lines where residues start. Line numbers start at 1.
57
+ residue_end = [] # List of lines where residues end, including TER card if present. Line numbers start at 1.
58
+ it0 = 1
59
+ previous_residue = "" # Residue number of the previous line (including TER card). Set to "" if it is not an ATOM record or TER card.
60
+ current_residue = "" # Residue number of the current line (including TER card). Set to "" if it is not an ATOM record or TER card.
61
+ previous_chain = ""
62
+ current_chain = ""
63
+ # Split file into residues by checking columns 23-27 (<99999 residues):
64
+ # First line:
65
+ if (input_file_list[0][0:6] == "ATOM " or
66
+ input_file_list[0][0:6] == "HETATM"):
67
+ residue_list.append(input_file_list[0][22:28])
68
+ residue_start.append(it0)
69
+ previous_residue = input_file_list[0][22:28]
70
+ previous_chain = input_file_list[0][21:22]
71
+ elif line[0:3] == "TER":
72
+ previous_residue = ""
73
+ previous_chain = ""
74
+ else:
75
+ previous_residue = ""
76
+ previous_chain = ""
77
+ it0+=1
78
+ #TER_trigger to separate residues according to TER flags. Only relevant when packing causes a single residue molecule
79
+ #to be packed at the beginning, and is not properly identified by residue number only
80
+ TER_trigger = False
81
+ # Rest of lines:
82
+ for line in input_file_list[1:]:
83
+ if line[0:6] == "ATOM " or line[0:6] == "HETATM":
84
+ current_residue = line[22:28]
85
+ current_chain = line[21:22]
86
+ elif line[0:3] == "TER":
87
+ current_residue = previous_residue
88
+ current_chain = previous_chain
89
+ else:
90
+ current_residue = ""
91
+ current_chain = ""
92
+ if previous_residue != current_residue or previous_chain != current_chain or TER_trigger:
93
+ # Previous line was not an ATOM or TER:
94
+ if previous_residue == "" or previous_chain == "":
95
+ residue_list.append(current_residue)
96
+ residue_start.append(it0)
97
+ previous_residue = current_residue
98
+ previous_chain = current_chain
99
+ # Current line is not an ATOM or TER:
100
+ elif current_residue == "" or current_chain == "":
101
+ residue_end.append(it0-1)
102
+ previous_residue = current_residue
103
+ previous_chain = current_chain
104
+ # Previous and current line are ATOM or TER:
105
+ else:
106
+ residue_list.append(current_residue)
107
+ residue_start.append(it0)
108
+ residue_end.append(it0-1)
109
+ previous_residue = current_residue
110
+ previous_chain = current_chain
111
+ TER_trigger = False
112
+ it0+=1
113
+ if line[0:3] == "TER":
114
+ TER_trigger = True
115
+ # If the last residue is not closed, define the end:
116
+ if current_residue != "":
117
+ residue_end.append(it0-1)
118
+
119
+ # Process substition dictionaries
120
+ try:
121
+ csv_file = open(convert_file_name, 'r') # csv file with all substitutions
122
+ except IOError as err:
123
+ print("Error: ", str(err))
124
+ sys.exit(1)
125
+ # Skip header line of csv file. Line 2 contains dictionary keys:
126
+ csv_file.readline()
127
+ csv_file_reader = csv.DictReader(csv_file) # Dictionary csv reader
128
+ replace_dict = {} # Dictionary of atom name and residue name search and replace
129
+ order_dict = {} # Dictionary of atom name and residue name order
130
+ ter_dict = {} # Dictionary of whether residue should have a TER card based on atom name and residue name. All atom name and residue name in a residue with a TER card will return True.
131
+ num_atom_dict = {} # Dictionary of number of atoms in current residue for the search string
132
+ for line in csv_file_reader:
133
+ replace_dict[line["search"]] = line["replace"]
134
+ order_dict[line["search"]] = int(line["order"])
135
+ ter_dict[line["search"]] = (line["TER"] == "True")
136
+ num_atom_dict[line["search"]] = int(line["num_atom"])
137
+ csv_file.close()
138
+
139
+ # Do substitions
140
+ # The search and replace is columns 13-21 in the PDB file:
141
+ # 13-16: atom name
142
+ # 17: alternate location indicator
143
+ # 18-20: residue name
144
+ # 21: sometimes used for the residue name
145
+ output_file_list = [] # File to be written in list form (after processing)
146
+ residue_substituted = False # For error checking. True if a substitution occurs.
147
+ for it1 in range(0, len(residue_list)):
148
+ # residue_start and residue_end indices start at 1.
149
+ # input_file_list indices start at 0.
150
+ input_residue = input_file_list[residue_start[it1]-1:
151
+ residue_end[it1]]
152
+ output_residue = []
153
+ # Process residue only if first atom is in the replacement dictionary:
154
+ if input_residue[0][12:21] in replace_dict:
155
+ residue_substituted = True
156
+ # Check if length of input_residue is correct:
157
+ # Count TER cards in residue for residue length arithmetic
158
+ n_TER_cards = 0
159
+ for line in input_residue:
160
+ if line[0:3] == "TER":
161
+ n_TER_cards += 1
162
+ if len(input_residue)-n_TER_cards != num_atom_dict[input_residue[0][12:21]]:
163
+ print("Error: Number of atoms in residue does not match number of atoms in residue in replacement data file")
164
+ print(input_residue, num_atom_dict[input_residue[0][12:21]])
165
+ sys.exit(1)
166
+ output_residue = len(input_residue)*[0]
167
+ for it2 in range(0, len(input_residue)):
168
+ line = input_residue[it2]
169
+ if line[0:3] != "TER":
170
+ search = line[12:21]
171
+ output_residue[order_dict[search]] = re.sub(search,
172
+ replace_dict[search], line)
173
+ else:
174
+ output_residue[it2] = "TER \n"
175
+ if ter_dict[input_residue[0][12:21]] == True:
176
+ if input_residue[-1][0:3] != "TER":
177
+ output_residue.append("TER \n")
178
+ else:
179
+ output_residue = input_residue
180
+ output_file_list.extend(output_residue)
181
+ # Check if any residues were substituted:
182
+ if residue_substituted == False:
183
+ print("No residues substituted by charmmlipid2amber")
184
+ return input_file_name
185
+
186
+ # Write output
187
+ try:
188
+ output_file = open(output_file_name, 'w') # File to be written
189
+ except IOError as err:
190
+ print("Error: ", str(err))
191
+ sys.exit(1)
192
+ output_file.write("REMARK Packmol generated pdb file, Packmol Memgen estimated parameters\n")
193
+ output_file.write("REMARK charmmlipid2amber.py transformed file\n")
194
+ for line in output_file_list:
195
+ output_file.write(line)
196
+ output_file.write("END \n")
197
+ output_file.close()
198
+ return output_file_name
199
+
200
+ if __name__ == '__main__':
201
+ # Process options
202
+ input_file_name=''
203
+ output_file_name=''
204
+ convert_file_name=''
205
+ try:
206
+ myopts, args = getopt.getopt(sys.argv[1:],"i:o:c:")
207
+ except getopt.GetoptError as err:
208
+ print("Error: ", str(err))
209
+ print("Usage: charmmlipid2amber.py [-c charmmlipid2amber.csv] -i input.pdb -o output.pdb")
210
+ sys.exit(2)
211
+ for o, a in myopts:
212
+ if o == "-i":
213
+ input_file_name = a
214
+ elif o == "-o":
215
+ output_file_name = a
216
+ elif o == "-c":
217
+ convert_file_name = a
218
+ else:
219
+ print("Usage: charmmlipid2amber.py [-c charmmlipid2amber.csv] -i input.pdb -o output.pdb")
220
+ sys.exit(0)
221
+ if input_file_name == '' or output_file_name == '':
222
+ print("Usage: charmmlipid2amber.py [-c charmmlipid2amber.csv] -i input.pdb -o output.pdb")
223
+ sys.exit(2)
224
+ charmmlipid2amber(input_file_name,outputpdb=output_file_name,csv_dict=os.path.abspath(os.path.dirname(sys.argv[0]))+"/charmmlipid2amber.csv")
225
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 Bosco Ho
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
File without changes
@@ -0,0 +1 @@
1
+ 0.9