Skip to content

Commit

Permalink
Fix typing errror
Browse files Browse the repository at this point in the history
  • Loading branch information
PauAndrio committed Oct 23, 2024
1 parent 3fd7ef7 commit b85b306
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .github/env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ channels:
- bioconda
- anaconda
dependencies:
- biobb_common ==4.2.0
- biobb_common ==5.0.0
- imods
- prody
- concoord
Expand Down
32 changes: 17 additions & 15 deletions biobb_flexdyn/flexdyn/concoord_disco.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,43 +133,45 @@ def launch(self):
# MARGINS_li.DAT, MARGINS_oplsaa.DAT, MARGINS_oplsua.DAT, MARGINS_oplsx.DAT, MARGINS_repel.DAT, MARGINS_yamber2.DAT
# 1 (OPLS-UA -united atoms- parameters), 2 (OPLS-AA -all atoms- parameters), 3 (PROLSQ repel parameters), 4 (Yamber2 parameters), 5 (Li et al. parameters), 6 (OPLS-X parameters -recommended for NMR structure determination-).
vdw_values = ["vdw_values", "oplsua", "oplsaa", "repel", "yamber2", "li", "oplsx"]
if self.vdw is None:
raise ValueError("The 'vdw' property cannot be None")
vdw_index = int(self.vdw)
margins_file = concoord_lib + "/MARGINS_" + vdw_values[vdw_index] + ".DAT"
atoms_file = concoord_lib + "/ATOMS_" + vdw_values[vdw_index] + ".DAT"
bonds_file = concoord_lib + "/BONDS.DAT"
shutil.copy2(margins_file, self.stage_io_dict.get("unique_dir"))
shutil.copy2(margins_file, self.stage_io_dict.get("unique_dir")+"/MARGINS.DAT")
shutil.copy2(atoms_file, self.stage_io_dict.get("unique_dir"))
shutil.copy2(bonds_file, self.stage_io_dict.get("unique_dir"))
margins_file = str(concoord_lib) + "/MARGINS_" + vdw_values[vdw_index] + ".DAT"
atoms_file = str(concoord_lib) + "/ATOMS_" + vdw_values[vdw_index] + ".DAT"
bonds_file = str(concoord_lib) + "/BONDS.DAT"
shutil.copy2(margins_file, self.stage_io_dict.get("unique_dir", ""))
shutil.copy2(margins_file, self.stage_io_dict.get("unique_dir", "")+"/MARGINS.DAT")
shutil.copy2(atoms_file, self.stage_io_dict.get("unique_dir", ""))
shutil.copy2(bonds_file, self.stage_io_dict.get("unique_dir", ""))

