biointerface 0.2.1__tar.gz → 0.2.3__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 (35) hide show
  1. {biointerface-0.2.1 → biointerface-0.2.3}/CONTRIBUTING.rst +1 -1
  2. biointerface-0.2.3/HISTORY.rst +42 -0
  3. {biointerface-0.2.1 → biointerface-0.2.3}/PKG-INFO +25 -5
  4. {biointerface-0.2.1 → biointerface-0.2.3}/README.rst +23 -3
  5. biointerface-0.2.3/docs/usage.rst +194 -0
  6. {biointerface-0.2.1 → biointerface-0.2.3}/pyproject.toml +8 -24
  7. {biointerface-0.2.1 → biointerface-0.2.3}/src/biointerface/__init__.py +1 -1
  8. {biointerface-0.2.1 → biointerface-0.2.3}/src/biointerface/core.py +66 -5
  9. {biointerface-0.2.1 → biointerface-0.2.3}/src/biointerface.egg-info/PKG-INFO +25 -5
  10. biointerface-0.2.1/HISTORY.rst +0 -14
  11. biointerface-0.2.1/docs/usage.rst +0 -55
  12. {biointerface-0.2.1 → biointerface-0.2.3}/AUTHORS.rst +0 -0
  13. {biointerface-0.2.1 → biointerface-0.2.3}/LICENSE +0 -0
  14. {biointerface-0.2.1 → biointerface-0.2.3}/MANIFEST.in +0 -0
  15. {biointerface-0.2.1 → biointerface-0.2.3}/docs/Makefile +0 -0
  16. {biointerface-0.2.1 → biointerface-0.2.3}/docs/_build/html/_static/file.png +0 -0
  17. {biointerface-0.2.1 → biointerface-0.2.3}/docs/_build/html/_static/minus.png +0 -0
  18. {biointerface-0.2.1 → biointerface-0.2.3}/docs/_build/html/_static/plus.png +0 -0
  19. {biointerface-0.2.1 → biointerface-0.2.3}/docs/authors.rst +0 -0
  20. {biointerface-0.2.1 → biointerface-0.2.3}/docs/biointerface.rst +0 -0
  21. {biointerface-0.2.1 → biointerface-0.2.3}/docs/conf.py +0 -0
  22. {biointerface-0.2.1 → biointerface-0.2.3}/docs/contributing.rst +0 -0
  23. {biointerface-0.2.1 → biointerface-0.2.3}/docs/history.rst +0 -0
  24. {biointerface-0.2.1 → biointerface-0.2.3}/docs/index.rst +0 -0
  25. {biointerface-0.2.1 → biointerface-0.2.3}/docs/installation.rst +0 -0
  26. {biointerface-0.2.1 → biointerface-0.2.3}/docs/make.bat +0 -0
  27. {biointerface-0.2.1 → biointerface-0.2.3}/docs/modules.rst +0 -0
  28. {biointerface-0.2.1 → biointerface-0.2.3}/docs/readme.rst +0 -0
  29. {biointerface-0.2.1 → biointerface-0.2.3}/setup.cfg +0 -0
  30. {biointerface-0.2.1 → biointerface-0.2.3}/src/biointerface.egg-info/SOURCES.txt +0 -0
  31. {biointerface-0.2.1 → biointerface-0.2.3}/src/biointerface.egg-info/dependency_links.txt +0 -0
  32. {biointerface-0.2.1 → biointerface-0.2.3}/src/biointerface.egg-info/requires.txt +0 -0
  33. {biointerface-0.2.1 → biointerface-0.2.3}/src/biointerface.egg-info/top_level.txt +0 -0
  34. {biointerface-0.2.1 → biointerface-0.2.3}/tests/__init__.py +0 -0
  35. {biointerface-0.2.1 → biointerface-0.2.3}/tests/test_biointerface.py +0 -0
@@ -110,7 +110,7 @@ Before you submit a pull request, check that it meets these guidelines:
110
110
  2. If the pull request adds functionality, the docs should be updated. Put
111
111
  your new functionality into a function with a docstring, and add the
