0

I'm using Biopython to load structures into my code. I then change them into poses, via PyRosetta, because I want to align my theo structure to the PDB website structures. This is my code:

pdbl = PDBList()
native_pdb = pdbl.retrieve_pdb_file('%s' %protein, pdir='/my/directory/path/test_natives', file_format='pdb')
native_pose = pose_from_pdb(native_pdb)

but the retrieve_pdb_file creates .ent files and not pdb files. how do I fix this?

OR how do I load the known PDB structures in order to align them to theo structures and find the rmsd?

m-lane
  • 1
  • (What are *poses*, and what/who is *theo*?)(*R*oot *M*ean *S*quare *D*istance?) – greybeard Jun 21 '21 at 15:58
  • The downloaded structure has the extension `.ent` but it's still in PDB format. You don't have to fix anything, unless PyRosetta gives you errors. – Jan Wilamowski Jun 22 '21 at 03:00
  • https://biopython.org/docs/1.75/api/Bio.PDB.PDBList.html is the relevanr documentation states 'The downloaded file will be called pdb1fat.ent and stored in the current working directory. Note that the retrieve_pdb_file method also has an optional argument pdir that specifies a specific directory in which to store the downloaded PDB files; NOTE. The default download format has changed from PDB to PDBx/mmCif.' . Don't know try add file_format="PDB" and see if it changes it. You can also try : download_pdb_files – pippo1980 Jun 22 '21 at 10:04
  • @greybeard poses hold info about the protein structures, it's an object in PyRosetta. theo = theoretical, meaning the theoretical structures that are produced by the script. and yes rmsd is the root mean square distance – m-lane Jun 22 '21 at 16:21
  • @JanWilamowski I know it's in pdb format but since it's not the .pdb extensions I do get errors because the pose_from_pdb() object only accepts files with .pdb extensions. thank you anyway – m-lane Jun 22 '21 at 16:24
  • @pippo1980 I have file_format='pdb' already and I tried download_pdb_files but it's not as useful and adds more time because the files are downloaded to the local computer. thank you for looking into the documentation though – m-lane Jun 22 '21 at 16:26
  • Don’t have my Linux/python VM with me and not an pyrosetta expart. But I think you should just rename the downloaded file from ent to pdb with os.rename https://stackoverflow.com/questions/2491222/how-to-rename-a-file-using-python – pippo1980 Jun 22 '21 at 22:01

1 Answers1

0

If PyRosetta only accepts files with the .pdb extension, simple renaming should do:

from pathlib import Path

native_pose = Path(native_pose)
native_pose.rename(native_pose.with_suffix('.pdb'))
Jan Wilamowski
  • 3,308
  • 2
  • 10
  • 23
  • Hi @JanWilamowski, thank you for helping me! This was successful in renaming the file but for some reason pose_from_pdb() is unable to open the renamed file. I get this error: RuntimeError: File: /Volumes/MacintoshHD3/benchmark/W.fujii.release/rosetta.Fujii.release/_commits_/main/source/src/core/import_pose/import_pose.cc:362 [ ERROR ] UtilityExitException ERROR: Cannot open file "1IUA.pdb" It must be a pyrosetta issue because the file is definitely there and named properly. Anyway, I appreciate you taking the time to help out! Thanks again – m-lane Jun 25 '21 at 13:23
  • Are you sure you're giving it the correct (renamed) filename? it looks like it doesn't have an absolute path but merely the filename – Jan Wilamowski Jun 28 '21 at 01:40