Skip to content

Commit

Permalink
Merge pull request #153 from volkamerlab/update-formatting
Browse files Browse the repository at this point in the history
Update formatting (black version 23.3.0)
  • Loading branch information
dominiquesydow authored Apr 10, 2023
2 parents de8faff + a1e2470 commit c76e87c
Show file tree
Hide file tree
Showing 17 changed files with 1 addition and 85 deletions.
1 change: 0 additions & 1 deletion opencadd/databases/klifs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,6 @@ class CoordinatesProvider(BaseProvider):
"""

def __init__(self, *args, **kwargs):

self.options = {
"entities": ["complex", "ligand", "pocket", "protein", "water"],
"extensions": ["mol2", "pdb"],
Expand Down
29 changes: 0 additions & 29 deletions opencadd/databases/klifs/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class LocalInitializer:
"""

def __init__(self, database, path_to_klifs_download, *args, **kwargs):

self._database = database
self._path_to_klifs_download = path_to_klifs_download

Expand All @@ -70,7 +69,6 @@ class _LocalDatabaseGenerator:
"""

def __init__(self):

self.path_to_klifs_download = None

@classmethod
Expand Down Expand Up @@ -317,7 +315,6 @@ def _add_filepaths(klifs_metadata):
filepaths = []

for _, row in klifs_metadata.iterrows():

# Depending on whether alternate model and chain ID is given build file path:
filepath = metadata_to_filepath(
".",
Expand Down Expand Up @@ -394,7 +391,6 @@ class Kinases(LocalInitializer, KinasesProvider):
"""

def all_kinase_groups(self):

# Get local database
kinase_groups = self._database.copy()
# Standardize DataFrame
Expand All @@ -404,7 +400,6 @@ def all_kinase_groups(self):
return kinase_groups

def all_kinase_families(self, groups=None):

# Get local database and select rows
kinase_families = self._database.copy()
groups = self._ensure_list(groups)
Expand All @@ -417,7 +412,6 @@ def all_kinase_families(self, groups=None):
return kinase_families

def all_kinases(self, groups=None, families=None, species=None):

# Get local database and select rows
kinases = self._database.copy()
groups = self._ensure_list(groups)
Expand All @@ -433,7 +427,6 @@ def all_kinases(self, groups=None, families=None, species=None):
return kinases

def by_kinase_klifs_id(self, kinase_klifs_ids):

kinase_klifs_ids = self._ensure_list(kinase_klifs_ids)
# Get local database and select rows
kinases = self._database.copy()
Expand All @@ -443,7 +436,6 @@ def by_kinase_klifs_id(self, kinase_klifs_ids):
return kinases

def by_kinase_name(self, kinase_names, species=None):

kinase_names = self._ensure_list(kinase_names)
# Get local database and select rows
kinases = self._database.copy()
Expand All @@ -469,15 +461,13 @@ class Ligands(LocalInitializer, LigandsProvider):
"""

def all_ligands(self):

# Get local database
ligands = self._database.copy()
# Standardize DataFrame
ligands = self._standardize_dataframe(ligands, FIELDS.oc_name_to_type("ligands"))
return ligands

def by_kinase_klifs_id(self, kinase_klifs_ids):

kinase_klifs_ids = self._ensure_list(kinase_klifs_ids)
# Get local database and select rows
ligands = self._database.copy()
Expand All @@ -498,7 +488,6 @@ def by_kinase_klifs_id(self, kinase_klifs_ids):
return ligands

def by_kinase_name(self, kinase_names):

kinase_names = self._ensure_list(kinase_names)
# Get local database and select rows
ligands = self._database.copy()
Expand Down Expand Up @@ -532,7 +521,6 @@ def by_kinase_name(self, kinase_names):
return ligands

def by_ligand_expo_id(self, ligand_expo_ids):

ligand_expo_ids = self._ensure_list(ligand_expo_ids)
# Get local database and select rows
ligands = self._database.copy()
Expand All @@ -553,7 +541,6 @@ class Structures(LocalInitializer, StructuresProvider):
"""

def all_structures(self):

# Get local database
structures = self._database.copy()
# Standardize DataFrame
Expand All @@ -564,7 +551,6 @@ def all_structures(self):
return structures

def by_structure_klifs_id(self, structure_klifs_ids):

structure_klifs_ids = self._ensure_list(structure_klifs_ids)
# Get local database and select rows
structures = self._database.copy()
Expand All @@ -582,7 +568,6 @@ def by_structure_klifs_id(self, structure_klifs_ids):
return structures