112
112
  feature to the list in README.rst.
113
- 3. The pull request should work for Python 3.8, 3.9, 3.10, 3.11, 3.12 and 3.13,
113
+ 3. The pull request should work for Python 3.10, 3.11, 3.12 and 3.13,
114
114
  and for PyPy. Make sure that the tests pass for all supported Python versions.
115
115
 
116
116
  Tips
@@ -0,0 +1,42 @@
1
+ =======
2
+ History
3
+ =======
4
+
5
+ 0.1.0 (2025-02-08)
6
+ ------------------
7
+
8
+ * First release on PyPI.
9
+
10
+
11
+ 0.2.0 (2025-02-28)
12
+ ------------------
13
+
14
+ * Features: Interface class, with getter methods for atoms, dataframes etc
15
+
16
+
17
+ 0.2.1 (2025-03-1)
18
+ ------------------
19
+
20
+ * Gitlab CI
21
+
22
+
23
+ 0.2.2 (2025-03-04)
24
+ ------------------
25
+
26
+ * Interface methods to get residues
27
+
28
+ * Interface raise error condition in case of no protein in the structure
29
+
30
+ * Coverage badge on README
31
+
32
+ * Full documentation
33
+
34
+
35
+ 0.2.3 (2025-03-05)
36
+ ------------------
37
+
38
+ * fix: bump-my-version was updating pdbnucleicacids version too
39
+
40
+ * fix: import classes instead of modules
41
+
42
+ * chore: remove old tox environments
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: biointerface
3
- Version: 0.2.1
4
- Summary: BioInterface is a python package capable of extracting Protein-DNA interfaces from PDB/mmCif structures.
3
+ Version: 0.2.3
4
+ Summary: BioInterface is a Biopython based package that extracts Protein-DNA interfaces in a PDB structures.
5
5
  Author-email: Alessandro Pandolfi <alessandro.pandolfi@protonmail.com>
6
6
  Maintainer-email: Alessandro Pandolfi <alessandro.pandolfi@protonmail.com>
7
7
  License: MIT license
@@ -33,6 +33,10 @@ BioInterface
33
33
  :target: https://biointerface.readthedocs.io/en/latest/?version=latest
34
34
  :alt: Documentation Status
35
35
 
36
+ .. image:: https://gitlab.com/MorfeoRenai/biointerface/badges/main/coverage.svg
37
+ :target: https://gitlab.com/MorfeoRenai/biointerface/-/commits/main
38
+ :alt: Coverage Status
39
+
36
40
  .. image:: https://pyup.io/repos/github/MorfeoRenai/biointerface/shield.svg
37
41
  :target: https://pyup.io/repos/github/MorfeoRenai/biointerface/
38
42
  :alt: Updates
@@ -62,17 +66,17 @@ You can extract a single Protein-DNA interface from a single protein chain.
62
66
 
63
67
  from Bio.PDB.MMCIFParser import MMCIFParser
64
68
  from biointerface import Interface, build_interfaces
65
-
69
+
66
70
  # parse and build structure with Biopython
67
71
  parser = MMCIFParser()
68
72
  structure = parser.get_structure(
69
73
  structure_id="1A02", filename="1a02-assembly1.cif"
70
74
  )
71
-
75
+
72
76
  # extract interface from a specific protein chain
73
77
  face = Interface(
74
78
  structure=structure,
75
- protein_chain_id="A",
79
+ protein_chain_id="F",
76
80
  search_radius=5.0
77
81
  )
78
82
  face
@@ -84,9 +88,25 @@ You can extract a single Protein-DNA interface from a single protein chain.
84
88
  Check the official documentation for more information.
85
89
 
86
90
 
91
+ Feaures
92
+ -------
93
+
94
+ * Extract one specific Protein-DNA interface in a PDB structure, given a protein chain id;
95
+
96
+ * Extract all Protein-DNA interfaces in a PDB structure;
97
+
98
+ * Get all interacting residues in a interface;
99
+
100
+ * Get all interacting atoms in a interface;
101
+
102
+ * Interface data as ``pandas`` DataFrame;
103
+
104
+
87
105
  TODO
