dcatoolkit 0.3.0__tar.gz → 0.4.0__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.
Files changed (23) hide show
  1. {dcatoolkit-0.3.0/src/dcatoolkit.egg-info → dcatoolkit-0.4.0}/PKG-INFO +4 -6
  2. {dcatoolkit-0.3.0 → dcatoolkit-0.4.0}/README.md +1 -1
  3. {dcatoolkit-0.3.0 → dcatoolkit-0.4.0}/pyproject.toml +3 -5
  4. {dcatoolkit-0.3.0 → dcatoolkit-0.4.0}/src/dcatoolkit/representation/structure.py +9 -3
  5. {dcatoolkit-0.3.0 → dcatoolkit-0.4.0/src/dcatoolkit.egg-info}/PKG-INFO +4 -6
  6. {dcatoolkit-0.3.0 → dcatoolkit-0.4.0}/src/dcatoolkit.egg-info/requires.txt +1 -1
  7. {dcatoolkit-0.3.0 → dcatoolkit-0.4.0}/LICENSE +0 -0
  8. {dcatoolkit-0.3.0 → dcatoolkit-0.4.0}/setup.cfg +0 -0
  9. {dcatoolkit-0.3.0 → dcatoolkit-0.4.0}/src/dcatoolkit/__init__.py +0 -0
  10. {dcatoolkit-0.3.0 → dcatoolkit-0.4.0}/src/dcatoolkit/analytics.py +0 -0
  11. {dcatoolkit-0.3.0 → dcatoolkit-0.4.0}/src/dcatoolkit/representation/__init__.py +0 -0
  12. {dcatoolkit-0.3.0 → dcatoolkit-0.4.0}/src/dcatoolkit/representation/alignment.py +0 -0
  13. {dcatoolkit-0.3.0 → dcatoolkit-0.4.0}/src/dcatoolkit/representation/di.py +0 -0
  14. {dcatoolkit-0.3.0 → dcatoolkit-0.4.0}/src/dcatoolkit/representation/pairs.py +0 -0
  15. {dcatoolkit-0.3.0 → dcatoolkit-0.4.0}/src/dcatoolkit.egg-info/SOURCES.txt +0 -0
  16. {dcatoolkit-0.3.0 → dcatoolkit-0.4.0}/src/dcatoolkit.egg-info/dependency_links.txt +0 -0
  17. {dcatoolkit-0.3.0 → dcatoolkit-0.4.0}/src/dcatoolkit.egg-info/top_level.txt +0 -0
  18. {dcatoolkit-0.3.0 → dcatoolkit-0.4.0}/tests/test_alignments.py +0 -0
  19. {dcatoolkit-0.3.0 → dcatoolkit-0.4.0}/tests/test_analytics.py +0 -0
  20. {dcatoolkit-0.3.0 → dcatoolkit-0.4.0}/tests/test_contacts.py +0 -0
  21. {dcatoolkit-0.3.0 → dcatoolkit-0.4.0}/tests/test_di.py +0 -0
  22. {dcatoolkit-0.3.0 → dcatoolkit-0.4.0}/tests/test_pairs.py +0 -0
  23. {dcatoolkit-0.3.0 → dcatoolkit-0.4.0}/tests/test_structure.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dcatoolkit
3
- Version: 0.3.0
3
+ Version: 0.4.0
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>
@@ -35,13 +35,11 @@ Classifier: Intended Audience :: Science/Research
35
35
  Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
36
36
  Classifier: License :: OSI Approved :: MIT License
37
37
  Classifier: Programming Language :: Python :: 3
38
- Classifier: Programming Language :: Python :: 3.10
39
- Classifier: Programming Language :: Python :: 3.11
40
38
  Classifier: Programming Language :: Python :: 3.12
41
- Requires-Python: >=3.10
39
+ Requires-Python: >=3.12
42
40
  Description-Content-Type: text/markdown
43
41
  License-File: LICENSE
44
- Requires-Dist: biotite>=1.0.1
42
+ Requires-Dist: biotite>=1.7
45
43
  Requires-Dist: numpy>=1.26.0
46
44
  Requires-Dist: pandas>=2.1.0
47
45
  Requires-Dist: scipy>=1.11.0
@@ -69,7 +67,7 @@ pip install dcatoolkit
69
67
  pip install "dcatoolkit[plot]"
70
68
  ```
71
69
 
72
- Requires Python 3.10+.
70
+ Requires Python 3.12+.
73
71
  Upgrading from 0.2.x? See the [changelog](https://github.com/RaheelSyedAhmed/dcatoolkit/blob/main/CHANGELOG.md).
74
72
 
75
73
  ## Major Sections
@@ -10,7 +10,7 @@ pip install dcatoolkit
10
10
  pip install "dcatoolkit[plot]"
11
11
  ```
12
12
 
