Skip to content

Commit

Permalink
Merge pull request #35 from radifar/add-ruff
Browse files Browse the repository at this point in the history
style: add ruff
  • Loading branch information
radifar authored Jan 18, 2025
2 parents 53191bc + c064992 commit 5ee46e9
Show file tree
Hide file tree
Showing 26 changed files with 2,260 additions and 892 deletions.
7 changes: 3 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

# -- Project information -----------------------------------------------------

project = u"pilah"
copyright = u"2024, Muhammad Radifar & Enade Perdana Istyastono"
author = u"Muhammad Radifar"
project = "pilah"
copyright = "2024, Muhammad Radifar & Enade Perdana Istyastono"
author = "Muhammad Radifar"

# -- General configuration ---------------------------------------------------

Expand Down Expand Up @@ -38,4 +38,3 @@
"light_logo": "PiLAH_web.png",
"dark_logo": "PiLAH_web.png",
}

4 changes: 2 additions & 2 deletions pyi_rth_obdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
pyinstaller_temp_dir = sys._MEIPASS
ob_temp_dir = os.path.join(pyinstaller_temp_dir, "Openbabel")

os.environ["BABEL_DATADIR"] = os.path.join(ob_temp_dir, 'data')
os.environ["BABEL_DATADIR"] = os.path.join(ob_temp_dir, "data")
os.environ["BABEL_LIBDIR"] = ob_temp_dir
os.environ["PATH"] = ob_temp_dir + ";" + os.environ["PATH"]
os.environ["PATH"] = ob_temp_dir + ";" + os.environ["PATH"]
3 changes: 2 additions & 1 deletion src/pilah/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# read version from installed package
from importlib.metadata import version
__version__ = version("pilah")

__version__ = version("pilah")
19 changes: 17 additions & 2 deletions src/pilah/atom_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@
"SER": {"C", "O", "CA", "N", "CB", "OG"},
"THR": {"C", "O", "CA", "N", "CB", "CG2", "OG1"},
"VAL": {"C", "O", "CA", "N", "CB", "CG1", "CG2"},
"TRP": {"C", "O", "CA", "N", "CB", "CG", "CD1", "NE1", "CE2", "CD2", "CE3", "CZ3", "CH2", "CZ2"},
"TRP": {
"C",
"O",
"CA",
"N",
"CB",
"CG",
"CD1",
"NE1",
"CE2",
"CD2",
"CE3",
"CZ3",
"CH2",
"CZ2",
},
"TYR": {"C", "O", "CA", "N", "CB", "CG", "CD1", "CE1", "CZ", "OH", "CE2", "CD2"},
}
}
12 changes: 8 additions & 4 deletions src/pilah/dimorphite_dl/dimorphite_dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

RDLogger.DisableLog("rdApp.*")


def print_header():
"""Prints out header information."""
# Always let the user know a help file is available.
Expand Down Expand Up @@ -292,7 +293,7 @@ def neutralize_mol(mol):
[
"[H]-[N:1]-[N:2]#[N:3]",
"[N:1]=[N+1:2]=[N:3]-[H]",
] # To handle bad azide. R-N-N#N should
], # To handle bad azide. R-N-N#N should
# be R-N=[N+]=N
]

Expand Down Expand Up @@ -897,7 +898,10 @@ def set_protonation_charge(mols, idx, charges, prot_site_name):
try:
mol_copy = Chem.RemoveHs(mol_copy)
except:
if "silent" in ProtSubstructFuncs.args and not ProtSubstructFuncs.args["silent"]:
if (
"silent" in ProtSubstructFuncs.args
and not ProtSubstructFuncs.args["silent"]
):
UtilFuncs.eprint(
"WARNING: Skipping poorly formed SMILES string: "
+ Chem.MolToSmiles(mol_copy)
Expand Down Expand Up @@ -1108,7 +1112,7 @@ def test():
"pka_precision": 0.5,
"smiles": "",
"label_states": True,
"silent": True
"silent": True,
}

for smi, protonated, deprotonated, category in smis:
Expand Down Expand Up @@ -1252,7 +1256,7 @@ def test():
"min_ph": ph,
"max_ph": ph,
"pka_precision": 0,
"silent": True
"silent": True,
}
)
)
Expand Down
66 changes: 59 additions & 7 deletions src/pilah/element.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,68 @@
metal_list = ["CA", "CO", "CU", "FE", "K", "MG", "MN", "NA", "NI",
"ZN", "AG", "AL", "AU", "BA", "BE", "CD", "CR", "CS",
"GA", "GD", "HG", "IR", "LI", "MO", "PB", "PD", "PR",
"PT", "RB", "RE", "RH", "RU", "SR", "TB", "TL", "U",
"V", "W", "Y", "YB"]
metal_list = [
"CA",
"CO",
"CU",
"FE",
"K",
"MG",
"MN",
"NA",
"NI",
"ZN",
"AG",
"AL",
"AU",
"BA",
"BE",
"CD",
"CR",
"CS",
"GA",
"GD",
"HG",
"IR",
"LI",
"MO",
"PB",
"PD",
"PR",
"PT",
"RB",
"RE",
"RH",
"RU",
"SR",
"TB",
"TL",
"U",
"V",
"W",
"Y",
"YB",
]

# These charges are based on the ion charge in RCSB PDB page for
# each corresponding ion.

positive_one = ["LI", "NA", "K", "RB", "CS", "AU", "TL"]

positive_two = ["BE", "MG", "CA", "SR", "BA", "MN", "ZN", "CO", "NI",
"PD", "PT", "CU", "CD", "HG", "PB"]
positive_two = [
"BE",
"MG",
"CA",
"SR",
"BA",
"MN",
"ZN",
"CO",
"NI",
"PD",
"PT",
"CU",
"CD",
"HG",
"PB",
]

positive_three = ["V", "CR", "FE", "RU", "SB", "SM", "Y"]

Expand Down
Loading

0 comments on commit 5ee46e9

Please sign in to comment.