| Quick navigation: | Home | Site Map || References | Biography || Copyright | Other copyright | Contact us | Advert | | |
Re: [ccp4bb] largest distance between atoms |
||
- Protein crystallographyMain steps:- Protein purification- Crystallisation Special:- Programs for crystallography- X-ray detectors Basic tutorials:- Chemistry- Protein - Peptide - Amino Acids Xtal community:- CCP4BB |
CCP4bb navigationCCP4bb <-- 1999 <-- November 1999 <-- 30 November 1999Subject: Re: largest distance between atoms From: Warren DeLano warren {- at -} DELSCI {- dot -} COM Date: 2009-04-20 Andreas, In PyMOL: print cmd.get_extent(selection) where selection is the name of the molecule you'd loaded. Note that the set of coordinates which define an XYZ extent do not necessarily correspond to only to atoms. To find the two atoms most distant from one another, you could iterate over all pairs of coordinates. This is possible in PyMOL as shown below, but is impractically slow for large structures due to the N^2 dependence. # PyMOL Script: longest_diagonal.pml # takes 5-10 seconds with a 1,600 atom structure # (1) extract all coordinates into a temporary array "xrd" xrd = [] iterate_state 1, all, xrd.append( ((x,y,z), model+"`"+str(index)) ) python from chempy import cpv xrd_len = len(xrd) # (2) measure all diagonals and keep the longest diag = (-1.0,"none","none") for i in range(xrd_len): for j in range(i+1,xrd_len): dst = cpv.distance(xrd[i][0], xrd[j][0]) if dst > diag [0]: diag = (dst, xrd[i][1], xrd[j][1]) # (3) draw the longest diagonal cmd.distance("diag", diag[1], diag[2]) python end Cheers, Warren > -----Original Message----- > From: CCP4 bulletin board [mailto:CCP4BB@JISCMAIL.AC.UK] On Behalf Of > Andreas Förster > Sent: Monday, April 20, 2009 10:25 AM > To: CCP4BB@JISCMAIL.AC.UK > Subject: [ccp4bb] largest distance between atoms > > Hey all, > > is there a script out there that computes the longest extent of a > molecule and determines which atoms define the 'space diagonal'. In > other words, I'm looking for the two atoms in a molecule that are most > distant from each other. > > Thanks. > > > Andreas > > > -- > Andreas Förster, Research Associate > Paul Freemont & Xiaodong Zhang Labs > Department of Biochemistry, Imperial College London > http://www.msf.bio.ic.ac.uk > > > CCP4bb navigationCCP4bb <-- 1999 <-- November 1999 <-- 30 November 1999 |
|
| ProteinCrystallography.org: Copyright 2006-2010 by Quid United Ltd |