dcatoolkit 0.1.7__tar.gz → 0.1.8__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
1
  Metadata-Version: 2.1
2
2
  Name: dcatoolkit
3
- Version: 0.1.7
3
+ Version: 0.1.8
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.1.7"
7
+ version = "0.1.8"
8
8
  description = "Collection of useful modules and representations for managing DCA output data."
9
9
  keywords = ["dca", "toolkit", "DI", "coevolution"]
10
10
 
@@ -1,4 +1,4 @@
1
1
 
2
- __version__ = "0.1.7"
2
+ __version__ = "0.1.8"
3
3
  from .representation import Pairs, DirectInformationData, StructureInformation, ResidueAlignment
4
4
  from .analytics import MSATools
@@ -641,7 +641,9 @@ class StructureInformation:
641
641
  self.unique_chains : numpy.ndarray, optional
642
642
  Array of unique asym_id entries which corresponds to unique chain IDs.
643
643
  self.chain_auth_dict : dict of str, str, optional
644
- Uses chain id as a key and provides auth chain id as a value.
644
+ Uses chain id as a key and provides auth chain id as a value.
645
+ self.auth_chain_dict : dict of str, str, optional
646
+ Uses auth chain id as a key and provides original/label chain id as a value.
645
647
  self.res_auth_dict : dict of str, tuple of int, int or optional
646
648
  Uses chain id as a key and an array of residue index and auth residue index as a value.
647
649
  """
@@ -670,6 +672,7 @@ class StructureInformation:
670
672
  self.first_block = list(self.pdbx_file)[0]
671
673
  self.atom_site_category = self.pdbx_file[self.first_block].get('atom_site')
672
674
  self.chain_auth_dict = {}
675
+ self.auth_chain_dict = {}
673
676
  self.res_auth_dict = {}
674
677
  if self.atom_site_category:
675
678
  group_pdbs = []
@@ -700,6 +703,7 @@ class StructureInformation:
700
703
  for unique_chain in self.unique_chains:
701
704
  unique_entry = self.atom_data[self.atom_data[:,2] == unique_chain][0]
702
705
  self.chain_auth_dict[unique_entry[2]] = unique_entry[4]
706
+ self.auth_chain_dict[unique_entry[4]] = unique_entry[2]
703
707
  self.res_auth_dict[unique_entry[2]] = unique_entry[[1,3]].astype('int')
704
708
  else:
705
709
  self.atom_site_category = None
@@ -775,7 +779,6 @@ class StructureInformation:
775
779
  else:
776
780
  return str(self.full_sequences[self.chain_auth_dict[chain_id]])
777
781
 
778
-
779
782
  def get_non_missing_sequence(self, chain_id: str, auth_chain_id_supplied: bool=False) -> str:
780
783
  """
781
784
  Get sequence, including only non-missing residues, from the specified chain off of RCSB.
@@ -793,15 +796,10 @@ class StructureInformation:
793
796
  The full sequence, including only non-missing residues, of the chain specified.
794
797
  """
795
798
  if auth_chain_id_supplied:
796
- original_chain_id = None
797
- for key in self.chain_auth_dict.keys():
798
- if self.chain_auth_dict[key] == chain_id:
799
- original_chain_id = key
800
- if original_chain_id is None:
801
- raise Exception("Auth chain id supplied not found in chain_auth_dict.")
802
- else:
803
- return self.non_missing_sequences[original_chain_id]
804
- return self.non_missing_sequences[chain_id]
799
+ original_chain_id = self.auth_chain_dict[chain_id]
800
+ return self.non_missing_sequences[original_chain_id]
801
+ else:
802
+ return self.non_missing_sequences[chain_id]
805
803
 
806
804
  def get_chain_specific_structure(self, ca_only: bool, chain1: str, chain2: str, remove_hetero=True) -> tuple:
807
805
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dcatoolkit
3
- Version: 0.1.7
3
+ Version: 0.1.8
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>
File without changes
File without changes
File without changes