13
- Requires Python 3.10+.
13
+ Requires Python 3.12+.
14
14
  Upgrading from 0.2.x? See the [changelog](https://github.com/RaheelSyedAhmed/dcatoolkit/blob/main/CHANGELOG.md).
15
15
 
16
16
  ## Major Sections
@@ -4,14 +4,14 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "dcatoolkit"
7
- version = "0.3.0"
7
+ version = "0.4.0"
8
8
  description = "Collection of useful modules and representations for managing DCA output data."
9
9
  keywords = ["dca", "toolkit", "DI", "coevolution"]
10
10
 
11
11
  readme = "README.md"
12
12
  license = {file = "LICENSE"}
13
13
 
14
- requires-python = ">=3.10"
14
+ requires-python = ">=3.12"
15
15
 
16
16
  authors = [
17
17
  {name = "Raheel Syed Ahmed", email = "raheelsyedahmed@gmail.com"}
@@ -21,7 +21,7 @@ maintainers = [
21
21
  ]
22
22
 
23
23
  dependencies = [
24
- "biotite>=1.0.1",
24
+ "biotite>=1.7",
25
25
  "numpy>=1.26.0",
26
26
  "pandas>=2.1.0",
27
27
  "scipy>=1.11.0",
@@ -33,8 +33,6 @@ classifiers = [
33
33
  "Topic :: Scientific/Engineering :: Bio-Informatics",
34
34
  "License :: OSI Approved :: MIT License",
35
35
  "Programming Language :: Python :: 3",
36
- "Programming Language :: Python :: 3.10",
37
- "Programming Language :: Python :: 3.11",
38
36
  "Programming Language :: Python :: 3.12",
39
37
  ]
40
38
 
@@ -1,3 +1,4 @@
1
+ import io
1
2
  from typing import Literal, Union, overload
2
3
 
3
4
  import biotite.database.rcsb as rcsb
@@ -56,13 +57,18 @@ class StructureInformation:
56
57
  Raises
57
58
  ------
58
59
  TypeError
59
- If the fetched data was not found and None was returned instead.
60
+ If the fetched data was not found and None was returned instead, or if RCSB returned binary data (``io.BytesIO``) instead of text.
60
61
  ValueError
61
62
  If `struc_format` is not ``"mmcif"`` or ``"pdb"``.
63
+ biotite.database.RequestError
64
+ If `pdb_id` is not a valid PDB ID (raised by `biotite.database.rcsb.fetch()`).
62
65
  """
63
66
  fetched_data = rcsb.fetch(pdb_id, struc_format)
64
67
  if fetched_data is None:
65
- raise TypeError("RCSB fetch failed. Try fetch again.")
68
+ raise TypeError("RCSB fetch failed. Confirm RCSB's fetch API is available and, with stable internet connection, try fetch again.")
69
+ elif isinstance(fetched_data, io.BytesIO):
70
+ # rcsb.fetch returns binary formats (e.g. "bcif", or gzip=True) as BytesIO; the file readers below need text (StringIO).
71
+ raise TypeError(f"RCSB returned binary data for struc_format {struc_format!r}; only the text formats 'mmcif' and 'pdb' are supported.")
66
72
  elif struc_format == "mmcif":
67
73
  pdbx_file = pdbx.CIFFile.read(fetched_data)
68
74
  return MMCIFInformation(pdbx.get_structure(pdbx_file=pdbx_file, model=model_num, use_author_fields=False), pdbx_file, model_num)
@@ -255,7 +261,7 @@ class MMCIFInformation(StructureInformation):
255
261
  unique_entry = atom_data[atom_data[:,2] == unique_chain][0]
256
262
  self.chain_auth_dict[unique_entry[2]] = unique_entry[4]
257
263
  self.auth_chain_dict[unique_entry[4]] = unique_entry[2]
258
- self.atom_site_df = pd.DataFrame(np.column_stack([atom_site_category[category].as_array() for category in atom_site_category]), columns=atom_site_category.keys())
264
+ self.atom_site_df = pd.DataFrame(np.column_stack([atom_site_category[category].as_array() for category in atom_site_category]), columns=list(atom_site_category))
259
265
  type_conversion_dict = {'label_seq_id': 'int64', 'auth_seq_id': 'int64', 'id': 'int64', 'Cartn_x': 'float', 'Cartn_y': 'float','Cartn_z': 'float', 'B_iso_or_equiv': 'float'}
260
266
  self.atom_df = self.atom_site_df[self.atom_site_df['group_PDB'] == 'ATOM'].astype(type_conversion_dict)
261
267
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dcatoolkit
3
- Version: 0.3.0
3
+ Version: 0.4.0
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>
@@ -35,13 +35,11 @@ Classifier: Intended Audience :: Science/Research
35
35
  Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
36
36
  Classifier: License :: OSI Approved :: MIT License
37
37
  Classifier: Programming Language :: Python :: 3
38
- Classifier: Programming Language :: Python :: 3.10
39
- Classifier: Programming Language :: Python :: 3.11
40
38
  Classifier: Programming Language :: Python :: 3.12
41
- Requires-Python: >=3.10
39
+ Requires-Python: >=3.12
42
40
  Description-Content-Type: text/markdown
43
41
  License-File: LICENSE
44
- Requires-Dist: biotite>=1.0.1
42
+ Requires-Dist: biotite>=1.7
45
43
  Requires-Dist: numpy>=1.26.0
46
44
  Requires-Dist: pandas>=2.1.0
47
45
  Requires-Dist: scipy>=1.11.0
@@ -69,7 +67,7 @@ pip install dcatoolkit
69
67
  pip install "dcatoolkit[plot]"
70
68
  ```
71
69
 
72
- Requires Python 3.10+.
70
+ Requires Python 3.12+.
73
71
  Upgrading from 0.2.x? See the [changelog](https://github.com/RaheelSyedAhmed/dcatoolkit/blob/main/CHANGELOG.md).
74
72
 
75
73
  ## Major Sections
@@ -1,4 +1,4 @@
1
- biotite>=1.0.1
1
+ biotite>=1.7
2
2
  numpy>=1.26.0
3
3
  pandas>=2.1.0
4
4
  scipy>=1.11.0
File without changes
File without changes
File without changes