From: Robert H. <ha...@st...> - 2015-01-30 22:01:58
|
The limitation here is simply that constructs such as chains, "polymers", groups, atoms, and bonds, secondary structure are attributes of a model on an N:1 basis. The basic structure in all Jmol sessions is: ModelSet Model[] Atom[] Bond[] (more arrays of various sorts) Model->Chain[]->Group[]-> (pointers to a subset of atoms, pointer to its chain) BioModel (extends Model) adds: BioPolymer[](a set of linearly covalently connected monomers)->Monomer[] (extends Group) So you can't have chains that cross model boundaries, nor bonds. That's pretty much written in stone. The mutation business is marking a set of atoms for deletion, adding a new set of atoms at the end of the atom array, moving those atoms into position, and then doing some careful patching to get the pointers correct. Officially what we are doing is moving a group to a new Chain within the same model. Jmol is actually running a script to do this. That script looks like something like this: atoms0 = {*} res0 = ({26:32}) set appendNew false load append "==GLY" set appendNew true res1 = {!atoms0};r1 = res1[1];r0 = res1[0] if ({r1 & within(group, r0)}){ // test for only one group haveHs = ({_H and connected(res0)} != 0) if (!haveHs) {delete _H and res1} // bioSMILES-based search for backbone in new structure sm = '[*.N][*.CA][*.C][*.O]' keyatoms = res1.find(sm) // construction of a dihedral difference map x = compare(res1,res0,sm,'BONDS') if(x){ print 'mutating ' + res0[1].label('%n%r') + ' to ' + "==GLY".trim('=') // matching the backbone and moving it into place using the "flex-fit" idea rotate branch @x compare res1 res0 SMARTS @sm rotate translate 0 // patching in the new bonds; deleting the old N2 = {*.N and !res0 && connected(res0)} C0 = {*.C and !res0 && connected(res0)} delete res0 if (N2) { delete *.OXT and res1 connect {N2} {res1 & *.C} } if (C0) { connect {C0} {res1 & *.N} } } } Then the new chain is established. I think I could write a little adapter that "reads" atoms from another model, not from a file. This would allow mixing and matching pieces of models to create a new one, leaving the "libary" of pieces still intact. That certainly could be interesting. Bob |