Closed Tonylac77 closed 2 years ago
Can you attach the PDB file? I'll take a look and see what is causing the error.
I've just noticed that the file being used by the code above is 0kBytes, which likely is the issue. This file was generated using the other PDBFixer functions. Please find the original input file(2o1x), output file(2o1x_fixed) and the code I used to generate the 2o1x_fixed file. Hope everything is clear and thanks in advance for the help.
import pandas as pd
import deepchem as dc
from deepchem.utils import download_url, load_from_disk
from simtk.openmm.app import PDBFile
from pdbfixer import PDBFixer
from deepchem.utils.docking_utils import prepare_inputs
df = input_table_1.copy().reset_index()
print(df)
file_name = df.loc[0].at['pdb_location_var']
print(file_name)
fixed_pdb_location = '%s_fixed.pdb' % (file_name)
fixer = PDBFixer(filename=file_name+".pdb")
PDBFile.writeFile(
fixer.topology,
fixer.positions,
fixer.addMissingHydrogens(7.0),
open(fixed_pdb_location,
'w'))
df['pdb_location_var'] = fixed_pdb_location
output_table_1 = df
I seem to have fixed the issue.
If I change the code to this:
fixer = PDBFixer(filename=file_name+".pdb")
fixer.addMissingHydrogens(7.0)
PDBFile.writeFile(
fixer.topology,
fixer.positions,
open(fixed_pdb_location,
'w'))
instead of what I wrote above, the file seems to be written correctly (2.6 MB).
Will close the issues.
Hi,
I have been trying to integrate PDBFixer in a KNIME workflow with success so far. However, I am now encountering this error when defined the PDBFixer function:
This is my code:
error occurs at "fixer="
I've tried this using PDBFixer 1.7 and 1.8 and openmm version 7.5.1 and 7.6, with no luck. Currently in Python 3.7.
I use essentially the exact same code in previous KNIME nodes without any issues so I am confused as to why this error occurs now with this file. I have tried this in a non-KNIME python environment and get the same error. I have also tried changing the file naming with no luck.
Any help greatly appreciated!