def setUp(self): self.line = ("ATOM 158 C LEU A 135 -42.160 -11.386 54.208" " 1.00 43.54 C \n") self.web = PDBFile.fetch('4K5Y') self.file_ = PDBFile.from_file('tests/resources/4K5Y.pdb')
def setUp(self): self.pdb = PDBFile.from_file('tests/resources/4K5Y.pdb') self.chain_a = self.pdb.select(chain__eq='A', nres__lt=263)
def setUp(self): self.pdb = PDBFile.from_file('tests/resources/1hpv.pdb') self.lig = self.pdb.ligand() self.prot = self.pdb.protein()
from protutils.pdb import PDBFile # Download 4k5Y.pdb from the RCSB Protein Data Bank pdb = PDBFile.fetch('4K5Y') # Select residues less than 263 on chain A, then chain B chain_a = pdb.select(chain__eq='A', nres__lt=263) chain_b = pdb.select(chain__eq='B', nres__lt=263) # Align selection with another selection that contains the same number of atoms aligned_chain_b = chain_b.align(chain_a) # prints: RMSD = 0.983960869568 # write structures to pdb files chain_a.write_pdb('chain_a.pdb') chain_b.write_pdb('chain_b.pdb') aligned_chain_b.write_pdb('aligned_chain_b.pdb')
from protutils.pdb import PDBFile from protutils.ncbi.blastp import BLASTPDBRecord pdb = PDBFile.fetch('4K5Y') chain_a = pdb.select(chain='A', nres__lt=1000) # Get sequence sequence = chain_a.sequence.replace('-', '') # search for similar sequences to 4K5Y_A query = BLASTPDBRecord(sequence) # Get top hit PDB = query.get_best()['pdb'] similar = PDBFile.fetch(PDB) similar.select(chain='A', nres__lt=1000) # Compare aligned structures aligned = similar.cealign(chain_a) chain_a.write_pdb('4k5y_A.mod.pdb') aligned.write_pdb('{0}_A.mod.pdb'.format(PDB))
from protutils.pdb import PDBFile # write a small helper function def get_residue_list(selected, pdbfile): """Get all residues atoms for a selection """ residues = {atm.nres for atm in selected} return pdbfile.select(nres__isin=residues) pdb = PDBFile.fetch('1HPV') # Select ligand ligand = pdb.ligand() # select protein atoms with 5 Angstroms of the ligand atoms = pdb.protein().within(5.0, ligand) prot = get_residue_list(atoms, pdb) ligand.write_pdb('ligand.pdb') prot.write_pdb('prot.pdb')