# Command line
# (concoord) OROZCO67:biobb_flexdyn hospital$ disco -d biobb_flexdyn/test/reference/flexdyn/dist.dat
# -p biobb_flexdyn/test/reference/flexdyn/dist.pdb -op patata.pdb
self.cmd = ["cd ", self.stage_io_dict.get('unique_dir'), ";", self.binary_path,
self.cmd = ["cd ", self.stage_io_dict.get('unique_dir', ''), ";", self.binary_path,
# "-p", str(Path(self.stage_io_dict["in"]["input_pdb_path"]).relative_to(Path.cwd())),
# "-d", str(Path(self.stage_io_dict["in"]["input_dat_path"]).relative_to(Path.cwd())),
# "-or", str(Path(self.stage_io_dict["out"]["output_rmsd_path"]).relative_to(Path.cwd())),
# "-of", str(Path(self.stage_io_dict["out"]["output_bfactor_path"]).relative_to(Path.cwd()))
"-p", str(Path(self.stage_io_dict["in"]["input_pdb_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir')))),
"-d", str(Path(self.stage_io_dict["in"]["input_dat_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir')))),
"-or", str(Path(self.stage_io_dict["out"]["output_rmsd_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir')))),
"-of", str(Path(self.stage_io_dict["out"]["output_bfactor_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir'))))
"-p", str(Path(self.stage_io_dict["in"]["input_pdb_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir', '')))),
"-d", str(Path(self.stage_io_dict["in"]["input_dat_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir', '')))),
"-or", str(Path(self.stage_io_dict["out"]["output_rmsd_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir', '')))),
"-of", str(Path(self.stage_io_dict["out"]["output_bfactor_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir', ''))))
]

# Output structure formats:
file_extension = Path(self.stage_io_dict["out"]["output_traj_path"]).suffix
if file_extension == ".pdb":
self.cmd.append('-on') # NMR-PDB format (multi-model)
# self.cmd.append(str(Path(self.stage_io_dict["out"]["output_traj_path"]).relative_to(Path.cwd())))
self.cmd.append(str(Path(self.stage_io_dict["out"]["output_traj_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir')))))
self.cmd.append(str(Path(self.stage_io_dict["out"]["output_traj_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir', '')))))
elif file_extension == ".gro":
self.cmd.append('-ot')
# self.cmd.append(str(Path(self.stage_io_dict["out"]["output_traj_path"]).relative_to(Path.cwd())))
self.cmd.append(str(Path(self.stage_io_dict["out"]["output_traj_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir')))))
self.cmd.append(str(Path(self.stage_io_dict["out"]["output_traj_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir', '')))))
elif file_extension == ".xtc":
self.cmd.append('-ox')
# self.cmd.append(str(Path(self.stage_io_dict["out"]["output_traj_path"]).relative_to(Path.cwd())))
self.cmd.append(str(Path(self.stage_io_dict["out"]["output_traj_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir')))))
self.cmd.append(str(Path(self.stage_io_dict["out"]["output_traj_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir', '')))))
else:
fu.log("ERROR: output_traj_path ({}) must be a PDB, GRO or XTC formatted file ({})".format(self.io_dict["out"]["output_traj_path"], file_extension), self.out_log, self.global_log)

Expand Down
20 changes: 10 additions & 10 deletions biobb_flexdyn/flexdyn/concoord_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ def launch(self):
# Copy auxiliary file (HBONDS) to the working dir
concoord_lib = os.getenv("CONCOORDLIB")

hbonds_file = concoord_lib + "/HBONDS.DAT"
shutil.copy2(hbonds_file, self.stage_io_dict.get("unique_dir"))
hbonds_file = str(concoord_lib) + "/HBONDS.DAT"
shutil.copy2(hbonds_file, self.stage_io_dict.get("unique_dir", ""))

# Command line
# (concoord) OROZCO67:biobb_flexdyn hospital$ dist -p biobb_flexdyn/test/data/flexdyn/structure.pdb
Expand All @@ -135,25 +135,25 @@ def launch(self):
# Selected parameter set 1
# copying /opt/anaconda3/envs/concoord/share/concoord/lib/BONDS.DAT.noeh to BONDS.DAT in current working directory

self.cmd = ["cd ", self.stage_io_dict.get('unique_dir'), ";", self.binary_path,
self.cmd = ["cd ", self.stage_io_dict.get('unique_dir', ''), ";", self.binary_path,
# "-op", self.stage_io_dict["out"]["output_pdb_path"],
# "-og", self.stage_io_dict["out"]["output_gro_path"],
# "-od", self.stage_io_dict["out"]["output_dat_path"]
"-op", str(Path(self.stage_io_dict["out"]["output_pdb_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir')))),
"-og", str(Path(self.stage_io_dict["out"]["output_gro_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir')))),
"-od", str(Path(self.stage_io_dict["out"]["output_dat_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir'))))
"-op", str(Path(self.stage_io_dict["out"]["output_pdb_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir', '')))),
"-og", str(Path(self.stage_io_dict["out"]["output_gro_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir', '')))),
"-od", str(Path(self.stage_io_dict["out"]["output_dat_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir', ''))))
]
# If input structure in pdb format:
file_extension = Path(self.stage_io_dict["in"]["input_structure_path"]).suffix
if file_extension == ".pdb":
self.cmd.append('-p')
# self.cmd.append(self.stage_io_dict["in"]["input_structure_path"])
self.cmd.append(str(Path(self.stage_io_dict["in"]["input_structure_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir')))))
self.cmd.append(str(Path(self.stage_io_dict["in"]["input_structure_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir', '')))))

elif file_extension == ".gro":
self.cmd.append('-g')
# self.cmd.append(self.stage_io_dict["in"]["input_structure_path"])
self.cmd.append(str(Path(self.stage_io_dict["in"]["input_structure_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir')))))
self.cmd.append(str(Path(self.stage_io_dict["in"]["input_structure_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir', '')))))

else:
fu.log("ERROR: input_structure_path ({}) must be a PDB or a GRO formatted file ({})".format(self.io_dict["in"]["input_structure_path"], file_extension), self.out_log, self.global_log)
Expand Down Expand Up @@ -182,7 +182,7 @@ def launch(self):
# Add stdin input file
self.cmd.append('<')
# self.cmd.append(self.stage_io_dict["in"]["stdin_file_path"])
self.cmd.append(str(Path(self.stage_io_dict["in"]["stdin_file_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir')))))
self.cmd.append(str(Path(self.stage_io_dict["in"]["stdin_file_path"]).relative_to(Path(self.stage_io_dict.get('unique_dir', '')))))

# Run Biobb block
self.run_biobb()
Expand All @@ -193,7 +193,7 @@ def launch(self):
# remove temporary folder(s)
self.tmp_files.extend([
self.stage_io_dict.get("unique_dir", ""),
self.io_dict['in'].get("stdin_file_path")
self.io_dict['in'].get("stdin_file_path", "")
])
self.remove_tmp_files()

Expand Down
6 changes: 3 additions & 3 deletions biobb_flexdyn/flexdyn/imod_imc.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ def launch(self):
shutil.copy2(self.io_dict["in"]["input_dat_path"], self.tmp_folder)

# Output temporary file
# out_file_prefix = Path(self.stage_io_dict.get("unique_dir")).joinpath("imod_ensemble")
# out_file = Path(self.stage_io_dict.get("unique_dir")).joinpath("imod_ensemble.pdb")
# out_file_prefix = Path(self.stage_io_dict.get("unique_dir", "")).joinpath("imod_ensemble")
# out_file = Path(self.stage_io_dict.get("unique_dir", "")).joinpath("imod_ensemble.pdb")
out_file_prefix = "imod_ensemble" # Needed as imod is appending the .pdb extension
out_file = "imod_ensemble.pdb"

Expand Down Expand Up @@ -149,7 +149,7 @@ def launch(self):

# remove temporary folder(s)
self.tmp_files.extend([
# self.stage_io_dict.get("unique_dir")
# self.stage_io_dict.get("unique_dir", "")
self.tmp_folder
])
self.remove_tmp_files()
Expand Down
6 changes: 3 additions & 3 deletions biobb_flexdyn/flexdyn/imod_imode.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ def launch(self):
shutil.copy2(self.io_dict["in"]["input_pdb_path"], self.tmp_folder)

# Output temporary file
# out_file_prefix = Path(self.stage_io_dict.get("unique_dir")).joinpath("imods_evecs")
# out_file = Path(self.stage_io_dict.get("unique_dir")).joinpath("imods_evecs_ic.evec")
# out_file_prefix = Path(self.stage_io_dict.get("unique_dir", "")).joinpath("imods_evecs")
# out_file = Path(self.stage_io_dict.get("unique_dir", "")).joinpath("imods_evecs_ic.evec")
out_file_prefix = "imods_evecs" # Needed as imod is appending the _ic.evec extension
out_file = "imods_evecs_ic.evec"

Expand Down Expand Up @@ -129,7 +129,7 @@ def launch(self):

# remove temporary folder(s)
self.tmp_files.extend([
# self.stage_io_dict.get("unique_dir")
# self.stage_io_dict.get("unique_dir", "")
self.tmp_folder
])
self.remove_tmp_files()
Expand Down
2 changes: 1 addition & 1 deletion biobb_flexdyn/flexdyn/imod_imove.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def launch(self):

# remove temporary folder(s)
self.tmp_files.extend([
# self.stage_io_dict.get("unique_dir")
# self.stage_io_dict.get("unique_dir", "")
self.tmp_folder
])
self.remove_tmp_files()
Expand Down
4 changes: 2 additions & 2 deletions biobb_flexdyn/flexdyn/nolb_nma.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ def launch(self):
self.stage_files()

# Output temporary file
out_file_prefix = Path(self.stage_io_dict.get("unique_dir")).joinpath("nolb_ensemble")
out_file = Path(self.stage_io_dict.get("unique_dir")).joinpath("nolb_ensemble_nlb_decoys.pdb")
out_file_prefix = Path(self.stage_io_dict.get("unique_dir", "")).joinpath("nolb_ensemble")
out_file = Path(self.stage_io_dict.get("unique_dir", "")).joinpath("nolb_ensemble_nlb_decoys.pdb")

# Command line
# ./NOLB 1ake_monomer.pdb -s 100 --rmsd 5 -m -o patata # Output: patata_nlb_decoys.pdb
Expand Down
4 changes: 2 additions & 2 deletions biobb_flexdyn/flexdyn/prody_anm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""Module containing the prody_anm class and the command line interface."""
import argparse
from typing import Optional
import prody
import prody # type: ignore
from biobb_common.generic.biobb_object import BiobbObject
from biobb_common.configuration import settings
from biobb_common.tools.file_utils import launchlogger
Expand Down Expand Up @@ -91,7 +91,7 @@ def launch(self):
prot = prody.parsePDB(self.stage_io_dict["in"]["input_pdb_path"],)

# http://prody.csb.pitt.edu/manual/reference/atomic/select.html
prot_sel = prot.select(self.selection)
prot_sel = prot.select(self.selection) # type: ignore

enm = prody.ANM('BioBB_flexdyn Prody ANM ensemble generator')

Expand Down
14 changes: 6 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="biobb_flexdyn",
version="4.2.0",
version="5.0.0",
author="Biobb developers",
author_email="[email protected]",
description="biobb_flexdyn is a BioBB category for studies on the conformational landscape of native proteins.",
Expand All @@ -20,8 +20,8 @@
packages=setuptools.find_packages(exclude=['docs', 'test']),
package_data={'biobb_flexdyn': ['py.typed']},
include_package_data=True,
install_requires=['biobb_common==4.2.0'],
python_requires='>=3.8',
install_requires=['biobb_common==5.0.0'],
python_requires='>=3.9',
entry_points={
"console_scripts": [
"concoord_dist = biobb_flexdyn.flexdyn.concoord_dist:main",
Expand All @@ -33,13 +33,11 @@
"prody_anm = biobb_flexdyn.flexdyn.prody_anm:main"
]
},
classifiers=(
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3.8",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"License :: OSI Approved :: Apache Software License",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX",
),
],
)

0 comments on commit b85b306

Please sign in to comment.