From: <sw...@pu...> - 2011-07-18 15:10:10
|
Quoting Dean Johnston <djo...@gm...>: Thanks for this Dean - both scripts work nicely I hadnt tried the extended load {333 777 1} before - starting with it, I can now produce a correct 'molecular view' also. Cheers Simon > > Simon, > > Here's what I've used. It obviously only works for molecular systems and > can be somewhat slow for very large molecules/unit cells. Bob can probably > figure out a more efficient way to do this, but it works for me. In these > examples I've deleted any molecules that I don't want to see - you may want > to just hide/display molecules instead. > > (1) I think this is equivalent to what Bob had suggested before - similar to > Mercury's "include atoms in molecules where *Any* atom fits". > > load xxx.cif {333 777 1}; delete not within(molecule, unitcell); > > > (2) Or (more complicated) - I think this is similar to Mercury's "include > atoms in molecules whose *Centroids* fit". > > load xxx.cif {333 777 1}; > delete not within(molecule, unitcell); > n = getProperty("moleculeInfo").size; > for (var i=1; i<=n; i++) > { > select molecule=i; > if (({selected}.fx < -0.001) || ({selected}.fx > 1.001) || > ({selected}.fy < -0.001) || ({selected}.fy > 1.001) || ({selected}.fz < > -0.001) || ({selected}.fz > 1.001)) > { hide (hidden || {selected}); } > }; > delete hidden; > > Dean > |