Closed hi7049 closed 2 years ago
import os
from Bio.PDB import PDBParser, PDBIO, Select, Polypeptide
f=open('holo4k.txt','r')
dir='/scratch/rishal/pbsp/data/'
parser = PDBParser()
class LigSelect(Select):
def __init__(self,ligand):
self.ligand=ligand
def accept_residue(self, residue):
if residue.get_resname() == ligand and not Polypeptide.is_aa(residue,standard=True):
return 1
else:
return 0
for line in f:
ligand_num=-1
if not os.path.exists(os.path.join(dir,line.split()[0].split('.pdb')[0].replace('holo4k','holo4k/Dataset'))):
print(line)
continue
for ligand in line.split()[1].split(','):
ligand_num+=1
structure = parser.get_structure("protein", os.path.join(dir,line.split()[0]))
io = PDBIO()
io.set_structure(structure)
io.save(os.path.join(dir,line.split()[0].split('.pdb')[0].replace('holo4k','holo4k/Dataset'),'ligand_new'+str(ligand_num)+'.pdb'),LigSelect(ligand))
Thank you for your reply and codes. I understand it now.
@hi7049 have you re-run data preparation for a custom data? If yes, please help me.
I am trying to use the instruction to prepare data for training a new classifier. I have stuck in make_types step because I can't find train.txt and test.txt files.
Moreover, I have 4 questions:
I am tried on this pdb.
Thank you very much.
Hi, I have some questions about data preparation.
In your paper, you mentioned that "The proteins and ligands were separated from the corresponding structure files using the Biopython library". But I can't find corresponding codes in this repo, could you share those parts of codes?
A pdb file in HOLO4K may have several ligands, do you remain all ligands or remove some? What are the criteria to choose ligands in a pdb file?
When you use Fpocket to choose pocket candidates, do you run Fpocket on the original pdb file, pdb file without ligands, or a single chain in pdb file?