88
106
  --------
89
107
 
108
+ * Extract continous bound DNA sequence
109
+
90
110
  * Proper tests (WIP)
91
111
 
92
112
 
@@ -10,6 +10,10 @@ BioInterface
10
10
  :target: https://biointerface.readthedocs.io/en/latest/?version=latest
11
11
  :alt: Documentation Status
12
12
 
13
+ .. image:: https://gitlab.com/MorfeoRenai/biointerface/badges/main/coverage.svg
14
+ :target: https://gitlab.com/MorfeoRenai/biointerface/-/commits/main
15
+ :alt: Coverage Status
16
+
13
17
  .. image:: https://pyup.io/repos/github/MorfeoRenai/biointerface/shield.svg
14
18
  :target: https://pyup.io/repos/github/MorfeoRenai/biointerface/
15
19
  :alt: Updates
@@ -39,17 +43,17 @@ You can extract a single Protein-DNA interface from a single protein chain.
39
43
 
40
44
  from Bio.PDB.MMCIFParser import MMCIFParser
41
45
  from biointerface import Interface, build_interfaces
42
-
46
+
43
47
  # parse and build structure with Biopython
44
48
  parser = MMCIFParser()
45
49
  structure = parser.get_structure(
46
50
  structure_id="1A02", filename="1a02-assembly1.cif"
47
51
  )
48
-
52
+
49
53
  # extract interface from a specific protein chain
50
54
  face = Interface(
51
55
  structure=structure,
52
- protein_chain_id="A",
56
+ protein_chain_id="F",
53
57
  search_radius=5.0
54
58
  )
55
59
  face
@@ -61,9 +65,25 @@ You can extract a single Protein-DNA interface from a single protein chain.
61
65
  Check the official documentation for more information.
62
66
 
63
67
 
68
+ Feaures
69
+ -------
70
+
71
+ * Extract one specific Protein-DNA interface in a PDB structure, given a protein chain id;
72
+
73
+ * Extract all Protein-DNA interfaces in a PDB structure;
74
+
75
+ * Get all interacting residues in a interface;
76
+
77
+ * Get all interacting atoms in a interface;
78
+
79
+ * Interface data as ``pandas`` DataFrame;
80
+
81
+
64
82
  TODO
65
83
  --------
66
84
 
85
+ * Extract continous bound DNA sequence
86
+
67
87
  * Proper tests (WIP)
68
88
 
69
89
 
