biointerface 0.1.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.
@@ -0,0 +1,13 @@
1
+ =======
2
+ Credits
3
+ =======
4
+
5
+ Development Lead
6
+ ----------------
7
+
8
+ * Alessandro Pandolfi <alessandro.pandolfi@protonmail.com>
9
+
10
+ Contributors
11
+ ------------
12
+
13
+ None yet. Why not be the first?
@@ -0,0 +1,137 @@
1
+ .. highlight:: shell
2
+
3
+ ============
4
+ Contributing
5
+ ============
6
+
7
+ Contributions are welcome, and they are greatly appreciated! Every little bit
8
+ helps, and credit will always be given.
9
+
10
+ You can contribute in many ways:
11
+
12
+ Types of Contributions
13
+ ----------------------
14
+
15
+ Report Bugs
16
+ ~~~~~~~~~~~
17
+
18
+ Report bugs at https://github.com/MorfeoRenai/biointerface/issues.
19
+
20
+ If you are reporting a bug, please include:
21
+
22
+ * Your operating system name and version.
23
+ * Any details about your local setup that might be helpful in troubleshooting.
24
+ * Detailed steps to reproduce the bug.
25
+
26
+ Fix Bugs
27
+ ~~~~~~~~
28
+
29
+ Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
30
+ wanted" is open to whoever wants to implement it.
31
+
32
+ Implement Features
33
+ ~~~~~~~~~~~~~~~~~~
34
+
35
+ Look through the GitHub issues for features. Anything tagged with "enhancement"
36
+ and "help wanted" is open to whoever wants to implement it.
37
+
38
+ Write Documentation
39
+ ~~~~~~~~~~~~~~~~~~~
40
+
41
+ BioInterface could always use more documentation, whether as part of the
42
+ official BioInterface docs, in docstrings, or even on the web in blog posts,
43
+ articles, and such.
44
+
45
+ Submit Feedback
46
+ ~~~~~~~~~~~~~~~
47
+
48
+ The best way to send feedback is to file an issue at https://github.com/MorfeoRenai/biointerface/issues.
49
+
50
+ If you are proposing a feature:
51
+
52
+ * Explain in detail how it would work.
53
+ * Keep the scope as narrow as possible, to make it easier to implement.
54
+ * Remember that this is a volunteer-driven project, and that contributions
55
+ are welcome :)
56
+
57
+ Get Started!
58
+ ------------
59
+
60
+ Ready to contribute? Here's how to set up `biointerface` for local development.
61
+
62
+ 1. Fork the `biointerface` repo on GitHub.
63
+ 2. Clone your fork locally::
64
+
65
+ $ git clone git@github.com:your_name_here/biointerface.git
66
+
67
+ 3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
68
+
69
+ $ mkvirtualenv biointerface
70
+ $ cd biointerface/
71
+ $ python setup.py develop
72
+
73
+ 4. Create a branch for local development::
74
+
75
+ $ git checkout -b name-of-your-bugfix-or-feature
76
+
77
+ Now you can make your changes locally.
78
+
79
+ 5. When you're done making changes, check that your changes pass flake8 and the
80
+ tests, including testing other Python versions with tox::
81
+
82
+ $ make lint
83
+ $ make test
84
+ Or
85
+ $ make test-all
86
+
87
+ To get flake8 and tox, just pip install them into your virtualenv.
88
+
89
+ 6. Commit your changes and push your branch to GitHub::
90
+
91
+ $ git add .
92
+ $ git commit -m "Your detailed description of your changes."
93
+ $ git push origin name-of-your-bugfix-or-feature
94
+
95
+ 7. Submit a pull request through the GitHub website.
96
+
97
+ Pull Request Guidelines
98
+ -----------------------
99
+
100
+ Before you submit a pull request, check that it meets these guidelines:
101
+
102
+ 1. The pull request should include tests.
103
+ 2. If the pull request adds functionality, the docs should be updated. Put
104
+ your new functionality into a function with a docstring, and add the
105
+ feature to the list in README.rst.
106
+ 3. The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy. Check
107
+ https://travis-ci.com/MorfeoRenai/biointerface/pull_requests
108
+ and make sure that the tests pass for all supported Python versions.
109
+
110
+ Tips
111
+ ----
112
+
113
+ To run a subset of tests::
114
+
115
+ $ pytest tests.test_biointerface
116
+
117
+
118
+ Deploying
119
+ ---------
120
+
121
+ A reminder for the maintainers on how to deploy.
122
+ Make sure all your changes are committed (including an entry in HISTORY.rst).
123
+ Then run::
124
+
125
+ $ bump2version patch # possible: major / minor / patch
126
+ $ git push
127
+ $ git push --tags
128
+
129
+ Travis will then deploy to PyPI if tests pass.
130
+
131
+ Code of Conduct
132
+ ---------------
133
+
134
+ Please note that this project is released with a `Contributor Code of Conduct`_.
135
+ By participating in this project you agree to abide by its terms.
136
+
137
+ .. _`Contributor Code of Conduct`: CODE_OF_CONDUCT.rst
@@ -0,0 +1,8 @@
1
+ =======
2
+ History
3
+ =======
4
+
5
+ 0.1.0 (2025-02-08)
6
+ ------------------
7
+
8
+ * First release on PyPI.
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025, Alessandro Pandolfi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,11 @@
1
+ include AUTHORS.rst
2
+ include CONTRIBUTING.rst
3
+ include HISTORY.rst
4
+ include LICENSE
5
+ include README.rst
6
+
7
+ recursive-include tests *
8
+ recursive-exclude * __pycache__
9
+ recursive-exclude * *.py[co]
10
+
11
+ recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
@@ -0,0 +1,64 @@
1
+ Metadata-Version: 2.2
2
+ Name: biointerface
3
+ Version: 0.1.0
4
+ Summary: BioInterface is a python package capable of extracting Protein-DNA interfaces from PDB/mmCif structures.
5
+ Author-email: Alessandro Pandolfi <alessandro.pandolfi@protonmail.com>
6
+ Maintainer-email: Alessandro Pandolfi <alessandro.pandolfi@protonmail.com>
7
+ License: MIT license
8
+ Project-URL: bugs, https://gitlab.com/MorfeoRenai/biointerface/-/issues
9
+ Project-URL: changelog, https://gitlab.com/MorfeoRenai/biointerface/-/blob/main/HISTORY.rst
10
+ Project-URL: homepage, https://gitlab.com/MorfeoRenai/biointerface
11
+ Classifier: Programming Language :: Python :: 3
12
+ Description-Content-Type: text/x-rst
13
+ License-File: LICENSE
14
+ License-File: AUTHORS.rst
15
+ Requires-Dist: pandas
16
+ Requires-Dist: biopython
17
+ Requires-Dist: pdbnucleicacids>=0.2.0
18
+ Provides-Extra: dev
19
+ Requires-Dist: coverage; extra == "dev"
20
+ Requires-Dist: mypy; extra == "dev"
21
+ Requires-Dist: pytest; extra == "dev"
22
+ Requires-Dist: ruff; extra == "dev"
23
+
24
+ ============
25
+ BioInterface
26
+ ============
27
+
28
+
29
+ .. image:: https://img.shields.io/pypi/v/biointerface.svg
30
+ :target: https://pypi.python.org/pypi/biointerface
31
+
32
+ .. image:: https://img.shields.io/travis/MorfeoRenai/biointerface.svg
33
+ :target: https://travis-ci.com/MorfeoRenai/biointerface
34
+
35
+ .. image:: https://readthedocs.org/projects/biointerface/badge/?version=latest
36
+ :target: https://biointerface.readthedocs.io/en/latest/?version=latest
37
+ :alt: Documentation Status
38
+
39
+
40
+ .. image:: https://pyup.io/repos/github/MorfeoRenai/biointerface/shield.svg
41
+ :target: https://pyup.io/repos/github/MorfeoRenai/biointerface/
42
+ :alt: Updates
43
+
44
+
45
+
46
+ BioInterface is a python package capable of extracting Protein-DNA interfaces from PDB/mmCif structures.
47
+
48
+
49
+ * Free software: MIT license
50
+ * Documentation: https://biointerface.readthedocs.io.
51
+
52
+
53
+ Features
54
+ --------
55
+
56
+ * TODO
57
+
58
+ Credits
59
+ -------
60
+
61
+ This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
62
+
63
+ .. _Cookiecutter: https://github.com/audreyr/cookiecutter
64
+ .. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
@@ -0,0 +1,41 @@
1
+ ============
2
+ BioInterface
3
+ ============
4
+
5
+
6
+ .. image:: https://img.shields.io/pypi/v/biointerface.svg
7
+ :target: https://pypi.python.org/pypi/biointerface
8
+
9
+ .. image:: https://img.shields.io/travis/MorfeoRenai/biointerface.svg
10
+ :target: https://travis-ci.com/MorfeoRenai/biointerface
11
+
12
+ .. image:: https://readthedocs.org/projects/biointerface/badge/?version=latest
13
+ :target: https://biointerface.readthedocs.io/en/latest/?version=latest
14
+ :alt: Documentation Status
15
+
16
+
17
+ .. image:: https://pyup.io/repos/github/MorfeoRenai/biointerface/shield.svg
18
+ :target: https://pyup.io/repos/github/MorfeoRenai/biointerface/
19
+ :alt: Updates
20
+
21
+
22
+
23
+ BioInterface is a python package capable of extracting Protein-DNA interfaces from PDB/mmCif structures.
24
+
25
+
26
+ * Free software: MIT license
27
+ * Documentation: https://biointerface.readthedocs.io.
28
+
29
+
30
+ Features
31
+ --------
32
+
33
+ * TODO
34
+
35
+ Credits
36
+ -------
37
+
38
+ This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
39
+
40
+ .. _Cookiecutter: https://github.com/audreyr/cookiecutter
41
+ .. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
@@ -0,0 +1,20 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line.
5
+ SPHINXOPTS =
6
+ SPHINXBUILD = python -msphinx
7
+ SPHINXPROJ = biointerface
8
+ SOURCEDIR = .
9
+ BUILDDIR = _build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1 @@
1
+ .. include:: ../AUTHORS.rst
@@ -0,0 +1,162 @@
1
+ #!/usr/bin/env python
2
+ #
3
+ # biointerface documentation build configuration file, created by
4
+ # sphinx-quickstart on Fri Jun 9 13:47:02 2017.
5
+ #
6
+ # This file is execfile()d with the current directory set to its
7
+ # containing dir.
8
+ #
9
+ # Note that not all possible configuration values are present in this
10
+ # autogenerated file.
11
+ #
12
+ # All configuration values have a default; values that are commented out
13
+ # serve to show the default.
14
+
15
+ # If extensions (or modules to document with autodoc) are in another
16
+ # directory, add these directories to sys.path here. If the directory is
17
+ # relative to the documentation root, use os.path.abspath to make it
18
+ # absolute, like shown here.
19
+ #
20
+ import os
21
+ import sys
22
+ sys.path.insert(0, os.path.abspath('..'))
23
+
24
+ import biointerface
25
+
26
+ # -- General configuration ---------------------------------------------
27
+
28
+ # If your documentation needs a minimal Sphinx version, state it here.
29
+ #
30
+ # needs_sphinx = '1.0'
31
+
32
+ # Add any Sphinx extension module names here, as strings. They can be
33
+ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
34
+ extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
35
+
36
+ # Add any paths that contain templates here, relative to this directory.
37
+ templates_path = ['_templates']
38
+
39
+ # The suffix(es) of source filenames.
40
+ # You can specify multiple suffix as a list of string:
41
+ #
42
+ # source_suffix = ['.rst', '.md']
43
+ source_suffix = '.rst'
44
+
45
+ # The master toctree document.
46
+ master_doc = 'index'
47
+
48
+ # General information about the project.
49
+ project = 'BioInterface'
50
+ copyright = "2025, Alessandro Pandolfi"
51
+ author = "Alessandro Pandolfi"
52
+
53
+ # The version info for the project you're documenting, acts as replacement
54
+ # for |version| and |release|, also used in various other places throughout
55
+ # the built documents.
56
+ #
57
+ # The short X.Y version.
58
+ version = biointerface.__version__
59
+ # The full version, including alpha/beta/rc tags.
60
+ release = biointerface.__version__
61
+
62
+ # The language for content autogenerated by Sphinx. Refer to documentation
63
+ # for a list of supported languages.
64
+ #
65
+ # This is also used if you do content translation via gettext catalogs.
66
+ # Usually you set "language" from the command line for these cases.
67
+ language = None
68
+
69
+ # List of patterns, relative to source directory, that match files and
70
+ # directories to ignore when looking for source files.
71
+ # This patterns also effect to html_static_path and html_extra_path
72
+ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
73
+
74
+ # The name of the Pygments (syntax highlighting) style to use.
75
+ pygments_style = 'sphinx'
76
+
77
+ # If true, `todo` and `todoList` produce output, else they produce nothing.
78
+ todo_include_todos = False
79
+
80
+
81
+ # -- Options for HTML output -------------------------------------------
82
+
83
+ # The theme to use for HTML and HTML Help pages. See the documentation for
84
+ # a list of builtin themes.
85
+ #
86
+ html_theme = 'alabaster'
87
+
88
+ # Theme options are theme-specific and customize the look and feel of a
89
+ # theme further. For a list of options available for each theme, see the
90
+ # documentation.
91
+ #
92
+ # html_theme_options = {}
93
+
94
+ # Add any paths that contain custom static files (such as style sheets) here,
95
+ # relative to this directory. They are copied after the builtin static files,
96
+ # so a file named "default.css" will overwrite the builtin "default.css".
97
+ html_static_path = ['_static']
98
+
99
+
100
+ # -- Options for HTMLHelp output ---------------------------------------
101
+
102
+ # Output file base name for HTML help builder.
103
+ htmlhelp_basename = 'biointerfacedoc'
104
+
105
+
106
+ # -- Options for LaTeX output ------------------------------------------
107
+
108
+ latex_elements = {
109
+ # The paper size ('letterpaper' or 'a4paper').
110
+ #
111
+ # 'papersize': 'letterpaper',
112
+
113
+ # The font size ('10pt', '11pt' or '12pt').
114
+ #
115
+ # 'pointsize': '10pt',
116
+
117
+ # Additional stuff for the LaTeX preamble.
118
+ #
119
+ # 'preamble': '',
120
+
121
+ # Latex figure (float) alignment
122
+ #
123
+ # 'figure_align': 'htbp',
124
+ }
125
+
126
+ # Grouping the document tree into LaTeX files. List of tuples
127
+ # (source start file, target name, title, author, documentclass
128
+ # [howto, manual, or own class]).
129
+ latex_documents = [
130
+ (master_doc, 'biointerface.tex',
131
+ 'BioInterface Documentation',
132
+ 'Alessandro Pandolfi', 'manual'),
133
+ ]
134
+
135
+
136
+ # -- Options for manual page output ------------------------------------
137
+
138
+ # One entry per manual page. List of tuples
139
+ # (source start file, name, description, authors, manual section).
140
+ man_pages = [
141
+ (master_doc, 'biointerface',
142
+ 'BioInterface Documentation',
143
+ [author], 1)
144
+ ]
145
+
146
+
147
+ # -- Options for Texinfo output ----------------------------------------
148
+
149
+ # Grouping the document tree into Texinfo files. List of tuples
150
+ # (source start file, target name, title, author,
151
+ # dir menu entry, description, category)
152
+ texinfo_documents = [
153
+ (master_doc, 'biointerface',
154
+ 'BioInterface Documentation',
155
+ author,
156
+ 'biointerface',
157
+ 'One line description of project.',
158
+ 'Miscellaneous'),
159
+ ]
160
+
161
+
162
+
@@ -0,0 +1 @@
1
+ .. include:: ../CONTRIBUTING.rst
@@ -0,0 +1 @@
1
+ .. include:: ../HISTORY.rst
@@ -0,0 +1,20 @@
1
+ Welcome to BioInterface's documentation!
2
+ ======================================
3
+
4
+ .. toctree::
5
+ :maxdepth: 2
6
+ :caption: Contents:
7
+
8
+ readme
9
+ installation
10
+ usage
11
+ modules
12
+ contributing
13
+ authors
14
+ history
15
+
16
+ Indices and tables
17
+ ==================
18
+ * :ref:`genindex`
19
+ * :ref:`modindex`
20
+ * :ref:`search`
@@ -0,0 +1,51 @@
1
+ .. highlight:: shell
2
+
3
+ ============
4
+ Installation
5
+ ============
6
+
7
+
8
+ Stable release
9
+ --------------
10
+
11
+ To install BioInterface, run this command in your terminal:
12
+
13
+ .. code-block:: console
14
+
15
+ $ pip install biointerface
16
+
17
+ This is the preferred method to install BioInterface, as it will always install the most recent stable release.
18
+
19
+ If you don't have `pip`_ installed, this `Python installation guide`_ can guide
20
+ you through the process.
21
+
22
+ .. _pip: https://pip.pypa.io
23
+ .. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/
24
+
25
+
26
+ From sources
27
+ ------------
28
+
29
+ The sources for BioInterface can be downloaded from the `Github repo`_.
30
+
31
+ You can either clone the public repository:
32
+
33
+ .. code-block:: console
34
+
35
+ $ git clone git://github.com/MorfeoRenai/biointerface
36
+
37
+ Or download the `tarball`_:
38
+
39
+ .. code-block:: console
40
+
41
+ $ curl -OJL https://github.com/MorfeoRenai/biointerface/tarball/master
42
+
43
+ Once you have a copy of the source, you can install it with:
44
+
45
+ .. code-block:: console
46
+
47
+ $ python setup.py install
48
+
49
+
50
+ .. _Github repo: https://github.com/MorfeoRenai/biointerface
51
+ .. _tarball: https://github.com/MorfeoRenai/biointerface/tarball/master
@@ -0,0 +1,36 @@
1
+ @ECHO OFF
2
+
3
+ pushd %~dp0
4
+
5
+ REM Command file for Sphinx documentation
6
+
7
+ if "%SPHINXBUILD%" == "" (
8
+ set SPHINXBUILD=python -msphinx
9
+ )
10
+ set SOURCEDIR=.
11
+ set BUILDDIR=_build
12
+ set SPHINXPROJ=biointerface
13
+
14
+ if "%1" == "" goto help
15
+
16
+ %SPHINXBUILD% >NUL 2>NUL
17
+ if errorlevel 9009 (
18
+ echo.
19
+ echo.The Sphinx module was not found. Make sure you have Sphinx installed,
20
+ echo.then set the SPHINXBUILD environment variable to point to the full
21
+ echo.path of the 'sphinx-build' executable. Alternatively you may add the
22
+ echo.Sphinx directory to PATH.
23
+ echo.
24
+ echo.If you don't have Sphinx installed, grab it from
25
+ echo.http://sphinx-doc.org/
26
+ exit /b 1
27
+ )
28
+
29
+ %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
30
+ goto end
31
+
32
+ :help
33
+ %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
34
+
35
+ :end
36
+ popd
@@ -0,0 +1 @@
1
+ .. include:: ../README.rst
@@ -0,0 +1,7 @@
1
+ =====
2
+ Usage
3
+ =====
4
+
5
+ To use BioInterface in a project::
6
+
7
+ import biointerface
@@ -0,0 +1,185 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "biointerface"
7
+ version = "0.1.0"
8
+ description = "BioInterface is a python package capable of extracting Protein-DNA interfaces from PDB/mmCif structures."
9
+ readme = "README.rst"
10
+ authors = [
11
+ {name = "Alessandro Pandolfi", email = "alessandro.pandolfi@protonmail.com"}
12
+ ]
13
+ maintainers = [
14
+ {name = "Alessandro Pandolfi", email = "alessandro.pandolfi@protonmail.com"}
15
+ ]
16
+ classifiers = [
17
+ "Programming Language :: Python :: 3",
18
+ ]
19
+ license = {text = "MIT license"}
20
+ dependencies = [
21
+ "pandas",
22
+ "biopython",
23
+ "pdbnucleicacids >= 0.2.0",
24
+ ]
25
+
26
+ [project.optional-dependencies]
27
+ dev = [
28
+ "coverage", # testing
29
+ "mypy", # linting
30
+ "pytest", # testing
31
+ "ruff" # linting
32
+ ]
33
+
34
+ [project.urls]
35
+
36
+ bugs = "https://gitlab.com/MorfeoRenai/biointerface/-/issues"
37
+ changelog = "https://gitlab.com/MorfeoRenai/biointerface/-/blob/main/HISTORY.rst"
38
+ homepage = "https://gitlab.com/MorfeoRenai/biointerface"
39
+
40
+ [tool.setuptools]
41
+ package-dir = {"" = "src"}
42
+
43
+ [tool.setuptools.package-data]
44
+ "*" = ["*.*"]
45
+
46
+
47
+
48
+
49
+ # Mypy
50
+ # ----
51
+
52
+ [tool.mypy]
53
+ files = "."
54
+
55
+ # Use strict defaults
56
+ strict = true
57
+ warn_unreachable = true
58
+ warn_no_return = true
59
+
60
+ [[tool.mypy.overrides]]
61
+ # Don't require test functions to include types
62
+ module = "tests.*"
63
+ allow_untyped_defs = true
64
+ disable_error_code = "attr-defined"
65
+
66
+
67
+
68
+
69
+ # pytest
70
+ # ----
71
+
72
+ [tool.pytest.ini_options]
73
+ minversion = "6.0"
74
+ addopts = "-rA"
75
+ testpaths = [
76
+ "tests"
77
+ ]
78
+
79
+
80
+
81
+
82
+ # bump-my-version
83
+ # ----
84
+
85
+ [tool.bumpversion]
86
+ current_version = "0.1.0"
87
+ parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
88
+ serialize = ["{major}.{minor}.{patch}"]
89
+ search = "{current_version}"
90
+ replace = "{new_version}"
91
+ regex = false
92
+ ignore_missing_version = false
93
+ ignore_missing_files = false
94
+ tag = false
95
+ sign_tags = false
96
+ tag_name = "v{new_version}"
97
+ tag_message = "Bump version: {current_version} → {new_version}"
98
+ allow_dirty = false
99
+ commit = true
100
+ message = "Bump version: {current_version} → {new_version}"
101
+ commit_args = ""
102
+ setup_hooks = []
103
+ pre_commit_hooks = []
104
+ post_commit_hooks = []
105
+
106
+ [[tool.bumpversion.files]]
107
+ filename = "PDBNucleicAcids/__init__.py"
108
+ search = "{current_version}"
109
+ replace = "{new_version}"
110
+
111
+ [[tool.bumpversion.files]]
112
+ filename = "HISTORY.rst"
113
+ search = "{current_version}"
114
+ replace = "{new_version}"
115
+
116
+ [[tool.bumpversion.files]]
117
+ filename = "pyproject.toml"
118
+ search = "{current_version}"
119
+ replace = "{new_version}"
120
+
121
+
122
+
123
+
124
+ # ruff
125
+ # ----
126
+
127
+ [tool.ruff]
128
+ # Set the maximum line length to 79.
129
+ line-length = 79
130
+ show-fixes = true
131
+
132
+ [tool.ruff.lint]
133
+ # Add the `line-too-long` rule to the enforced rule set. By default, Ruff omits rules that
134
+ # overlap with the use of a formatter, like Black, but we can override this behavior by
135
+ # explicitly adding the rule.
136
+ extend-select = ["E501"]
137
+
138
+
139
+
140
+
141
+ # tox
142
+ # ----
143
+
144
+ [tool.tox]
145
+ #requires = ["tox>=4.19"]
146
+ requires = ["tox"]
147
+ # Elenco delle versioni di Python con cui testare
148
+ envlist = ["py38", "py39", "py310", "py311", "py312", "py313"]
149
+
150
+ [tool.tox.env_run_base] # Configurazione generale per tutti gli ambienti di test
151
+ description = "Run the tests with pytest"
152
+ deps = [
153
+ #"pytest-cov", # Esempio di dipendenza per la coverage dei test
154
+ "-r requirements-dev.txt" # Se hai un file requirements per lo sviluppo
155
+ ]
156
+ commands = [["pytest"]]
157
+
158
+ #[tool.tox.env.type]
159
+ #description = "run type check on code base"
160
+ #deps = ["mypy==1.11.2", "types-cachetools>=5.5.0.20240820", "types-chardet>=5.0.4.6"]
161
+ #commands = [["mypy", "src{/}tox"], ["mypy", "tests"]]
162
+
163
+ [tool.tox.env.py38]
164
+ description = "Run the tests on Python 3.8"
165
+
166
+ [tool.tox.env.py39]
167
+ description = "Run the tests on Python 3.9"
168
+
169
+ [tool.tox.env.py310]
170
+ description = "Run the tests on Python 3.10"
171
+
172
+ [tool.tox.env.py311]
173
+ description = "Run the tests on Python 3.11"
174
+
175
+ [tool.tox.env.py312]
176
+ description = "Run the tests on Python 3.12"
177
+
178
+ [tool.tox.env.py313]
179
+ description = "Run the tests on Python 3.13"
180
+
181
+ # Esempio di configurazione per l'analisi statica del codice (opzionale)
182
+ #[tool.tox.env.lint]
183
+ #description = "Run linting"
184
+ #deps = ["flake8"]
185
+ #commands = ["flake8 src tests"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,5 @@
1
+ """Top-level package for BioInterface."""
2
+
3
+ __author__ = """Alessandro Pandolfi"""
4
+ __email__ = 'alessandro.pandolfi@protonmail.com'
5
+ __version__ = '0.1.0'
@@ -0,0 +1,138 @@
1
+ """Extract interface."""
2
+
3
+ from Bio.PDB.Polypeptide import PPBuilder
4
+ from Bio.PDB.NeighborSearch import NeighborSearch
5
+ from Bio.PDB import Structure, Model, Chain, Residue
6
+ from Bio.PDB import MMCIFIO
7
+
8
+ import pandas as pd
9
+
10
+ from PDBNucleicAcids.NucleicAcid import NABuilder
11
+
12
+
13
+ def get_interface(structure, protein_chain_id, search_radius, n_atoms):
14
+ """Extract interface."""
15
+ # get all the atoms from the nucleic acids, in most cases DNA
16
+ na_builder = NABuilder()
17
+ na_list = na_builder.build_nucleic_acids(structure)
18
+ na_atoms = []
19
+ for na in na_list:
20
+ na_atoms.extend(na.get_atoms())
21
+ na_atoms = list(set(na_atoms))
22
+
23
+ # get all the atoms from the protein chain
24
+ protein_chain = structure[0][protein_chain_id]
25
+ pp_builder = PPBuilder()
26
+ pp = pp_builder.build_peptides(protein_chain)[0]
27
+ pp_atoms = []
28
+ for pp in pp_builder.build_peptides(protein_chain):
29
+ for res in pp:
30
+ pp_atoms.extend(res.get_atoms())
31
+ pp_atoms = list(set(pp_atoms))
32
+
33
+ # Crea una lista con tutti gli atomi di DNA e proteina
34
+ all_atoms = na_atoms + pp_atoms
35
+
36
+ # Usa NeighborSearch per trovare gli atomi vicini entro una certa
37
+ # distanza
38
+ ns = NeighborSearch(all_atoms)
39
+
40
+ # Cerca gli atomi vicini entro un raggio di 4 Å tra DNA e proteina
41
+ all_contacts = ns.search_all(search_radius)
42
+
43
+ # Filtra solo i contatti, ovvero le coppied di atomi,
44
+ # che hanno un atomo di DNA
45
+ temp = [
46
+ (atom1, atom2)
47
+ for atom1, atom2 in all_contacts
48
+ if (atom1 in na_atoms or atom2 in na_atoms)
49
+ ]
50
+
51
+ # Filtra solo i contatti tra DNA e proteina
52
+ contacts = [
53
+ (atom1, atom2)
54
+ for atom1, atom2 in temp
55
+ if (atom1 in na_atoms and atom2 in pp_atoms)
56
+ ] + [
57
+ (atom2, atom1)
58
+ for atom1, atom2 in temp
59
+ if (atom1 in pp_atoms and atom2 in na_atoms)
60
+ ]
61
+ # temp è utile per greedyness, prima prendi il DNA, che ha meno
62
+ # atomi, escludendo quelli intra-proteina
63
+ # poi escludi anche quelli intra-DNA
64
+ # inoltre ci assicuriamo che la col 0 contenga gli atomi di DNA e
65
+ # che col 1 contenga gli atomi di proteine
66
+ # Ce ne assicuriamo invertendo atom1 e atom2 nella seconda lista
67
+
68
+ # dataframe
69
+ contacts_df = pd.DataFrame(contacts, columns=["na_atoms", "pp_atoms"])
70
+
71
+ # distance column
72
+ # Atom - Atom = distance in armstrong
73
+ contacts_df["dist"] = contacts_df.apply(
74
+ lambda row: row["na_atoms"] - row["pp_atoms"], axis=1
75
+ )
76
+
77
+ # grouping: minimum distance for every protein atom, then sorted
78
+ dist = contacts_df.groupby(by="pp_atoms")["dist"].min().sort_values()
79
+
80
+ # take the n top smallest distances
81
+ # atoms as indexes
82
+ dist = dist.head(n_atoms) # Series of floats
83
+ interface_atoms = dist.index.tolist() # index of Atom objects, to list
84
+
85
+ return interface_atoms
86
+
87
+
88
+ def export_atom_list(structure_id, atom_list, out_filepath):
89
+ # not in Path but in string
90
+ out_filepath = str(out_filepath)
91
+
92
+ new_structure = Structure.Structure(structure_id)
93
+ for atom in atom_list:
94
+ _add_atom_to_new_structure(atom, new_structure)
95
+
96
+ # Prepare IO object
97
+ io = MMCIFIO()
98
+ io.set_structure(new_structure)
99
+
100
+ # Esporta la nuova struttura in un file PDB
101
+ # necessita di string type filepath
102
+ io.save(out_filepath)
103
+
104
+
105
+ def _add_atom_to_new_structure(atom, new_structure):
106
+ model_id = (
107
+ atom.get_parent().get_parent().get_parent().id
108
+ ) # Ottieni l'ID del modello
109
+ chain_id = atom.get_parent().get_parent().id # Ottieni l'ID della catena
110
+ residue_id = atom.get_parent().id # Ottieni l'ID del residuo
111
+ resname = atom.get_parent().resname # Nome del residuo
112
+
113
+ # Controlla se il modello esiste già nel nuovo modello
114
+ if model_id in [model.id for model in new_structure]:
115
+ new_model = new_structure[model_id]
116
+ else:
117
+ new_model = Model.Model(model_id)
118
+ new_structure.add(new_model)
119
+
120
+ # Controlla se la catena esiste già nel nuovo modello
121
+ if chain_id in [chain.id for chain in new_model]:
122
+ new_chain = new_model[chain_id]
123
+ else:
124
+ new_chain = Chain.Chain(chain_id)
125
+ new_model.add(new_chain)
126
+
127
+ # Controlla se il residuo esiste già nella nuova catena
128
+ if residue_id in [res.id for res in new_chain]:
129
+ new_residue = new_chain[residue_id]
130
+ else:
131
+ new_residue = Residue.Residue(
132
+ residue_id, resname, atom.get_parent().segid
133
+ )
134
+ new_chain.add(new_residue)
135
+
136
+ # Copia l'atomo e aggiungilo al residuo
137
+ new_atom = atom.copy()
138
+ new_residue.add(new_atom)
@@ -0,0 +1,64 @@
1
+ Metadata-Version: 2.2
2
+ Name: biointerface
3
+ Version: 0.1.0
4
+ Summary: BioInterface is a python package capable of extracting Protein-DNA interfaces from PDB/mmCif structures.
5
+ Author-email: Alessandro Pandolfi <alessandro.pandolfi@protonmail.com>
6
+ Maintainer-email: Alessandro Pandolfi <alessandro.pandolfi@protonmail.com>
7
+ License: MIT license
8
+ Project-URL: bugs, https://gitlab.com/MorfeoRenai/biointerface/-/issues
9
+ Project-URL: changelog, https://gitlab.com/MorfeoRenai/biointerface/-/blob/main/HISTORY.rst
10
+ Project-URL: homepage, https://gitlab.com/MorfeoRenai/biointerface
11
+ Classifier: Programming Language :: Python :: 3
12
+ Description-Content-Type: text/x-rst
13
+ License-File: LICENSE
14
+ License-File: AUTHORS.rst
15
+ Requires-Dist: pandas
16
+ Requires-Dist: biopython
17
+ Requires-Dist: pdbnucleicacids>=0.2.0
18
+ Provides-Extra: dev
19
+ Requires-Dist: coverage; extra == "dev"
20
+ Requires-Dist: mypy; extra == "dev"
21
+ Requires-Dist: pytest; extra == "dev"
22
+ Requires-Dist: ruff; extra == "dev"
23
+
24
+ ============
25
+ BioInterface
26
+ ============
27
+
28
+
29
+ .. image:: https://img.shields.io/pypi/v/biointerface.svg
30
+ :target: https://pypi.python.org/pypi/biointerface
31
+
32
+ .. image:: https://img.shields.io/travis/MorfeoRenai/biointerface.svg
33
+ :target: https://travis-ci.com/MorfeoRenai/biointerface
34
+
35
+ .. image:: https://readthedocs.org/projects/biointerface/badge/?version=latest
36
+ :target: https://biointerface.readthedocs.io/en/latest/?version=latest
37
+ :alt: Documentation Status
38
+
39
+
40
+ .. image:: https://pyup.io/repos/github/MorfeoRenai/biointerface/shield.svg
41
+ :target: https://pyup.io/repos/github/MorfeoRenai/biointerface/
42
+ :alt: Updates
43
+
44
+
45
+
46
+ BioInterface is a python package capable of extracting Protein-DNA interfaces from PDB/mmCif structures.
47
+
48
+
49
+ * Free software: MIT license
50
+ * Documentation: https://biointerface.readthedocs.io.
51
+
52
+
53
+ Features
54
+ --------
55
+
56
+ * TODO
57
+
58
+ Credits
59
+ -------
60
+
61
+ This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
62
+
63
+ .. _Cookiecutter: https://github.com/audreyr/cookiecutter
64
+ .. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
@@ -0,0 +1,26 @@
1
+ AUTHORS.rst
2
+ CONTRIBUTING.rst
3
+ HISTORY.rst
4
+ LICENSE
5
+ MANIFEST.in
6
+ README.rst
7
+ pyproject.toml
8
+ docs/Makefile
9
+ docs/authors.rst
10
+ docs/conf.py
11
+ docs/contributing.rst
12
+ docs/history.rst
13
+ docs/index.rst
14
+ docs/installation.rst
15
+ docs/make.bat
16
+ docs/readme.rst
17
+ docs/usage.rst
18
+ src/biointerface/__init__.py
19
+ src/biointerface/biointerface.py
20
+ src/biointerface.egg-info/PKG-INFO
21
+ src/biointerface.egg-info/SOURCES.txt
22
+ src/biointerface.egg-info/dependency_links.txt
23
+ src/biointerface.egg-info/requires.txt
24
+ src/biointerface.egg-info/top_level.txt
25
+ tests/__init__.py
26
+ tests/test_biointerface.py
@@ -0,0 +1,9 @@
1
+ pandas
2
+ biopython
3
+ pdbnucleicacids>=0.2.0
4
+
5
+ [dev]
6
+ coverage
7
+ mypy
8
+ pytest
9
+ ruff
@@ -0,0 +1 @@
1
+ biointerface
@@ -0,0 +1 @@
1
+ """Unit test package for biointerface."""
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env python
2
+
3
+ """Tests for `biointerface` package."""
4
+
5
+ import pytest
6
+
7
+
8
+ from biointerface import biointerface
9
+
10
+
11
+ @pytest.fixture
12
+ def response():
13
+ """Sample pytest fixture.
14
+
15
+ See more at: http://doc.pytest.org/en/latest/fixture.html
16
+ """
17
+ # import requests
18
+ # return requests.get('https://github.com/audreyr/cookiecutter-pypackage')
19
+
20
+
21
+ def test_content(response):
22
+ """Sample pytest test function with the pytest fixture as an argument."""
23
+ # from bs4 import BeautifulSoup
24
+ # assert 'GitHub' in BeautifulSoup(response.content).title.string