dcatoolkit 0.2.0__tar.gz → 0.2.1__tar.gz

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.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: dcatoolkit
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Collection of useful modules and representations for managing DCA output data.
5
5
  Author-email: Raheel Syed Ahmed <raheelsyedahmed@gmail.com>
6
6
  Maintainer-email: Raheel Syed Ahmed <raheelsyedahmed@gmail.com>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "dcatoolkit"
7
- version = "0.2.0"
7
+ version = "0.2.1"
8
8
  description = "Collection of useful modules and representations for managing DCA output data."
9
9
  keywords = ["dca", "toolkit", "DI", "coevolution"]
10
10
 
@@ -1,5 +1,5 @@
1
1
 
2
- __version__ = "0.1.9"
2
+ __version__ = "0.2.1"
3
3
  from .representation import Pairs, DirectInformationData, StructureInformation, ResidueAlignment, MMCIFInformation, PDBInformation
4
4
  from .analytics import MSATools
5
5
 
@@ -624,7 +624,7 @@ class StructureInformation:
624
624
  """
625
625
  @overload
626
626
  @staticmethod
627
- def fetch_pdb(pdb_id: str, struc_format: Literal["mmcif"]="mmcif", model_num: int=1) -> 'MMCIFInformation':
627
+ def fetch_pdb(pdb_id: str, struc_format: Literal["mmcif"], model_num: int=1) -> 'MMCIFInformation':
628
628
  ...
629
629
 
630
630
  @overload
@@ -1159,6 +1159,8 @@ class PDBInformation(StructureInformation):
1159
1159
  if chain1 in self.unique_chains and chain2 in self.unique_chains:
1160
1160
  shift1 = non_hetero_structure[non_hetero_structure.chain_id == chain1][0].res_id - 1
1161
1161
  shift2 = non_hetero_structure[non_hetero_structure.chain_id == chain2][0].res_id - 1
1162
+ shift1 *= -1
1163
+ shift2 *= -1
1162
1164
  return shift1, shift2
1163
1165
  else:
1164
1166
  return shift1, shift2
@@ -1195,8 +1197,8 @@ class PDBInformation(StructureInformation):
1195
1197
  ind = np.unravel_index(np.argmin(dist_matrix), dist_matrix.shape)
1196
1198
  # Use the indices to access the atom in the atom array and get the correct atom name.
1197
1199
  # Generate the auth ids of the residues in the pairs ndarray
1198
- orig_res_id1 = row['residue1'] - shift1
1199
- orig_res_id2 = row['residue2'] - shift2
1200
+ orig_res_id1 = row['residue1'] + shift1
1201
+ orig_res_id2 = row['residue2'] + shift2
1200
1202
  min_dist_pairs_atoms.append((orig_res_id1, orig_res_id2, row['residue1'], row['residue2'], chain1_res1_structure[ind[0]].atom_name, chain2_res2_structure[ind[1]].atom_name))
1201
1203
  min_dist_pairs_atoms_arr = np.array(min_dist_pairs_atoms, dtype={'names': ['residue1','residue2','auth_residue1','auth_residue2','atom_name1','atom_name2'], 'formats': [int,int,int,int,'<U10','<U10']})
1202
1204
  return min_dist_pairs_atoms_arr
@@ -1235,7 +1237,7 @@ class PDBInformation(StructureInformation):
1235
1237
  if not(chain1==chain2 and res1 >= res2):
1236
1238
  if not auth_contacts:
1237
1239
  shift1, shift2 = self.get_shift_values(chain1, chain2)
1238
- contacts_set.add((res1 - shift1, res2 - shift2))
1240
+ contacts_set.add((res1 + shift1, res2 + shift2))
1239
1241
  else:
1240
1242
  contacts_set.add((res1, res2))
1241
1243
  return contacts_set
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: dcatoolkit
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Collection of useful modules and representations for managing DCA output data.
5
5
  Author-email: Raheel Syed Ahmed <raheelsyedahmed@gmail.com>
6
6
  Maintainer-email: Raheel Syed Ahmed <raheelsyedahmed@gmail.com>
@@ -59,9 +59,9 @@ def check_contacts(test_CA: bool, threshold: float):
59
59
 
60
60
  cif_file_contacts = read_contacts(corresponding_file)
61
61
  chain1, auth_chain1, chain2, auth_chain2 = pdb_id_chain_map[pdb_id]
62
- fetch_cif_contacts = {(int(x[0]), int(x[1])) for x in MMCIFInformation.fetch_pdb(pdb_id).get_contacts(test_CA, threshold, chain1, chain2, auth_contacts=True)}
62
+ fetch_cif_contacts = {(int(x[0]), int(x[1])) for x in MMCIFInformation.fetch_pdb(pdb_id, 'mmcif').get_contacts(test_CA, threshold, chain1, chain2, auth_contacts=True)}
63
63
  read_cif_contacts = {(int(x[0]), int(x[1])) for x in MMCIFInformation.read_mmCIF_file(str(cif_file)).get_contacts(test_CA, threshold, chain1, chain2, auth_contacts=True)}
64
- fetch_authchain_cif_contacts = {(int(x[0]), int(x[1])) for x in MMCIFInformation.fetch_pdb(pdb_id).get_contacts(test_CA, threshold, auth_chain1, auth_chain2, auth_contacts=True, auth_chain_id_supplied=True)}
64
+ fetch_authchain_cif_contacts = {(int(x[0]), int(x[1])) for x in MMCIFInformation.fetch_pdb(pdb_id, 'mmcif').get_contacts(test_CA, threshold, auth_chain1, auth_chain2, auth_contacts=True, auth_chain_id_supplied=True)}
65
65
  read_authchain_cif_contacts = {(int(x[0]), int(x[1])) for x in MMCIFInformation.read_mmCIF_file(str(cif_file)).get_contacts(test_CA, threshold, auth_chain1, auth_chain2, auth_contacts=True, auth_chain_id_supplied=True)}
66
66
  fetch_pdb_contacts = {(int(x[0]), int(x[1])) for x in PDBInformation.fetch_pdb(pdb_id, struc_format="pdb").get_contacts(test_CA, threshold, auth_chain1, auth_chain2, auth_contacts=True)}
67
67
  read_pdb_contacts = {(int(x[0]), int(x[1])) for x in PDBInformation.read_pdb_file(f"tests/pdb_info/{pdb_id.lower()}.pdb").get_contacts(test_CA, threshold, auth_chain1, auth_chain2, auth_contacts=True)}
File without changes
File without changes
File without changes