Hi All --
Well, I've stumbled over this long enough & I need to ask for help! I have
a case where I want to step through the chains of a selection (many PDB
files have more than one identical protein-ligand complex per
crystallographic asymmetric unit and use the identical atom names and
residue numbering, thereby only differing in chain ID). I would like to use
the "*show chains*" command introduced in 11.5.51, since that returns
exactly what I need, but I admit to not fully understanding how to grab this
output into my scripting environment. I'd love to have an array that I
could loop through (eg "chains[0]", chains[1]", etc). I could jump back
and forth between javascript and JmolScript and accomplish the task with
something like:
function getChainArray() {
var chainString = script("show chains"); //pass result of script into
variable as string
var chains = chainString.split("\n"); //split string on
linefeeds, or \r\n if Windows linefeeds
}
function UseTheSelection(){
var chains = getChainArray();
for (var j=0;j<chains.length;j++){
jmolScriptWait("select {selected} and chains[j]};");
jmolScriptWait("do other stuff");
}
but, I really don't want to have to throw it back and forth. I'm guessing
there *must* be a simple way -- within JmolScript -- to get an array of
chain IDs from the current selection, but I've not come up with it yet.
I've looked at "getProperty chainInfo (atom expression)" but the output
doesn't seem to actually contain the chain ID? From "ChainInfo.txt":
chainInfo=new Array()
chainInfo.models=new Array()
chainInfo.models[0]=new Array()
chainInfo.models[0].chains=new Array()
chainInfo.models[0].chains[0]=new Array()
chainInfo.models[0].chains[0].residues=new Array()
chainInfo.models[0].chains[0].residues[0]=new Array()
chainInfo.models[0].chains[0].residues[0].atomInfo2="[THR]1.CG2 #7"
chainInfo.models[0].chains[0].residues[0].atomInfo1="[THR]1.N #1"
chainInfo.models[0].chains[0].residues[0]._apt2=6
chainInfo.models[0].chains[0].residues[0]._apt1=0
chainInfo.models[0].chains[0].residues[0].groupID=17
chainInfo.models[0].chains[0].residues[0].seqCode="1"
chainInfo.models[0].chains[0].residues[0].visibilityFlags=0
chainInfo.models[0].chains[0].residues[0].groupIndex=0
chainInfo.models[0].chains[0].residues[1]=new Array()
chainInfo.models[0].chains[0].residues[1].atomInfo2="[THR]2.CG2 #14"
chainInfo.models[0].chains[0].residues[1].atomInfo1="[THR]2.N #8"
chainInfo.models[0].chains[0].residues[1]._apt2=13
chainInfo.models[0].chains[0].residues[1]._apt1=7
chainInfo.models[0].chains[0].residues[1].groupID=17
chainInfo.models[0].chains[0].residues[1].seqCode="2"
chainInfo.models[0].chains[0].residues[1].visibilityFlags=0
chainInfo.models[0].chains[0].residues[1].groupIndex=1
et cetera.
What am I missing? I suspect I've been staring at the solution and just not
seeing it....
Thanks,
Tom
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users