예제 #1
0
    def setAtomsDictionary(self, atoms=None, pdbfile=None):
        """ 
        set reference to the atoms dictionary
        atoms = dictionary with atom objects to make the protein from, i.e. atoms[chainID][resName]
        """ 
        if   atoms != None:
          self.atoms = atoms
        elif pdbfile != None:
          self.atoms = pdb.readPDB(filename=pdbfile)
        else:
          pka_print("need either an atoms dictionary or pdbfile to create a protein")
          sys.exit(9)

        return
예제 #2
0
    def setAtomsDictionary(self, atoms=None, pdbfile=None):
        """ 
        set reference to the atoms dictionary
        atoms = dictionary with atom objects to make the protein from, i.e. atoms[chainID][resName]
        """
        if atoms != None:
            self.atoms = atoms
        elif pdbfile != None:
            self.atoms = pdb.readPDB(filename=pdbfile)
        else:
            pka_print(
                "need either an atoms dictionary or pdbfile to create a protein"
            )
            sys.exit(9)

        return
예제 #3
0
        print('Created ligand residue %s with %2d atoms'%(self, len(self.atoms)))

        return

    def __str__(self):
        return '%s-%4d'%(self.resName,self.resNumb)


if __name__ == '__main__':
    if len(sys.argv)<2:
        sys.exit(0)

    protonator = protonate.Protonate()

    print(sys.argv[1])
    atoms = pdb.readPDB(sys.argv[1],tags=["ATOM","HETATM"])
    
    my_ligand = ligand(atoms)
    
    

    #assign sybyl names
    protonator.remove_all_hydrogen_atoms_from_ligand(my_ligand)
    my_ligand.assign_atom_names()

    my_ligand.writePDB('before_ligand_protonation.pdb')

    #convert to propka input names
#    for atom in my_ligand.atoms:
#        temp = atom.name
#        temp = temp.replace('.','')
예제 #4
0

if __name__ == '__main__':
    # If called directly, set up protein bond dictionary
    import protein, pdb, sys,os
    arguments = sys.argv
    if len(arguments) != 2:
        pka_print('Usage: bonds.py <pdb_file>')
        sys.exit(0)

    filename = arguments[1]
    if not os.path.isfile(filename):
        pka_print('Error: Could not find \"%s\"'%filename)
        sys.exit(1)
   
    pdblist = pdb.readPDB(filename)
    my_protein = protein.Protein(pdblist,'test.pdb')
    
    for chain in my_protein.chains:
        for residue in chain.residues:
            residue.atoms = [atom for atom in residue.atoms if atom.get_element() != 'H']

    b = bondmaker()
    #b.protein_bonds = {}
    atoms = b.find_bonds_for_protein_by_distance(my_protein)
    #    b.generate_protein_bond_dictionary(atoms)

    #file = open(b.data_file_name,'wb')
    #pickle.dump(b.protein_bonds, file)
    #file.close()
예제 #5
0
                  (self, len(self.atoms)))

        return

    def __str__(self):
        return '%s-%4d' % (self.resName, self.resNumb)


if __name__ == '__main__':
    if len(sys.argv) < 2:
        sys.exit(0)

    protonator = protonate.Protonate()

    pka_print(sys.argv[1])
    atoms = pdb.readPDB(sys.argv[1], tags=["ATOM", "HETATM"])

    my_ligand = ligand(atoms)

    #assign sybyl names
    protonator.remove_all_hydrogen_atoms_from_ligand(my_ligand)
    my_ligand.assign_atom_names()

    my_ligand.writePDB('before_ligand_protonation.pdb')

    #convert to propka input names
    #    for atom in my_ligand.atoms:
    #        temp = atom.name
    #        temp = temp.replace('.','')
    #        if len(temp)>3:
    #            temp = temp[0:3]