def by_kinase_klifs_id(self, kinase_klifs_ids):

kinase_klifs_ids = self._ensure_list(kinase_klifs_ids)
# Get local database and select rows
structures = self._database.copy()
Expand All @@ -597,7 +582,6 @@ def by_kinase_klifs_id(self, kinase_klifs_ids):
def by_structure_pdb_id(
self, structure_pdb_ids, structure_alternate_model=None, structure_chain=None
):

structure_pdb_ids = self._ensure_list(structure_pdb_ids)
# Get local database and select rows
structures = self._database.copy()
Expand All @@ -615,7 +599,6 @@ def by_structure_pdb_id(
return structures

def by_ligand_expo_id(self, ligand_expo_ids):

ligand_expo_ids = self._ensure_list(ligand_expo_ids)
# Get local database and select rows
structures = self._database.copy()
Expand All @@ -628,7 +611,6 @@ def by_ligand_expo_id(self, ligand_expo_ids):
return structures

def by_kinase_name(self, kinase_names):

kinase_names = self._ensure_list(kinase_names)
# Get local database and select rows (search in all available kinase names)
structures = self._database.copy()
Expand Down Expand Up @@ -662,7 +644,6 @@ class Interactions(LocalInitializer, InteractionsProvider):
"""

def all_interactions(self):

# Get local database
interactions = self._database.copy()
# Standardize DataFrame
Expand All @@ -673,7 +654,6 @@ def all_interactions(self):
return interactions

def by_structure_klifs_id(self, structure_klifs_ids):

structure_klifs_ids = self._ensure_list(structure_klifs_ids)
# Get local database and select rows
interactions = self._database.copy()
Expand All @@ -686,7 +666,6 @@ def by_structure_klifs_id(self, structure_klifs_ids):
return interactions

def by_kinase_klifs_id(self, kinase_klifs_ids):

kinase_klifs_ids = self._ensure_list(kinase_klifs_ids)
# Get local database and select rows
interactions = self._database.copy()
Expand All @@ -713,7 +692,6 @@ class Pockets(LocalInitializer, PocketsProvider):
"""

def by_structure_klifs_id(self, structure_klifs_id, extension="mol2"): # pylint: disable=W0221

# Get kinase pocket from structure ID
structures_local = Structures(self._database, self._path_to_klifs_download)
structure = structures_local.by_structure_klifs_id(structure_klifs_id).squeeze()
Expand Down Expand Up @@ -786,7 +764,6 @@ class Coordinates(LocalInitializer, CoordinatesProvider):
def to_text(
self, structure_klifs_id_or_filepath, entity="complex", extension="mol2"
): # pylint: disable=W0221

filepath = self._to_filepath(structure_klifs_id_or_filepath, entity, extension)
with open(filepath, "r") as f:
text = f.read()
Expand All @@ -795,7 +772,6 @@ def to_text(
def to_dataframe(
self, structure_klifs_id_or_filepath, entity="complex", extension="mol2"
): # pylint: disable=W0221

filepath = self._to_filepath(structure_klifs_id_or_filepath, entity, extension)
dataframe = DataFrame.from_file(filepath)
dataframe = self._add_residue_klifs_ids(dataframe, filepath)
Expand All @@ -804,7 +780,6 @@ def to_dataframe(
def to_rdkit(
self, structure_klifs_id_or_filepath, entity="complex", extension="mol2", compute2d=True
): # pylint: disable=W0221

filepath = self._to_filepath(structure_klifs_id_or_filepath, entity, extension)
rdkit_mol = Rdkit.from_file(filepath, compute2d)
return rdkit_mol
Expand Down Expand Up @@ -893,7 +868,6 @@ class Drugs(LocalInitializer, DrugsProvider):
"""

def all_drugs(self):

raise NotImplementedError(
"Information on drugs is not available locally! Please use a remote session."
)
Expand All @@ -907,13 +881,11 @@ class StructureConformations(LocalInitializer, StructureConformationsProvider):
"""

def all_conformations(self):

raise NotImplementedError(
"Information on conformations is not available locally! Please use a remote session."
)

def by_structure_klifs_id(self, structure_klifs_id):

raise NotImplementedError(
"Information on conformations is not available locally! Please use a remote session."
)
Expand All @@ -927,7 +899,6 @@ class StructureModifiedResidues(LocalInitializer, StructureModifiedResiduesProvi
"""

def by_structure_klifs_id(self, structure_klifs_id):

raise NotImplementedError(
"Information on modified residues is not available locally! Please use a remote session."
)
Loading

0 comments on commit c76e87c

Please sign in to comment.