Example: superposition # Load two HEM-containing proteins from the PDB website # into EntityHandles. prot_one=io.LoadPDB('1mbo', remote=True) prot_two=io.LoadPDB('1mbn', remote=True) # Superpose the proteins based on the HEM ligands mol.alg.Superpose(prot_one.Select('rname=HEM'), prot_two.Select('rname=HEM')) # Superpose based on HEM-binding residues using the within (<>) # operator mol.alg.Superpose(prot_one.Select('rname!=HEM and 3.0 <> [rname=HEM]', mol.MATCH_RESIDUES), prot_two.Select('rname!=HEM and 3.0 <> [rname=HEM]', mol.MATCH_RESIDUES)) Example: ligand binding-site annotation # load the two structures structure_wi_lig = io.LoadPDB('data/structure-with-ligand.pdb') structure_no_lig = io.LoadPDB('data/structure-without-ligand.pdb') # set a generic property for all residues of the first structure in # contact with RVP for res in structure_wi_lig.Select('4.0 <> [rname=RVP]').residues: res.SetBoolProp('close_to_ligand', True) # get the sequence for both structures ligand_seq = seq.SequenceFromChain('ligand', structure_wi_lig.chains[0]) no_lig_seq = seq.SequenceFromChain('no lig', structure_no_lig.chains[0]) # align the two sequences using a global alignment algorithm with the # BLOSUM62 substitution matrix and default gap extension and opening # penalties. Global align returns a list of global alignments, but we # only use the first one... aln = seq.alg.GlobalAlign(ligand_seq, no_lig_seq, seq.alg.BLOSUM62)[0] # print the alignment, to check that the alignment is reasonable print aln # the alignment essentially defines a mapping of residues in the first # and the second structure. We will use GetMatchingBackboneViews to # obtain two entity views which contain the corresponding residues aln_wi_lig, aln_no_lig = aln.GetMatchingBackboneViews() # iterate over the residue pairs and print residue names of residues # which are part of the "predicted" binding site print 'predicted binding site' for lig_res, no_lig_res in zip(aln_wi_lig.residues, aln_no_lig.residues): if lig_res.HasProp('close_to_ligand'): print no_lig_res Example: correlating backbone fragments with local electron density # convert the candidate loop into a density and calculate the real-spatial # cross correlation with the actual density. The correlation # coefficient is stored as the generic property "correl". # which could be later used to colour the loops for index, candidate in enumerate(candidates): EntityToDensityRosetta(candidate.CreateFullView(), cmap, HIGH_RESOLUTION, 5.0, True) correl=img_alg.RealSpatialCrossCorrelation(dmap, cmap, dmap.GetExtent()) candidate.SetFloatProp('correl', correl)