gemmi-protools 1.0.1__py3-none-any.whl → 1.0.2__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.
- gemmi_protools/io/reader.py +19 -6
- gemmi_protools/tools/pdb_annot.py +1 -4
- {gemmi_protools-1.0.1.dist-info → gemmi_protools-1.0.2.dist-info}/METADATA +1 -1
- {gemmi_protools-1.0.1.dist-info → gemmi_protools-1.0.2.dist-info}/RECORD +7 -7
- {gemmi_protools-1.0.1.dist-info → gemmi_protools-1.0.2.dist-info}/WHEEL +0 -0
- {gemmi_protools-1.0.1.dist-info → gemmi_protools-1.0.2.dist-info}/licenses/LICENSE +0 -0
- {gemmi_protools-1.0.1.dist-info → gemmi_protools-1.0.2.dist-info}/top_level.txt +0 -0
gemmi_protools/io/reader.py
CHANGED
|
@@ -364,13 +364,24 @@ class StructureParser(object):
|
|
|
364
364
|
return out
|
|
365
365
|
|
|
366
366
|
def polymer_sequences(self, pdbx: bool = False):
|
|
367
|
+
"""
|
|
368
|
+
entity sequences for polymers
|
|
369
|
+
:param pdbx:
|
|
370
|
+
:return:
|
|
371
|
+
"""
|
|
367
372
|
out = dict()
|
|
373
|
+
subchain_id2entity_id = self.subchain_id_to_entity_id
|
|
374
|
+
entity_dict = {ent.name: ent for ent in self.STRUCT.entities}
|
|
375
|
+
|
|
368
376
|
for ch, polymer_type in self.polymer_types.items():
|
|
369
377
|
polymer = self.get_chain(ch).get_polymer()
|
|
378
|
+
entity_id = subchain_id2entity_id[polymer.subchain_id()]
|
|
379
|
+
ent = entity_dict[entity_id]
|
|
380
|
+
|
|
370
381
|
if pdbx:
|
|
371
|
-
s = gemmi.pdbx_one_letter_code(
|
|
382
|
+
s = gemmi.pdbx_one_letter_code(ent.full_sequence, gemmi.sequence_kind(polymer_type))
|
|
372
383
|
else:
|
|
373
|
-
s =
|
|
384
|
+
s = "".join([gemmi.find_tabulated_residue(r).one_letter_code for r in ent.full_sequence]).upper()
|
|
374
385
|
out[ch] = s
|
|
375
386
|
return out
|
|
376
387
|
|
|
@@ -660,15 +671,18 @@ class StructureParser(object):
|
|
|
660
671
|
raise ValueError("Chain %s not in found" % chain_name_2)
|
|
661
672
|
|
|
662
673
|
flag = True
|
|
674
|
+
sw_name = ""
|
|
675
|
+
|
|
663
676
|
while flag:
|
|
664
677
|
characters = string.ascii_letters + string.digits
|
|
665
678
|
sw_name = ''.join(random.choices(characters, k=4))
|
|
666
679
|
if sw_name not in self.chain_ids:
|
|
667
680
|
flag = False
|
|
668
681
|
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
682
|
+
if sw_name != "":
|
|
683
|
+
self.rename_chain(chain_name_1, sw_name)
|
|
684
|
+
self.rename_chain(chain_name_2, chain_name_1)
|
|
685
|
+
self.rename_chain(sw_name, chain_name_2)
|
|
672
686
|
|
|
673
687
|
def make_one_letter_chain(self, only_uppercase: bool = True):
|
|
674
688
|
uppercase_letters = list(string.ascii_uppercase)
|
|
@@ -695,7 +709,6 @@ class StructureParser(object):
|
|
|
695
709
|
|
|
696
710
|
# not use yet
|
|
697
711
|
letters_valid = [l for l in letters if l not in self.chain_ids]
|
|
698
|
-
chains2rename = [ch for ch in self.chain_ids if ch not in letters]
|
|
699
712
|
mapper = {ch: letters_valid.pop() for ch in self.chain_ids if ch not in letters}
|
|
700
713
|
|
|
701
714
|
for origin_name, target_name in mapper.items():
|
|
@@ -205,10 +205,7 @@ def annotate_pdb(struct_file: str):
|
|
|
205
205
|
st.load_from_file(struct_file)
|
|
206
206
|
st.clean_structure()
|
|
207
207
|
|
|
208
|
-
subchain_id2entity_id =
|
|
209
|
-
for ent in st.STRUCT.entities:
|
|
210
|
-
for ch in ent.subchains:
|
|
211
|
-
subchain_id2entity_id[ch] = ent.name
|
|
208
|
+
subchain_id2entity_id = st.subchain_id_to_entity_id
|
|
212
209
|
|
|
213
210
|
# Merge sequences
|
|
214
211
|
polymers = dict()
|
|
@@ -6,14 +6,14 @@ gemmi_protools/data/MHC/MHC_combined.hmm.h3m,sha256=CvNMCsobQiX-wL7iB4CreNcbpnEl
|
|
|
6
6
|
gemmi_protools/data/MHC/MHC_combined.hmm.h3p,sha256=-mK278pRedG3-KL-DtuVAQy7La9DgXg5FcP89D6X3Ck,78325
|
|
7
7
|
gemmi_protools/io/__init__.py,sha256=F6e1xNT_7lZAWQgNIneH06o2qtWYrHNr_xPUPTwwx5E,29
|
|
8
8
|
gemmi_protools/io/convert.py,sha256=A1i1vPgxG1LqMSUvWtegLl9LipgUQbfmKeGJ_f00UYo,3781
|
|
9
|
-
gemmi_protools/io/reader.py,sha256=
|
|
9
|
+
gemmi_protools/io/reader.py,sha256=X4onV0IVl0Q7JVH0yg2Zy-8iPIZvRPM-aaxDapawiro,33617
|
|
10
10
|
gemmi_protools/tools/__init__.py,sha256=F6e1xNT_7lZAWQgNIneH06o2qtWYrHNr_xPUPTwwx5E,29
|
|
11
11
|
gemmi_protools/tools/align.py,sha256=oKHvpeDa62zEjLkPmuyBM6avYDl3HFeJVHeRX62I2f4,7085
|
|
12
12
|
gemmi_protools/tools/dockq.py,sha256=baCuO5-GZCwrlS59T5UIXogpM44OIFIfXqksqRBAb0A,4428
|
|
13
13
|
gemmi_protools/tools/mesh.py,sha256=73MuJYwS_ACJI15OsrooAAhB1Ti4fM8CJSBqFOBR7LU,6537
|
|
14
|
-
gemmi_protools/tools/pdb_annot.py,sha256=
|
|
15
|
-
gemmi_protools-1.0.
|
|
16
|
-
gemmi_protools-1.0.
|
|
17
|
-
gemmi_protools-1.0.
|
|
18
|
-
gemmi_protools-1.0.
|
|
19
|
-
gemmi_protools-1.0.
|
|
14
|
+
gemmi_protools/tools/pdb_annot.py,sha256=enATyAHq0dE8TMsKQhsSbYj-baGrI33iviJdW2R7Hv8,8157
|
|
15
|
+
gemmi_protools-1.0.2.dist-info/licenses/LICENSE,sha256=JuQvKcgj6n11y5y6nXr9rABv3gJSswc4eTCd5WZBtSY,1062
|
|
16
|
+
gemmi_protools-1.0.2.dist-info/METADATA,sha256=29ea2GIobnQjR6N0VQaI6MRvcH6UCG7cTpzETUUIrCE,1034
|
|
17
|
+
gemmi_protools-1.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
18
|
+
gemmi_protools-1.0.2.dist-info/top_level.txt,sha256=P12mYJi5O5EKIn5u-RFaWxuix431CgLacSRD7rBid_U,15
|
|
19
|
+
gemmi_protools-1.0.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|