Git Product home page Git Product logo

Comments (3)

RishalAggarwal avatar RishalAggarwal commented on July 21, 2024
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))
  1. You can get "holo4k.txt" from here: https://github.com/rdk/p2rank-datasets/blob/master/holo4k(mlig).ds
  2. We remove all the ligands in the file (they are referred to as hetero atoms in the pdb file)
  3. It is run on pdb file without ligands

from deeppocket.

hi7049 avatar hi7049 commented on July 21, 2024

Thank you for your reply and codes. I understand it now.

from deeppocket.

mainguyenanhvu avatar mainguyenanhvu commented on July 21, 2024

@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:

  1. If I want to add several pdb files to the available scPDB dataset, how can I complete it?
  2. The instruction for preparing data only works for a single pdb file, does it? If not, I need to write a pipeline to wrap up it.
  3. How to prepare train.txt and test.txt files to run make_types.py?
  4. Could you please show me which file/folder needed inputting from previous to each step?

I am tried on this pdb.

Thank you very much.

from deeppocket.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.