Skip to content

Commit

Permalink
Merge pull request #350 from Armin-Ariamajd/334-t018-deprecation-warn…
Browse files Browse the repository at this point in the history
…ings-and-images-not-showing

T018: deprecation warnings and images not showing (#334)
  • Loading branch information
mbackenkoehler authored May 15, 2023
2 parents 3bf72cf + 7592f5c commit 380d55a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion devtools/test_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies:
- pypdb
- biopython<=1.77
- biopandas
- rdkit==2021.09.5
- rdkit
- openbabel
- opencadd
- biotite>=0.34.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def _on_selection_change(change):
app.center.close()

# NGL Viewer
app.center = viewer = nv.NGLWidget(default=True, gui=True)
app.center = viewer = nv.NGLWidget()

with open(protein_filepath) as f:
prot_component = viewer.add_component(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
"""

from pathlib import Path # for creating folders and handling local paths
import warnings

import pypdb # for communicating with the RCSB Protein Data Bank (PDB) to fetch PDB files
from biopandas.pdb import PandasPdb # for working with PDB files
import pypdb # for communicating with the RCSB Protein Data Bank (PDB) to fetch PDB files
from opencadd.structure.core import Structure # for manipulating PDB files


Expand Down Expand Up @@ -84,7 +85,9 @@ def extract_molecule_from_pdb_file(molecule_name, input_filepath, output_filepat
molecule_name = f"resname {molecule_name}" if molecule_name != "protein" else molecule_name
extracted_structure = pdb_structure.select_atoms(molecule_name)
if output_filepath is not None:
extracted_structure.write(Path(output_filepath).with_suffix(".pdb"))
with warnings.catch_warnings():
warnings.simplefilter("ignore")
extracted_structure.write(Path(output_filepath).with_suffix(".pdb"))
return extracted_structure


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,9 @@ def __repr__(self):
return f"<Ligand CID: {self.cid}>"

def __call__(self):
df = pd.DataFrame(columns=["smiles"])
df.loc[1] = self.smiles
PandasTools.AddMoleculeColumnToFrame(df, smilesCol="smiles")
romol = df.loc[1, "ROMol"]

return pd.concat({romol: self.dataframe}, names=["Structure"])
df = pd.DataFrame({"Value": [self.rdkit_obj]}, index=[""])
df.index.name = "Property"
return pd.concat([df, self.dataframe])

def remove_counterion(self):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(self, identifier_type, identifier_value, protein_output_path):
identifier_value, Path(protein_output_path) / identifier_value
)

self.file_content = pdb.read_pdb_file_content(identifier_type.value, identifier_value)
self.file_content = pdb.read_pdb_file_content("pdb_filepath", self.pdb_filepath)

dict_of_dataframes = pdb.load_pdb_file_as_dataframe(self.file_content)
for key, value in dict_of_dataframes.items():
Expand Down

0 comments on commit 380d55a

Please sign in to comment.