Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

towards v1.0 #64

Merged
merged 18 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,4 @@ _version.py

#IDE
.idea
.vscode
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
848 changes: 774 additions & 74 deletions examples/konnektor_example.ipynb

Large diffs are not rendered by default.

728 changes: 505 additions & 223 deletions examples/konnektor_networks.ipynb

Large diffs are not rendered by default.

32 changes: 21 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ authors=[
{name="Mike Henry", email="[email protected]"},
{name="Richard J Gowers", email="[email protected]"},
]
dependencies = [
'scipy',
'numpy',
'networkx',
'gufe',
'rdkit',
'scikit-mol',
'scikit-learn',
'ipycytoscape'
]
description="Konnektor is a package for calculating networks."
readme="README.md"
requires-python = ">=3.9"
Expand All @@ -35,6 +25,26 @@ classifiers = [
"Operating System :: OS Independent",
]

dependencies = [
'gufe',
'numpy',
'rdkit',
'networkx',
'scikit-mol',
'scikit-learn',
'ipycytoscape',
]

[project.optional-dependencies]
test = [
'pytest',
'pytest-cov[all]',
]
dev = [
'black',
'pre-commit',
]

[project.urls]
"Homepage" = "https://github.com/OpenFreeEnergy/konnektor"

Expand All @@ -50,7 +60,7 @@ dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"
distance-dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"

[tool.versioningit.vcs]
method = "git"
method = "git"
match = ["*"]
default-tag = "0.0.0"

Expand Down
36 changes: 22 additions & 14 deletions src/konnektor/__init__.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
# This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/konnektor

from .network_planners import (MaximalNetworkGenerator,
HeuristicMaximalNetworkGenerator,
RadialLigandNetworkPlanner,
NNodeEdgesNetworkGenerator,
MinimalSpanningTreeNetworkGenerator,
CyclicNetworkGenerator,
ClusteredNetworkGenerator,
StarrySkyNetworkGenerator,
MstConcatenator,
)
from .network_planners import (
MaximalNetworkGenerator,
HeuristicMaximalNetworkGenerator,
RadialLigandNetworkPlanner,
NNodeEdgesNetworkGenerator,
MinimalSpanningTreeNetworkGenerator,
CyclicNetworkGenerator,
ClusteredNetworkGenerator,
StarrySkyNetworkGenerator,
MstConcatenator,
)

from .network_tools import concatenate_networks, merge_networks, append_component, \
delete_transformation
from .network_tools import ChargeClusterer, ScaffoldClusterer, \
ComponentsDiversityClusterer
from .network_tools import (
concatenate_networks,
merge_networks,
append_component,
delete_transformation,
)
from .network_tools import (
ChargeClusterer,
ScaffoldClusterer,
ComponentsDiversityClusterer,
)

from . import network_analysis

Expand Down
33 changes: 29 additions & 4 deletions src/konnektor/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
root_path = os.path.dirname(__file__)
benzenes_sdf_path = f"{root_path}/benzenes_RHFE.sdf"
hif2a_sdf_path = f"{root_path}/hif2a_ligands.sdf"
charged_ligands_path = f"{root_path}/charged_ligands.sdf"

def get_benzene_ligands()->list[SmallMoleculeComponent]:

def get_benzene_ligands() -> list[SmallMoleculeComponent]:
"""
get the benzene test dataset parsed as SmallMoleculeComponents.

Expand All @@ -21,9 +23,29 @@
a list of the benzene compounds.

"""
return [SmallMoleculeComponent.from_rdkit(rdm) for rdm in Chem.SDMolSupplier(benzenes_sdf_path, removeHs=False)]
return [
SmallMoleculeComponent.from_rdkit(rdm)
for rdm in Chem.SDMolSupplier(benzenes_sdf_path, removeHs=False)
]


def get_hif2a_ligands() -> list[SmallMoleculeComponent]:
"""
get the benzene test dataset parsed as SmallMoleculeComponents.

Returns
-------
list[SmallMoleculeComponent]
a list of the benzene compounds.

"""
return [
SmallMoleculeComponent.from_rdkit(rdm)
for rdm in Chem.SDMolSupplier(hif2a_sdf_path, removeHs=False)
]


def get_hif2a_ligands()->list[SmallMoleculeComponent]:
def get_charged_ligands() -> list[SmallMoleculeComponent]:
"""
get the benzene test dataset parsed as SmallMoleculeComponents.

Expand All @@ -33,4 +55,7 @@
a list of the benzene compounds.

"""
return [SmallMoleculeComponent.from_rdkit(rdm) for rdm in Chem.SDMolSupplier(hif2a_sdf_path, removeHs=False)]
return [

Check warning on line 58 in src/konnektor/data/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/konnektor/data/__init__.py#L58

Added line #L58 was not covered by tests
SmallMoleculeComponent.from_rdkit(rdm)
for rdm in Chem.SDMolSupplier(charged_ligands_path, removeHs=False)
]
Loading
Loading