gemmi-protools 0.1.11__py3-none-any.whl → 0.1.13__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.

Potentially problematic release.


This version of gemmi-protools might be problematic. Click here for more details.

@@ -88,15 +88,7 @@ class StructureParser(object):
88
88
  resolution_remarks = ["%-80s" % "REMARK 2",
89
89
  "%-80s" % rs]
90
90
 
91
- resolution_remark_exist = False
92
- for line in struct.raw_remarks:
93
- if "REMARK 2 RESOLUTION" in line:
94
- resolution_remark_exist = True
95
-
96
- if not resolution_remark_exist:
97
- struct.raw_remarks = resolution_remarks + struct.raw_remarks
98
-
99
- struct.raw_remarks = compound_source + struct.raw_remarks
91
+ struct.raw_remarks = compound_source + resolution_remarks
100
92
  if write_minimal_pdb:
101
93
  struct.write_minimal_pdb(outfile)
102
94
  else:
@@ -196,21 +196,17 @@ def repair_structure(input_file: str,
196
196
  ############################################################
197
197
  # Check and convert input_file to .pdb if not
198
198
  ############################################################
199
+ input_file = str(pathlib.Path(input_file).expanduser().resolve())
200
+ output_file = str(pathlib.Path(output_file).expanduser().resolve())
201
+ # input_file and output_file can't be the same path
202
+ assert input_file != output_file, "input_file and output_file can't be the same path"
203
+
199
204
  assert os.path.splitext(output_file)[1] == ".pdb", "output_file Not .pdb: %s" % output_file
200
205
  assert _is_cif(input_file) or _is_pdb(input_file), "Not .pdb or .cif or .pdb.gz or .cif.gz: %s" % input_file
201
206
 
202
- # input_file and output_file can't be the same path
203
- p_in = pathlib.Path(input_file).expanduser().resolve()
204
- p_out = pathlib.Path(output_file).expanduser().resolve()
205
-
206
- assert str(p_in) != str(p_out), "input_file and output_file can't be the same path"
207
207
  ############################################################
208
208
  # Config Path
209
209
  ############################################################
210
- file_name = os.path.basename(input_file)
211
- stem_name = os.path.splitext(file_name)[0]
212
-
213
- in_dir = os.path.dirname(input_file)
214
210
  out_dir = os.path.dirname(output_file)
215
211
  if not os.path.isdir(out_dir):
216
212
  os.makedirs(out_dir)
@@ -220,16 +216,14 @@ def repair_structure(input_file: str,
220
216
  shutil.rmtree(temp_dir)
221
217
  os.makedirs(temp_dir)
222
218
 
223
- if os.path.splitext(input_file)[1] != ".pdb":
224
- # convert to .pdb
225
- st = StructureParser()
226
- st.load_from_file(input_file)
227
- file_name_r = "%s.pdb" % stem_name
228
- in_dir_r = temp_dir
229
- st.to_pdb(os.path.join(in_dir_r, file_name_r))
230
- else:
231
- file_name_r = file_name
232
- in_dir_r = in_dir
219
+ # for fix the filename bug of foldx
220
+ # rename the input always and save to .pdb
221
+ # convert to .pdb
222
+ st = StructureParser()
223
+ st.load_from_file(input_file)
224
+ file_name_r = "in.pdb"
225
+ in_dir_r = temp_dir
226
+ st.to_pdb(os.path.join(in_dir_r, file_name_r))
233
227
 
234
228
  foldx_path = shutil.which("foldx")
235
229
  if foldx_path is None:
@@ -250,7 +244,6 @@ def repair_structure(input_file: str,
250
244
  repair_cmd.append("--complexWithRNA true")
251
245
 
252
246
  command_settings = ["cd %s &&" % temp_dir] + repair_cmd + ["&& cd %s" % cwd_dir]
253
-
254
247
  start = time.time()
255
248
  try:
256
249
  result = subprocess.run(" ".join(command_settings), shell=True, check=True,
@@ -266,7 +259,7 @@ def repair_structure(input_file: str,
266
259
  else:
267
260
  if msg_str == "Finished":
268
261
  # just keep .pdb, ignore .fxout
269
- result_file = os.path.join(temp_dir, "%s_Repair.pdb" % stem_name)
262
+ result_file = os.path.join(temp_dir, "in_Repair.pdb")
270
263
  if os.path.exists(result_file):
271
264
  shutil.move(result_file, output_file)
272
265
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gemmi_protools
3
- Version: 0.1.11
3
+ Version: 0.1.13
4
4
  Summary: An Enhanced tool to process PDB structures based on Gemmi
5
5
  Author-email: Luo Jiejian <luojiejian12@mails.ucas.ac.cn>
6
6
  License-Expression: MIT
@@ -6,15 +6,15 @@ gemmi_protools/io/parse_pdb_header.py,sha256=UOGMsE3-d3APhO7zaAEE0NT31n-iqt55VpD
6
6
  gemmi_protools/io/parser.py,sha256=HFc4Kovr6rxEpLAEDUtF_e-RnA5OsWMeMFjuVNm7UYY,9507
7
7
  gemmi_protools/io/pdb_opts.py,sha256=laUqxlecOe6goax12q8EJGZuZbHyIGsXVucMV3gVrgg,5741
8
8
  gemmi_protools/io/peptide.py,sha256=a2wiEutJmvhl6gDCIzzqRCbmyknk2mwgy2FZ53lXclU,750
9
- gemmi_protools/io/reader.py,sha256=lI9JTXqsct3D719qVN7Dsvg-zHudElojpW5-odtXa8A,16527
9
+ gemmi_protools/io/reader.py,sha256=2AXg1JdYT2LxL6jWVsJkLHQREwAoYR7V-g-hQVgSgGg,16237
10
10
  gemmi_protools/io/struct_info.py,sha256=9nBj1Zer03S8_Wks7L7uRlc9PlbfCKzoaT32pKR58X8,2769
11
11
  gemmi_protools/utils/__init__.py,sha256=F6e1xNT_7lZAWQgNIneH06o2qtWYrHNr_xPUPTwwx5E,29
12
12
  gemmi_protools/utils/align.py,sha256=CZcrvjy-ZbX2u7OAn-YGblbxaj9YFUDX4CFZcpbpnB8,6959
13
13
  gemmi_protools/utils/dockq.py,sha256=XmMwVEy-H4p6sH_HPcDWA3TP77OWdih0fE_BQJDr4pU,4189
14
- gemmi_protools/utils/fixer.py,sha256=RDmpoZpTrGdwuJQTTK1eif132MHV1I-T6Nt47ezgxTM,10236
14
+ gemmi_protools/utils/fixer.py,sha256=WCk2BztM4tSKWp0EGoBFK4Rge330_7LPXNe2kmk-9f0,10046
15
15
  gemmi_protools/utils/ppi.py,sha256=VWYsdxWwQoS1xwEYj5KB96Zz3F8r5Eyuw6NT3ReD-wc,2330
16
- gemmi_protools-0.1.11.dist-info/licenses/LICENSE,sha256=JuQvKcgj6n11y5y6nXr9rABv3gJSswc4eTCd5WZBtSY,1062
17
- gemmi_protools-0.1.11.dist-info/METADATA,sha256=liLlq__4RA0P1MW4gE_HmpyGfqDPQPMF8n0E3sGpKN4,568
18
- gemmi_protools-0.1.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
- gemmi_protools-0.1.11.dist-info/top_level.txt,sha256=P12mYJi5O5EKIn5u-RFaWxuix431CgLacSRD7rBid_U,15
20
- gemmi_protools-0.1.11.dist-info/RECORD,,
16
+ gemmi_protools-0.1.13.dist-info/licenses/LICENSE,sha256=JuQvKcgj6n11y5y6nXr9rABv3gJSswc4eTCd5WZBtSY,1062
17
+ gemmi_protools-0.1.13.dist-info/METADATA,sha256=pfbi9HsUmoRy6ABRoqTu5IrmaAs2ACc81On-37f1VuI,568
18
+ gemmi_protools-0.1.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
+ gemmi_protools-0.1.13.dist-info/top_level.txt,sha256=P12mYJi5O5EKIn5u-RFaWxuix431CgLacSRD7rBid_U,15
20
+ gemmi_protools-0.1.13.dist-info/RECORD,,