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

T018: deprecation warnings and images not showing (#334) #350

Merged
Show file tree
Hide file tree
Changes from all 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
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