@@ -0,0 +1,194 @@
1
+ =====
2
+ Usage
3
+ =====
4
+
5
+ To use BioInterface in a Python project:
6
+
7
+ .. code-block:: python
8
+
9
+ import biointerface
10
+
11
+
12
+ Extract One Protein-DNA Interface
13
+ ---------------------------------
14
+
15
+ You can extract a single Protein-DNA interface from a single protein chain.
16
+
17
+ .. code-block:: python
18
+
19
+ from Bio.PDB.PDBList import PDBList
20
+ from Bio.PDB.MMCIFParser import MMCIFParser
21
+ from biointerface import Interface
22
+
23
+ # retrive file from PDB using Biopython
24
+ pdbl = PDBList()
25
+ pdbl.retrieve_pdb_file(pdb_code="1A02", pdir=".")
26
+ pdbl.retrieve_assembly_file(pdb_code="1A02", assembly_num=1, pdir=".")
27
+ # ... or else use your own
28
+
29
+ # parse and build structure with Biopython
30
+ parser = MMCIFParser()
31
+ structure = parser.get_structure(
32
+ structure_id="1A02", filename="1a02-assembly1.cif"
33
+ )
34
+
35
+ # extract interface from a specific protein chain
36
+ face = Interface(
37
+ structure=structure,
38
+ protein_chain_id="A",
39
+ search_radius=5.0
40
+ )
41
+ face
42
+
43
+
44
+ .. code-block:: console
45
+
46
+ <Interface chains=F:BA contacts=258 search_radius=5.0>
47
+
48
+
49
+ Extract All Protein-DNA Interfaces
50
+ ----------------------------------
51
+
52
+ You can also extract all Protein-DNA interface from an entire structure.
53
+
54
+ .. code-block:: python
55
+
56
+ from biointerface import build_interfaces
57
+
58
+ face_list = build_interfaces(structure=structure, search_radius=5.0)
59
+ face_list
60
+
61
+ .. code-block:: console
62
+
63
+ [<Interface chains=J:BA contacts=189 search_radius=5.0>,
64
+ <Interface chains=F:BA contacts=258 search_radius=5.0>,
65
+ <Interface chains=N:BA contacts=529 search_radius=5.0>]
66
+
67
+
68
+ Get All Interacting Residues
69
+ ----------------------------
70
+
71
+ You can access all interacting residues in a Protein-DNA interface, both
72
+ aminoacids and nucleotides.
73
+
74
+ .. code-block:: python
75
+
76
+ face.get_aminoacids()
77
+
78
+ .. code-block:: console
79
+
80
+ [<Residue ARG het= resseq=144 icode= >,
81
+ <Residue ALA het= resseq=151 icode= >,
82
+ <Residue ARG het= resseq=158 icode= >,
83
+ <Residue ASN het= resseq=147 icode= >,
84
+ <Residue LYS het= resseq=148 icode= >,
85
+ <Residue LYS het= resseq=153 icode= >,
86
+ <Residue SER het= resseq=154 icode= >,
87
+ <Residue ARG het= resseq=155 icode= >,
88
+ <Residue ALA het= resseq=150 icode= >,
89
+ <Residue ARG het= resseq=143 icode= >,
90
+ <Residue ARG het= resseq=146 icode= >,
91
+ <Residue ARG het= resseq=157 icode= >]
92
+
93
+ .. code-block:: python
94
+
95
+ face.get_nucleotides()
96
+
97
+ .. code-block:: console
98
+
99
+ [<Residue DT het= resseq=4015 icode= >,
100
+ <Residue DC het= resseq=4016 icode= >,
101
+ <Residue DT het= resseq=4014 icode= >,
102
+ <Residue DG het= resseq=5007 icode= >,
103
+ <Residue DA het= resseq=4017 icode= >,
104
+ <Residue DT het= resseq=4018 icode= >,
105
+ <Residue DT het= resseq=5006 icode= >,
106
+ <Residue DC het= resseq=5003 icode= >,
107
+ <Residue DA het= resseq=5005 icode= >,
108
+ <Residue DG het= resseq=4012 icode= >,
109
+ <Residue DT het= resseq=4013 icode= >,
110
+ <Residue DT het= resseq=5004 icode= >]
111
+
112
+
113
+ Get All Interacting Atoms
114
+ -------------------------
115
+
116
+ You can access all interacting atoms in a Protein-DNA interface.
117
+
118
+ First of all you can get all interacting atoms as atom pairs.
119
+
120
+ .. code-block:: python
121
+
122
+ contacts = face.get_atomic_contacts()
123
+ contacts[:5]
124
+
125
+ .. code-block:: console
126
+
127
+ [(<Atom C5'>, <Atom NZ>),
128
+ (<Atom C5'>, <Atom CE>),
129
+ (<Atom O5'>, <Atom NZ>),
130
+ (<Atom O5'>, <Atom CE>),
131
+ (<Atom O5'>, <Atom CD>)]
132
+
133
+ You can also get all Protein or DNA interacting atoms, independently.
134
+
135
+ .. code-block:: python
136
+
137
+ atoms = face.get_protein_atoms()
138
+ atoms[:5]
139
+
140
+ .. code-block:: console
141
+
142
+ [<Atom CZ>, <Atom N>, <Atom NE>, <Atom CD>, <Atom CG>]
143
+
144
+ .. code-block:: python
145
+
146
+ atoms = face.get_dna_atoms()
147
+ atoms[:5]
148
+
149
+ .. code-block:: console
150
+
151
+ [<Atom P>, <Atom C5'>, <Atom C6>, <Atom C5>, <Atom C4'>]
152
+
153
+
154
+ Interface Data as DataFrame
155
+ ---------------------------
156
+
157
+ You can get all Protein-DNA interface features as a ``pandas`` DataFrame.
158
+
159
+ .. code-block:: python
160
+
161
+ df = face.get_interface_data()
162
+ df.columns
163
+
164
+ .. code-block:: console
165
+
166
+ Index(['protein_chain_id', 'prot_res_hetfield', 'prot_res_number',
167
+ 'prot_res_icode', 'prot_res_name', 'prot_atom_name', 'prot_atom_altloc',
168
+ 'prot_atom_element', 'prot_atom_coord_x', 'prot_atom_coord_y',
169
+ 'prot_atom_coord_z', 'dna_chain_id', 'dna_res_hetfield',
170
+ 'dna_res_number', 'dna_res_icode', 'dna_res_name', 'dna_atom_name',
171
+ 'dna_atom_altloc', 'dna_atom_element', 'dna_atom_coord_x',
172
+ 'dna_atom_coord_y', 'dna_atom_coord_z', 'euclidian_distance'],
173
+ dtype='object')
174
+
175
+ .. code-block:: python
176
+
177
+ df
178
+
179
+ .. code-block:: console
180
+
181
+ protein_chain_id prot_res_hetfield prot_res_number ... euclidian_distance
182
+ 0 F 148 ... 4.458498
183
+ 1 F 148 ... 3.964944
184
+ 2 F 148 ... 4.066739
185
+ 3 F 148 ... 3.271817
186
+ 4 F 148 ... 4.217340
187
+ ... ... ... ... ... ...
188
+ 253 F 154 ... 4.644194
189
+ 254 F 150 ... 4.594888
190
+ 255 F 150 ... 4.784895
191
+ 256 F 157 ... 4.904832
192
+ 257 F 157 ... 4.299844
193
+
194
+ [258 rows x 23 columns]
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "biointerface"
7
- version = "0.2.1"
8
- description = "BioInterface is a python package capable of extracting Protein-DNA interfaces from PDB/mmCif structures."
7
+ version = "0.2.3"
8
+ description = "BioInterface is a Biopython based package that extracts Protein-DNA interfaces in a PDB structures."
9
9
  readme = "README.rst"
10
10
  authors = [
11
11
  {name = "Alessandro Pandolfi", email = "alessandro.pandolfi@protonmail.com"}
@@ -32,7 +32,6 @@ dev = [
32
32
  ]
33
33
 
34
34
  [project.urls]
35
-
36
35
  bugs = "https://gitlab.com/MorfeoRenai/biointerface/-/issues"
37
36
  changelog = "https://gitlab.com/MorfeoRenai/biointerface/-/blob/main/HISTORY.rst"
38
37
  homepage = "https://gitlab.com/MorfeoRenai/biointerface"
@@ -44,8 +43,6 @@ package-dir = {"" = "src"}
44
43
  "*" = ["*.*"]
45
44
 
46
45
 
47
-
48
-
49
46
  # Mypy
50
47
  # ----
51
48
 
@@ -64,8 +61,6 @@ allow_untyped_defs = true
64
61
  disable_error_code = "attr-defined"
65
62
 
66
63
 
67
-
68
-
69
64
  # pytest
70
65
  # ----
71
66
 
@@ -77,13 +72,11 @@ testpaths = [
77
72
  ]
78
73
 
79
74
 
80
-
81
-
82
75
  # bump-my-version
83
76
  # ----
84
77
 
85
78
  [tool.bumpversion]
86
- current_version = "0.2.1"
79
+ current_version = "0.2.3"
87
80
  parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
88
81
  serialize = ["{major}.{minor}.{patch}"]
89
82
  search = "{current_version}"
@@ -91,7 +84,7 @@ replace = "{new_version}"
91
84
  regex = false
92
85
  ignore_missing_version = false
93
86
  ignore_missing_files = false
94
- tag = false
87
+ tag = true
95
88
  sign_tags = false
96
89
  tag_name = "v{new_version}"
97
90
  tag_message = "Bump version: {current_version} → {new_version}"
@@ -110,10 +103,8 @@ replace = "{new_version}"
110
103
 
111
104
  [[tool.bumpversion.files]]
112
105
  filename = "pyproject.toml"
113
- search = "{current_version}"
114
- replace = "{new_version}"
115
-
116
-
106
+ search = 'version = "{current_version}"'
107
+ replace = 'version = "{new_version}"'
117
108
 
118
109
 
119
110
  # ruff
@@ -131,8 +122,6 @@ show-fixes = true
131
122
  extend-select = ["E501"]
132
123
 
133
124
 
134
-
135
-
136
125
  # tox
137
126
  # ----
138
127
 
@@ -140,7 +129,7 @@ extend-select = ["E501"]
140
129
  #requires = ["tox>=4.19"]
141
130
  requires = ["tox"]
142
131
  # Elenco delle versioni di Python con cui testare
143
- envlist = ["py38", "py39", "py310", "py311", "py312", "py313"]
132
+ envlist = ["py310", "py311", "py312", "py313"]
144
133
 
145
134
  [tool.tox.env_run_base] # Configurazione generale per tutti gli ambienti di test
146
135
  description = "Run the tests with pytest"
@@ -155,12 +144,6 @@ commands = [["pytest"]]
155
144
  #deps = ["mypy==1.11.2", "types-cachetools>=5.5.0.20240820", "types-chardet>=5.0.4.6"]
156
145
  #commands = [["mypy", "src{/}tox"], ["mypy", "tests"]]
157
146
 
158
- [tool.tox.env.py38]
159
- description = "Run the tests on Python 3.8"
160
-
161
- [tool.tox.env.py39]
162
- description = "Run the tests on Python 3.9"
163
-
164
147
  [tool.tox.env.py310]
165
148
  description = "Run the tests on Python 3.10"
166
149
 
@@ -178,3 +161,4 @@ description = "Run the tests on Python 3.13"
178
161
  #description = "Run linting"
179
162
  #deps = ["flake8"]
180
163
  #commands = ["flake8 src tests"]
164
+
@@ -4,6 +4,6 @@ from biointerface.core import Interface, build_interfaces
4
4
 
5
5
  __author__ = """Alessandro Pandolfi"""
6
6
  __email__ = "alessandro.pandolfi@protonmail.com"
7
- __version__ = "0.2.1"
7
+ __version__ = "0.2.3"
8
8
 
9
9
  __all__ = ["Interface", "build_interfaces"]
@@ -2,9 +2,13 @@
2
2
 
3
3
  from Bio.PDB.Polypeptide import PPBuilder
4
4
  from Bio.PDB.NeighborSearch import NeighborSearch
5
- from Bio.PDB import Atom
5
+ from Bio.PDB.Residue import Residue
6
+ from Bio.PDB.Atom import Atom
7
+ from Bio.PDB.PDBExceptions import PDBConstructionException
6
8
 
7
- # from Bio.PDB import Structure, Model, Chain, Residue
9
+ # from Bio.PDB.Structure import Structure
10
+ # from Bio.PDB.Model import Model
11
+ # from Bio.PDB.Chain import Chain
8
12
  # from Bio.PDB import MMCIFIO
9
13
 
10
14
  import pandas as pd
@@ -82,18 +86,31 @@ class Interface:
82
86
  self.contacts = self._extract_contacts()
83
87
 
84
88
  dna_atoms = self.get_dna_atoms()
85
- self.dna_chain_ids = list(
89
+ self._dna_chain_ids = list(
86
90
  {atom.parent.parent.id for atom in dna_atoms}
87
91
  )
88
92
 
89
93
  def __repr__(self):
90
94
  """Return string representation of the nucleic acid."""
91
95
  return f"<Interface chains={self.protein_chain_id}:\
92
- {''.join(self.dna_chain_ids)} contacts={len(self.contacts)} search_radius=\
96
+ {''.join(self._dna_chain_ids)} contacts={len(self.contacts)} search_radius=\
93
97
  {self.search_radius}>"
94
98
 
95
99
  def _extract_contacts(self) -> list[tuple[Atom]]:
96
- """Extract interface contacts."""
100
+ """
101
+ Extract interface contacts.
102
+
103
+ Raises
104
+ ------
105
+ PDBConstructionException
106
+ In case of `protein_chain_id` not being a protein chain.
107
+
108
+ Returns
109
+ -------
110
+ list[tuple[Atom]]
111
+ List of pairs of atoms, first one is DNA, second is proteic.
112
+
113
+ """
97
114
  # get all the atoms from the nucleic acids, in most cases DNA
98
115
  na_builder = NABuilder()
99
116
  na_list = na_builder.build_nucleic_acids(self.structure)
@@ -108,6 +125,14 @@ class Interface:
108
125
  protein_chain = self.structure[0][self.protein_chain_id]
109
126
  pp_builder = PPBuilder()
110
127
  pp_list = pp_builder.build_peptides(protein_chain)
128
+
129
+ # check if given chain id is actually a protein
130
+ if not pp_list:
131
+ raise PDBConstructionException(
132
+ f"No polypeptides found in the input protein \
133
+ chain id: {self.protein_chain_id}"
134
+ )
135
+
111
136
  pp_atoms = []
112
137
  for pp in pp_list:
113
138
  for res in pp:
@@ -163,6 +188,18 @@ class Interface:
163
188
 
164
189
  return contacts
165
190
 
191
+ def get_atomic_contacts(self) -> list[tuple[Atom]]:
192
+ """
193
+ Get interface contacts as pairs of atoms.
194
+
195
+ Returns
196
+ -------
197
+ list[tuple[Atom]]
198
+ List of pairs of atoms, first one is DNA, second is proteic.
199
+
200
+ """
201
+ return self.contacts
202
+
166
203
  def get_protein_atoms(self) -> list[Atom]:
167
204
  """
168
205
  Get only protein atoms in the protein-DNA interface.
@@ -187,6 +224,30 @@ class Interface:
187
224
  """
188
225
  return list({atom_pair[0] for atom_pair in self.contacts})
189
226
 
227
+ def get_aminoacids(self) -> list[Residue]:
228
+ """
229
+ Get only protein residues in the protein-DNA interface.
230
+
231
+ Returns
232
+ -------
233
+ list[Residue]
234
+ List of protein reisudes in the interface.
235
+
236
+ """
237
+ return list({atom_pair[1].parent for atom_pair in self.contacts})
238
+
239
+ def get_nucleotides(self) -> list[Residue]:
240
+ """
241
+ Get only DNA residues in the protein-DNA interface.
242
+
243
+ Returns
244
+ -------
245
+ list[Residue]
246
+ List of DNA residues in the interface.
247
+
248
+ """
249
+ return list({atom_pair[0].parent for atom_pair in self.contacts})
250
+
190
251
  def get_interface_data(self) -> pd.DataFrame:
191
252
  """
192
253
  Get all data from the interface, as a dataframe.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: biointerface
3
- Version: 0.2.1
4
- Summary: BioInterface is a python package capable of extracting Protein-DNA interfaces from PDB/mmCif structures.
3
+ Version: 0.2.3
4
+ Summary: BioInterface is a Biopython based package that extracts Protein-DNA interfaces in a PDB structures.
5
5
  Author-email: Alessandro Pandolfi <alessandro.pandolfi@protonmail.com>
6
6
  Maintainer-email: Alessandro Pandolfi <alessandro.pandolfi@protonmail.com>
7
7
  License: MIT license
@@ -33,6 +33,10 @@ BioInterface
33
33
  :target: https://biointerface.readthedocs.io/en/latest/?version=latest
34
34
  :alt: Documentation Status
35
35
 
36
+ .. image:: https://gitlab.com/MorfeoRenai/biointerface/badges/main/coverage.svg
37
+ :target: https://gitlab.com/MorfeoRenai/biointerface/-/commits/main
38
+ :alt: Coverage Status
39
+
36
40
  .. image:: https://pyup.io/repos/github/MorfeoRenai/biointerface/shield.svg
37
41
  :target: https://pyup.io/repos/github/MorfeoRenai/biointerface/
38
42
  :alt: Updates
@@ -62,17 +66,17 @@ You can extract a single Protein-DNA interface from a single protein chain.
62
66
 
63
67
  from Bio.PDB.MMCIFParser import MMCIFParser
64
68
  from biointerface import Interface, build_interfaces
65
-
69
+
66
70
  # parse and build structure with Biopython
67
71
  parser = MMCIFParser()
68
72
  structure = parser.get_structure(
69
73
  structure_id="1A02", filename="1a02-assembly1.cif"
70
74
  )
71
-
75
+
72
76
  # extract interface from a specific protein chain
73
77
  face = Interface(
74
78
  structure=structure,
75
- protein_chain_id="A",
79
+ protein_chain_id="F",
76
80
  search_radius=5.0
77
81
  )
78
82
  face
@@ -84,9 +88,25 @@ You can extract a single Protein-DNA interface from a single protein chain.
84
88
  Check the official documentation for more information.
85
89
 
86
90
 
91
+ Feaures
92
+ -------
93
+
94
+ * Extract one specific Protein-DNA interface in a PDB structure, given a protein chain id;
95
+
96
+ * Extract all Protein-DNA interfaces in a PDB structure;
97
+
98
+ * Get all interacting residues in a interface;
99
+
100
+ * Get all interacting atoms in a interface;
101
+
102
+ * Interface data as ``pandas`` DataFrame;
103
+
104
+
87
105
  TODO
88
106
  --------
89
107
 
108
+ * Extract continous bound DNA sequence
109
+
90
110
  * Proper tests (WIP)
91
111
 
92
112
 
@@ -1,14 +0,0 @@
1
- =======
2
- History
3
- =======
4
-
5
- 0.1.0 (2025-02-08)
6
- ------------------
7
-
8
- * First release on PyPI.
9
-
10
-
11
- 0.2.0 (2025-02-28)
12
- ------------------
13
-
14
- * Feature: Interface class, with getter methods for atoms, dataframes etc
@@ -1,55 +0,0 @@
1
- =====
2
- Usage
3
- =====
4
-
5
- To use BioInterface in a Python project:
6
-
7
- .. code-block:: python
8
-
9
- import biointerface
10
-
11
- You can extract a single Protein-DNA interface from a single protein chain.
12
-
13
- .. code-block:: python
14
-
15
- from Bio.PDB.PDBList import PDBList
16
- from Bio.PDB.MMCIFParser import MMCIFParser
17
- from biointerface import Interface, build_interfaces
18
-
19
- # retrive file from PDB using Biopython
20
- pdbl = PDBList()
21
- pdbl.retrieve_pdb_file(pdb_code="1A02", pdir=".")
22
- pdbl.retrieve_assembly_file(pdb_code="1A02", assembly_num=1, pdir=".")
23
- # ... or else use your own
24
-
25
- # parse and build structure with Biopython
26
- parser = MMCIFParser()
27
- structure = parser.get_structure(
28
- structure_id="1A02", filename="1a02-assembly1.cif"
29
- )
30
-
31
- # extract interface from a specific protein chain
32
- face = Interface(
33
- structure=structure,
34
- protein_chain_id="A",
35
- search_radius=5.0
36
- )
37
- face
38
-
39
-
40
- .. code-block:: console
41
-
42
- <Interface chains=F:BA contacts=258 search_radius=5.0>
43
-
44
- You can also extract all Protein-DNA interface from an entire structure.
45
-
46
- .. code-block:: python
47
-
48
- face_list = build_interfaces(structure=structure, search_radius=5.0)
49
- face_list
50
-
51
- .. code-block:: console
52
-
53
- [<Interface chains=J:BA contacts=189 search_radius=5.0>,
54
- <Interface chains=F:BA contacts=258 search_radius=5.0>,
55
- <Interface chains=N:BA contacts=529 search_radius=5.0>]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes