Bug in Jmol 11.1.38 found and fixed: PDB files load but do not populate 
popup menu select submenu with group lists.

[users who are not developers need not read further]

Amy, I'd checked carefully against 10.2, and in fact you found the one 
and only one method that was removed from JmolViewer. The reason it was 
removed is coming back to me now. What this method did was return a 
BitSet indicating the groups that are present in a model set. There is 
an internal "predefined" list of groups that this would be referring to, 
plus a set of additional groups that are added on the fly as a model is 
read. In going to a multifile/multimodel format I abandoned this method 
as "unusable" for the following reasons:

(1) It was exposing pointers to a core Jmol list that was not itself 
exposed and was not protected against people like me rearranging it.
(2) In a multimodel/multiframe environment it wasn't clear how this 
could be of any utility.
(3) It didn't really give enough information to be _generally_ useful.

So there are two possibilities, which I think you can decide for me:

1) I add back this rudamentary method, for you. (Which I'd be happy to 
do if that's important...)
2) I add a note to this effect in JmolViewer.java and explain how to get 
around it. That would look something like this:

/*
Jmol 11 greatly expands the capability for a program utilizing the 
JmolViewer interface to determine information relating to any model 
loaded. This information is maintained in the Hashtable returned by 
getModelSetAuxiliaryInfo() for the overall set of models and 
getModelSetAuxiliaryInfo(int modelIndex) for an individual model.

In the case of group information such as is used in the Jmol popup menu 
to identify and count the PDB groups present in a model, the two 
Hashtable elements of interest are String[] group3Lists and int[][] 
group3Counts. To access these for a JmolViewer viewer, use:

    JmolViewer viewer;
   ...
    modelSetInfo = viewer.getModelSetAuxiliaryInfo();
    int[][] counts = (int[][]) modelSetInfo.get("group3Counts");
    String[] lists = (String[]) modelSetInfo.get("group3Lists");

These two lists (which may be null) can then be used to determine the 
full set of groups present in each model in the model set, including how 
many of each group is present in each case.
counts[0] counts the groups for the first model, counts[1] counts the 
groups for the second model, etc. In addition, 
counts[viewer.getModelCount()] counts the groups for all models and 
lists[viewer.getModelCount()] lists those groups.

lists[modelIndex] is a coded string of 3-letter group codes ininitially 
in the following format (line returns added only for this presentation):

,[ALA],[ARG],[ASN],[ASP],[CYS],[GLN],[GLU],[GLY],[HIS]
,[ILE],[LEU],[LYS],[MET],[PHE],[PRO],[SER],[THR],[TRP]
,[TYR],[VAL],[ASX],[GLX],[UNK]
,[G  ],[C  ],[A  ],[T  ],[I  ],[U  ],[+G ],[+C ],[+A ],[+T ],[+I ],[+U ]
,[AFL],[AGC],[AHR],[ARA],[ARB],[BDF],[BDR],[BGC],[BMA]
,[FCA],[FCB],[FRU],[FUC],[FUL],[GAL],[GLA],[GLB],[GLC]
,[GUP],[LXC],[MAN],[RAA],[RAM],[RIB],[RIP],[XYP],[XYS]
,[CBI],[CT3],[CTR],[CTT],[LAT],[MAB],[MAL],[MLR],[MTT]
,[SUC],[TRE],[ASF],[GCU],[MTL],[NAG],[NAM],[RHA],[SOR],[XYL]

This list includes all amino acids, nucleic acids, and carbohydrates 
Jmol by default identifies. JmolConstants.java identifies the number of 
amino acids on this list as:

  public final static short GROUPID_AMINO_MAX = 23;

and the number of amino acids + nucleic acids as:

  public final static short GROUPID_SHAPELY_MAX = 36;

In this way, one can know if any given group is an amino acid (id <23), 
a nucleic acid (id >= 23 and id < 36), or a carbohydrate (id >= 36).

If additional groups are present, they are appended to this list as they 
are identified in the file loading process, and that process 
automatically identifies the group as to its type (see below).

In this string, each group is allocated 6 characters, starting with a 
comma and ending with a right bracket. If a group is NOT present, it 
appears as above.

If a group IS present, then the comma is changed to a character that 
indicates what kind of group this is (p protein, n nucleic acid, c 
carbohydrate, o other), and the left bracket is changed to a 
greater-than sign. For example, for 1blu we have:

p>ALA]p>ARG]p>ASN]p>ASP]p>CYS]p>GLN]p>GLU]p>GLY]p>HIS]
p>ILE]p>LEU]p>LYS]p>MET],[PHE]p>PRO]p>SER]p>THR],[TRP]
p>TYR]p>VAL],[ASX],[GLX],[UNK]
,[G  ],[C  ],[A  ],[T  ],[I  ],[U  ],[+G ],[+C ],[+A ],[+T ],[+I ],[+U ]
,[AFL],[AGC],[AHR],[ARA],[ARB],[BDF],[BDR],[BGC],[BMA],
[FCA],[FCB],[FRU],[FUC],[FUL],[GAL],[GLA],[GLB],[GLC],
[GUP],[LXC],[MAN],[RAA],[RAM],[RIB],[RIP],[XYP],[XYS]
,[CBI],[CT3],[CTR],[CTT],[LAT],[MAB],[MAL],[MLR],[MTT]
,[SUC],[TRE],[ASF],[GCU],[MTL],[NAG],[NAM],[RHA],[SOR],[XYL]
o>FS4]o>HOH]

*/

Bob







    group3List = (lists == null ? null : lists[n]);
    group3Counts = (lists == null ? null : ((int[][]) 
modelSetInfo.get("group3Counts"))[n]);





Amy Wilson wrote:

>Hi there, just upgrading from version 10 to version 11 and I notice that
>JmolViewer.getGroupsPresentBitSet() is gone.  The commit it's deleted in
>(5956) describes it as "unnecessary", so I'm hoping there's some other way
>to get the same information.  Can anyone help me out?
>
>Thanks,
>Amy
>
>
>-------------------------------------------------------------------------
>This SF.net email is sponsored by DB2 Express
>Download DB2 Express C - the FREE version of DB2 express and take
>control of your XML. No limits. Just data. Click to get it now.
>http://sourceforge.net/powerbar/db2/
>_______________________________________________
>Jmol-users mailing list
>[EMAIL PROTECTED]
>https://lists.sourceforge.net/lists/listinfo/jmol-users
>  
>


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to