biointerface 0.2.1__tar.gz → 0.2.2__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.
- {biointerface-0.2.1 → biointerface-0.2.2}/CONTRIBUTING.rst +1 -1
- {biointerface-0.2.1 → biointerface-0.2.2}/PKG-INFO +25 -5
- {biointerface-0.2.1 → biointerface-0.2.2}/README.rst +23 -3
- biointerface-0.2.2/docs/usage.rst +194 -0
- {biointerface-0.2.1 → biointerface-0.2.2}/pyproject.toml +3 -9
- {biointerface-0.2.1 → biointerface-0.2.2}/src/biointerface/__init__.py +1 -1
- {biointerface-0.2.1 → biointerface-0.2.2}/src/biointerface/core.py +63 -5
- {biointerface-0.2.1 → biointerface-0.2.2}/src/biointerface.egg-info/PKG-INFO +25 -5
- {biointerface-0.2.1 → biointerface-0.2.2}/src/biointerface.egg-info/requires.txt +1 -1
- biointerface-0.2.1/docs/usage.rst +0 -55
- {biointerface-0.2.1 → biointerface-0.2.2}/AUTHORS.rst +0 -0
- {biointerface-0.2.1 → biointerface-0.2.2}/HISTORY.rst +0 -0
- {biointerface-0.2.1 → biointerface-0.2.2}/LICENSE +0 -0
- {biointerface-0.2.1 → biointerface-0.2.2}/MANIFEST.in +0 -0
- {biointerface-0.2.1 → biointerface-0.2.2}/docs/Makefile +0 -0
- {biointerface-0.2.1 → biointerface-0.2.2}/docs/_build/html/_static/file.png +0 -0
- {biointerface-0.2.1 → biointerface-0.2.2}/docs/_build/html/_static/minus.png +0 -0
- {biointerface-0.2.1 → biointerface-0.2.2}/docs/_build/html/_static/plus.png +0 -0
- {biointerface-0.2.1 → biointerface-0.2.2}/docs/authors.rst +0 -0
- {biointerface-0.2.1 → biointerface-0.2.2}/docs/biointerface.rst +0 -0
- {biointerface-0.2.1 → biointerface-0.2.2}/docs/conf.py +0 -0
- {biointerface-0.2.1 → biointerface-0.2.2}/docs/contributing.rst +0 -0
- {biointerface-0.2.1 → biointerface-0.2.2}/docs/history.rst +0 -0
- {biointerface-0.2.1 → biointerface-0.2.2}/docs/index.rst +0 -0
- {biointerface-0.2.1 → biointerface-0.2.2}/docs/installation.rst +0 -0
- {biointerface-0.2.1 → biointerface-0.2.2}/docs/make.bat +0 -0
- {biointerface-0.2.1 → biointerface-0.2.2}/docs/modules.rst +0 -0
- {biointerface-0.2.1 → biointerface-0.2.2}/docs/readme.rst +0 -0
- {biointerface-0.2.1 → biointerface-0.2.2}/setup.cfg +0 -0
- {biointerface-0.2.1 → biointerface-0.2.2}/src/biointerface.egg-info/SOURCES.txt +0 -0
- {biointerface-0.2.1 → biointerface-0.2.2}/src/biointerface.egg-info/dependency_links.txt +0 -0
- {biointerface-0.2.1 → biointerface-0.2.2}/src/biointerface.egg-info/top_level.txt +0 -0
- {biointerface-0.2.1 → biointerface-0.2.2}/tests/__init__.py +0 -0
- {biointerface-0.2.1 → biointerface-0.2.2}/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.
|
|
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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: biointerface
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: BioInterface is a python package capable of extracting Protein-DNA interfaces from PDB/mmCif structures.
|
|
5
5
|
Author-email: Alessandro Pandolfi <alessandro.pandolfi@protonmail.com>
|
|
6
6
|
Maintainer-email: Alessandro Pandolfi <alessandro.pandolfi@protonmail.com>
|
|
@@ -14,7 +14,7 @@ License-File: LICENSE
|
|
|
14
14
|
License-File: AUTHORS.rst
|
|
15
15
|
Requires-Dist: pandas
|
|
16
16
|
Requires-Dist: biopython
|
|
17
|
-
Requires-Dist: pdbnucleicacids>=0.2
|
|
17
|
+
Requires-Dist: pdbnucleicacids>=0.2
|
|
18
18
|
Provides-Extra: dev
|
|
19
19
|
Requires-Dist: coverage; extra == "dev"
|
|
20
20
|
Requires-Dist: mypy; extra == "dev"
|
|
@@ -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="
|
|
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="
|
|
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_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,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "biointerface"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.2"
|
|
8
8
|
description = "BioInterface is a python package capable of extracting Protein-DNA interfaces from PDB/mmCif structures."
|
|
9
9
|
readme = "README.rst"
|
|
10
10
|
authors = [
|
|
@@ -20,7 +20,7 @@ license = {text = "MIT license"}
|
|
|
20
20
|
dependencies = [
|
|
21
21
|
"pandas",
|
|
22
22
|
"biopython",
|
|
23
|
-
"pdbnucleicacids >= 0.2
|
|
23
|
+
"pdbnucleicacids >= 0.2",
|
|
24
24
|
]
|
|
25
25
|
|
|
26
26
|
[project.optional-dependencies]
|
|
@@ -83,7 +83,7 @@ testpaths = [
|
|
|
83
83
|
# ----
|
|
84
84
|
|
|
85
85
|
[tool.bumpversion]
|
|
86
|
-
current_version = "0.2.
|
|
86
|
+
current_version = "0.2.2"
|
|
87
87
|
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
|
88
88
|
serialize = ["{major}.{minor}.{patch}"]
|
|
89
89
|
search = "{current_version}"
|
|
@@ -155,12 +155,6 @@ commands = [["pytest"]]
|
|
|
155
155
|
#deps = ["mypy==1.11.2", "types-cachetools>=5.5.0.20240820", "types-chardet>=5.0.4.6"]
|
|
156
156
|
#commands = [["mypy", "src{/}tox"], ["mypy", "tests"]]
|
|
157
157
|
|
|
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
158
|
[tool.tox.env.py310]
|
|
165
159
|
description = "Run the tests on Python 3.10"
|
|
166
160
|
|
|
@@ -2,9 +2,10 @@
|
|
|
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 import Atom, Residue
|
|
6
|
+
from Bio.PDB.PDBExceptions import PDBConstructionException
|
|
6
7
|
|
|
7
|
-
# from Bio.PDB import Structure, Model, Chain
|
|
8
|
+
# from Bio.PDB import Structure, Model, Chain
|
|
8
9
|
# from Bio.PDB import MMCIFIO
|
|
9
10
|
|
|
10
11
|
import pandas as pd
|
|
@@ -82,18 +83,31 @@ class Interface:
|
|
|
82
83
|
self.contacts = self._extract_contacts()
|
|
83
84
|
|
|
84
85
|
dna_atoms = self.get_dna_atoms()
|
|
85
|
-
self.
|
|
86
|
+
self._dna_chain_ids = list(
|
|
86
87
|
{atom.parent.parent.id for atom in dna_atoms}
|
|
87
88
|
)
|
|
88
89
|
|
|
89
90
|
def __repr__(self):
|
|
90
91
|
"""Return string representation of the nucleic acid."""
|
|
91
92
|
return f"<Interface chains={self.protein_chain_id}:\
|
|
92
|
-
{''.join(self.
|
|
93
|
+
{''.join(self._dna_chain_ids)} contacts={len(self.contacts)} search_radius=\
|
|
93
94
|
{self.search_radius}>"
|
|
94
95
|
|
|
95
96
|
def _extract_contacts(self) -> list[tuple[Atom]]:
|
|
96
|
-
"""
|
|
97
|
+
"""
|
|
98
|
+
Extract interface contacts.
|
|
99
|
+
|
|
100
|
+
Raises
|
|
101
|
+
------
|
|
102
|
+
PDBConstructionException
|
|
103
|
+
In case of `protein_chain_id` not being a protein chain.
|
|
104
|
+
|
|
105
|
+
Returns
|
|
106
|
+
-------
|
|
107
|
+
list[tuple[Atom]]
|
|
108
|
+
List of pairs of atoms, first one is DNA, second is proteic.
|
|
109
|
+
|
|
110
|
+
"""
|
|
97
111
|
# get all the atoms from the nucleic acids, in most cases DNA
|
|
98
112
|
na_builder = NABuilder()
|
|
99
113
|
na_list = na_builder.build_nucleic_acids(self.structure)
|
|
@@ -108,6 +122,14 @@ class Interface:
|
|
|
108
122
|
protein_chain = self.structure[0][self.protein_chain_id]
|
|
109
123
|
pp_builder = PPBuilder()
|
|
110
124
|
pp_list = pp_builder.build_peptides(protein_chain)
|
|
125
|
+
|
|
126
|
+
# check if given chain id is actually a protein
|
|
127
|
+
if not pp_list:
|
|
128
|
+
raise PDBConstructionException(
|
|
129
|
+
f"No polypeptides found in the input protein \
|
|
130
|
+
chain id: {self.protein_chain_id}"
|
|
131
|
+
)
|
|
132
|
+
|
|
111
133
|
pp_atoms = []
|
|
112
134
|
for pp in pp_list:
|
|
113
135
|
for res in pp:
|
|
@@ -163,6 +185,18 @@ class Interface:
|
|
|
163
185
|
|
|
164
186
|
return contacts
|
|
165
187
|
|
|
188
|
+
def get_atomic_contacts(self) -> list[tuple[Atom]]:
|
|
189
|
+
"""
|
|
190
|
+
Get interface contacts as pairs of atoms.
|
|
191
|
+
|
|
192
|
+
Returns
|
|
193
|
+
-------
|
|
194
|
+
list[tuple[Atom]]
|
|
195
|
+
List of pairs of atoms, first one is DNA, second is proteic.
|
|
196
|
+
|
|
197
|
+
"""
|
|
198
|
+
return self.contacts
|
|
199
|
+
|
|
166
200
|
def get_protein_atoms(self) -> list[Atom]:
|
|
167
201
|
"""
|
|
168
202
|
Get only protein atoms in the protein-DNA interface.
|
|
@@ -187,6 +221,30 @@ class Interface:
|
|
|
187
221
|
"""
|
|
188
222
|
return list({atom_pair[0] for atom_pair in self.contacts})
|
|
189
223
|
|
|
224
|
+
def get_aminoacids(self) -> list[Residue]:
|
|
225
|
+
"""
|
|
226
|
+
Get only protein residues in the protein-DNA interface.
|
|
227
|
+
|
|
228
|
+
Returns
|
|
229
|
+
-------
|
|
230
|
+
list[Residue]
|
|
231
|
+
List of protein reisudes in the interface.
|
|
232
|
+
|
|
233
|
+
"""
|
|
234
|
+
return list({atom_pair[1].parent for atom_pair in self.contacts})
|
|
235
|
+
|
|
236
|
+
def get_nucleotides(self) -> list[Residue]:
|
|
237
|
+
"""
|
|
238
|
+
Get only DNA residues in the protein-DNA interface.
|
|
239
|
+
|
|
240
|
+
Returns
|
|
241
|
+
-------
|
|
242
|
+
list[Residue]
|
|
243
|
+
List of DNA residues in the interface.
|
|
244
|
+
|
|
245
|
+
"""
|
|
246
|
+
return list({atom_pair[0].parent for atom_pair in self.contacts})
|
|
247
|
+
|
|
190
248
|
def get_interface_data(self) -> pd.DataFrame:
|
|
191
249
|
"""
|
|
192
250
|
Get all data from the interface, as a dataframe.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: biointerface
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: BioInterface is a python package capable of extracting Protein-DNA interfaces from PDB/mmCif structures.
|
|
5
5
|
Author-email: Alessandro Pandolfi <alessandro.pandolfi@protonmail.com>
|
|
6
6
|
Maintainer-email: Alessandro Pandolfi <alessandro.pandolfi@protonmail.com>
|
|
@@ -14,7 +14,7 @@ License-File: LICENSE
|
|
|
14
14
|
License-File: AUTHORS.rst
|
|
15
15
|
Requires-Dist: pandas
|
|
16
16
|
Requires-Dist: biopython
|
|
17
|
-
Requires-Dist: pdbnucleicacids>=0.2
|
|
17
|
+
Requires-Dist: pdbnucleicacids>=0.2
|
|
18
18
|
Provides-Extra: dev
|
|
19
19
|
Requires-Dist: coverage; extra == "dev"
|
|
20
20
|
Requires-Dist: mypy; extra == "dev"
|
|
@@ -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="
|
|
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,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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|