Clover icon

Coverage Report

  1. Project Clover database Thu Mar 26 2026 08:01:43 GMT
  2. Package jalview.ext.jmol

File JmolParser.java

 

Coverage histogram

../../../img/srcFileCovDistChart7.png
30% of files have more coverage

Code metrics

90
257
38
1
812
607
119
0.46
6.76
38
3.13

Classes

Class Line # Actions
JmolParser 69 257 119
0.6597402766%
 

Contributing tests

This file is covered by 63 tests. .

Source view

1    /*
2    * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3    * Copyright (C) $$Year-Rel$$ The Jalview Authors
4    *
5    * This file is part of Jalview.
6    *
7    * Jalview is free software: you can redistribute it and/or
8    * modify it under the terms of the GNU General Public License
9    * as published by the Free Software Foundation, either version 3
10    * of the License, or (at your option) any later version.
11    *
12    * Jalview is distributed in the hope that it will be useful, but
13    * WITHOUT ANY WARRANTY; without even the implied warranty
14    * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15    * PURPOSE. See the GNU General Public License for more details.
16    *
17    * You should have received a copy of the GNU General Public License
18    * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19    * The Jalview Authors are detailed in the 'AUTHORS' file.
20    */
21    package jalview.ext.jmol;
22   
23    import java.io.File;
24    import java.io.IOException;
25    import java.util.ArrayList;
26    import java.util.HashMap;
27    import java.util.List;
28    import java.util.Locale;
29    import java.util.Map;
30    import java.util.Vector;
31   
32    import org.jmol.api.JmolStatusListener;
33    import org.jmol.api.JmolViewer;
34    import org.jmol.c.CBK;
35    import org.jmol.c.STR;
36    import org.jmol.modelset.ModelSet;
37    import org.jmol.viewer.Viewer;
38   
39    import com.stevesoft.pat.Regex;
40   
41    import jalview.bin.Console;
42    import jalview.datamodel.Alignment;
43    import jalview.datamodel.AlignmentAnnotation;
44    import jalview.datamodel.Annotation;
45    import jalview.datamodel.PDBEntry;
46    import jalview.datamodel.SequenceI;
47    import jalview.datamodel.annotations.AlphaFoldAnnotationRowBuilder;
48    import jalview.datamodel.annotations.AnnotationRowBuilder;
49    import jalview.datamodel.annotations.QMEANDISCORowBuilder;
50    import jalview.io.DataSourceType;
51    import jalview.io.FileParse;
52    import jalview.io.StructureFile;
53    import jalview.schemes.ResidueProperties;
54    import jalview.structure.StructureImportSettings;
55    import jalview.util.Constants;
56    import jalview.util.Format;
57    import jalview.util.MessageManager;
58    import jalview.ws.dbsources.EBIAlfaFold;
59    import mc_view.Atom;
60    import mc_view.PDBChain;
61    import mc_view.Residue;
62   
63    /**
64    * Import and process files with Jmol for file like PDB, mmCIF
65    *
66    * @author jprocter
67    *
68    */
 
69    public class JmolParser extends StructureFile implements JmolStatusListener
70    {
71    Viewer viewer = null;
72   
 
73  218 toggle public JmolParser(boolean immediate, Object inFile,
74    DataSourceType sourceType) throws IOException
75    {
76    // BH 2018 File or String for filename
77  218 super(immediate, inFile, sourceType);
78   
79    }
80   
 
81  6 toggle public JmolParser(Object inFile, DataSourceType sourceType)
82    throws IOException
83    {
84  6 this(inFile, sourceType, null);
85    }
86   
 
87  21 toggle public JmolParser(Object inFile, DataSourceType sourceType,
88    StructureImportSettings.TFType tempfacType) throws IOException
89    {
90  21 super(inFile, sourceType, tempfacType);
91    }
92   
 
93  5 toggle public JmolParser(FileParse fp, boolean doXferSettings) throws IOException
94    {
95  5 super(fp, doXferSettings);
96    }
97   
 
98  0 toggle public JmolParser(FileParse fp) throws IOException
99    {
100  0 super(fp);
101    }
102   
 
103  1 toggle public JmolParser()
104    {
105    }
106   
107    /**
108    * Calls the Jmol library to parse the PDB/mmCIF file, and then inspects the
109    * resulting object model to generate Jalview-style sequences, with secondary
110    * structure annotation added where available (i.e. where it has been computed
111    * by Jmol using DSSP).
112    *
113    * @see jalview.io.AlignFile#parse()
114    */
 
115  0 toggle @Override
116    public void parse() throws IOException
117    {
118  0 parse(true);
119    }
120   
 
121  244 toggle @Override
122    public void parse(boolean doXferSettings) throws IOException
123    {
124  244 setChains(new Vector<PDBChain>());
125  244 Viewer jmolModel = getJmolData();
126  244 jmolModel.openReader(getDataName(), getDataName(), getReader());
127  244 waitForScript(jmolModel);
128   
129    /*
130    * Convert one or more Jmol Model objects to Jalview sequences
131    */
132  244 if (jmolModel.ms.mc > 0)
133    {
134    // ideally we do this
135    // try
136    // {
137    // setStructureFileType(jmolModel.evalString("show _fileType"));
138    // } catch (Exception q)
139    // {
140    // }
141    // ;
142    // instead, we distinguish .cif from non-.cif by filename
143  244 setStructureFileType(
144  244 getDataName().toLowerCase(Locale.ROOT).endsWith(".cif")
145    ? PDBEntry.Type.MMCIF.toString()
146    : "PDB");
147   
148  244 transformJmolModelToJalview(jmolModel.ms, doXferSettings);
149    }
150    }
151   
152    /**
153    * create a headless jmol instance for dataprocessing
154    *
155    * @return
156    */
 
157  244 toggle private Viewer getJmolData()
158    {
159  244 if (viewer == null)
160    {
161  244 try
162    {
163    /*
164    * params -o (output to sysout) -n (nodisplay) -x (exit when finished)
165    * see http://wiki.jmol.org/index.php/Jmol_Application
166    */
167   
168  244 viewer = JalviewJmolBinding.getJmolData(this);
169    // ensure the 'new' (DSSP) not 'old' (Ramachandran) SS method is used
170  244 viewer.setBooleanProperty("defaultStructureDSSP", true);
171    } catch (ClassCastException x)
172    {
173  0 throw new Error(MessageManager.formatMessage(
174    "error.jmol_version_not_compatible_with_jalview_version",
175    new String[]
176    { JmolViewer.getJmolVersion() }), x);
177    }
178    }
179  244 return viewer;
180    }
181   
 
182  244 toggle public static Regex getNewAlphafoldValidator()
183    {
184  244 return new EBIAlfaFold().getAccessionValidator();
185    }
186   
187    PDBEntry.Type jmolFiletype = null;
188   
189    /**
190    * resolve a jmol filetype string and update the jmolFiletype field
191    * accordingly
192    *
193    * @param jmolIdentifiedFileType
194    * @return true if filetype was identified as MMCIF, PDB
195    */
 
196  244 toggle public boolean updateFileType(String jmolIdentifiedFileType)
197    {
198  244 if (jmolIdentifiedFileType == null
199    || jmolIdentifiedFileType.trim().equals(""))
200    {
201  0 return false;
202    }
203  244 if ("mmcif".equalsIgnoreCase(jmolIdentifiedFileType))
204    {
205  56 jmolFiletype = PDBEntry.Type.MMCIF;
206  56 return true;
207    }
208  188 if ("pdb".equalsIgnoreCase(jmolIdentifiedFileType))
209    {
210  188 jmolFiletype = PDBEntry.Type.PDB;
211  188 return true;
212    }
213  0 return false;
214    }
215   
 
216  244 toggle public void transformJmolModelToJalview(ModelSet ms,
217    boolean localDoXferSettings) throws IOException
218    {
219  244 try
220    {
221  244 Regex alphaFold = getNewAlphafoldValidator();
222  244 String lastID = "";
223  244 List<SequenceI> rna = new ArrayList<SequenceI>();
224  244 List<SequenceI> prot = new ArrayList<SequenceI>();
225  244 PDBChain tmpchain;
226  244 String pdbId = (String) ms.getInfo(0, "title");
227  244 boolean isMMCIF = false;
228  244 String jmolFileType_String = (String) ms.getInfo(0, "fileType");
229  244 if (updateFileType(jmolFileType_String))
230    {
231  244 setStructureFileType(jmolFiletype.toString());
232    }
233   
234  244 isMMCIF = PDBEntry.Type.MMCIF.equals(jmolFiletype);
235   
236  244 if (pdbId == null)
237    {
238  91 setId(safeName(getDataName()));
239  91 setPDBIdAvailable(false);
240    }
241    else
242    {
243  153 setId(pdbId);
244  153 setPDBIdAvailable(true);
245  153 setAlphafoldModel(alphaFold.search(pdbId) && isMMCIF);
246    }
247  244 List<Atom> significantAtoms = convertSignificantAtoms(ms);
248  244 for (Atom tmpatom : significantAtoms)
249    {
250  48838 if (tmpatom.resNumIns.trim().equals(lastID))
251    {
252    // phosphorylated protein - seen both CA and P..
253  1 continue;
254    }
255  48837 tmpchain = findChain(tmpatom.chain);
256  48837 if (tmpchain != null)
257    {
258  48501 tmpchain.atoms.addElement(tmpatom);
259    }
260    else
261    {
262  336 AnnotationRowBuilder builder = null;
263  336 if (isAlphafoldModel()
264    || getTemperatureFactorType() == StructureImportSettings.TFType.PLDDT)
265    {
266  79 builder = new AlphaFoldAnnotationRowBuilder();
267    }
268  336 if (getTemperatureFactorType() == StructureImportSettings.TFType.QMEANDISCO)
269    {
270  0 builder = new QMEANDISCORowBuilder();
271    }
272   
273  336 tmpchain = new PDBChain(getId(), tmpatom.chain, builder);
274  336 getChains().add(tmpchain);
275  336 tmpchain.atoms.addElement(tmpatom);
276    }
277  48837 lastID = tmpatom.resNumIns.trim();
278    }
279  244 if (isParseImmediately() && localDoXferSettings)
280    {
281    // configure parsing settings from the static singleton
282  155 xferSettings();
283    }
284   
285  244 makeResidueList();
286  244 makeCaBondList();
287   
288  244 for (PDBChain chain : getChains())
289    {
290  336 SequenceI chainseq = postProcessChain(chain);
291  336 if (isRNA(chainseq))
292    {
293  0 rna.add(chainseq);
294    }
295    else
296    {
297  336 prot.add(chainseq);
298    }
299   
300    // look at local setting for adding secondary tructure
301  336 if (predictSecondaryStructure)
302    {
303  269 createAnnotation(chainseq, chain, ms.at);
304    }
305    }
306    // if Alphafold, fetch the PAE matrix if doesn't already have one
307  244 if (isAlphafoldModel() && !hasPAEMatrix())
308    {
309  32 try
310    {
311  32 Console.info("Retrieving PAE for " + pdbId);
312  32 File paeFile = EBIAlfaFold.fetchAlphaFoldPAE(pdbId, null);
313  32 this.setPAEMatrix(paeFile.getAbsolutePath());
314    } catch (Throwable t)
315    {
316  0 Console.error("Couldn't get the pAE for " + pdbId, t);
317    }
318    }
319    // add a PAEMatrix if set (either by above or otherwise)
320  244 if (hasPAEMatrix())
321    {
322  95 try
323    {
324  95 Alignment al = new Alignment(prot.toArray(new SequenceI[0]));
325  95 EBIAlfaFold.addAlphaFoldPAE(al, new File(this.getPAEMatrix()), 0,
326    null, false, false, null);
327   
328  95 if (al.getAlignmentAnnotation() != null)
329    {
330  95 for (AlignmentAnnotation alann : al.getAlignmentAnnotation())
331    {
332  95 annotations.add(alann);
333    }
334    }
335    } catch (Throwable ff)
336    {
337  0 Console.error("Couldn't import PAE Matrix from " + getPAEMatrix(),
338    ff);
339  0 warningMessage += "Couldn't import PAE Matrix"
340    + getNewlineString() + ff.getLocalizedMessage()
341    + getNewlineString();
342    }
343    }
344    } catch (OutOfMemoryError er)
345    {
346  0 jalview.bin.Console.outPrintln(
347    "OUT OF MEMORY LOADING TRANSFORMING JMOL MODEL TO JALVIEW MODEL");
348  0 throw new IOException(MessageManager
349    .getString("exception.outofmemory_loading_mmcif_file"));
350    }
351    }
352   
 
353  244 toggle private List<Atom> convertSignificantAtoms(ModelSet ms)
354    {
355  244 List<Atom> significantAtoms = new ArrayList<Atom>();
356  244 HashMap<String, org.jmol.modelset.Atom> chainTerMap = new HashMap<String, org.jmol.modelset.Atom>();
357  244 org.jmol.modelset.Atom prevAtom = null;
358  244 for (org.jmol.modelset.Atom atom : ms.at)
359    {
360  269639 if (atom.getAtomName().equalsIgnoreCase("CA")
361    || atom.getAtomName().equalsIgnoreCase("P"))
362    {
363  48866 if (!atomValidated(atom, prevAtom, chainTerMap))
364    {
365  24 continue;
366    }
367  48842 Atom curAtom = new Atom(atom.x, atom.y, atom.z);
368  48842 curAtom.atomIndex = atom.getIndex();
369  48842 curAtom.chain = atom.getChainIDStr();
370  48842 curAtom.insCode = atom.group.getInsertionCode() == '\000' ? ' '
371    : atom.group.getInsertionCode();
372  48842 curAtom.name = atom.getAtomName();
373  48842 curAtom.number = atom.getAtomNumber();
374  48842 curAtom.resName = atom.getGroup3(true);
375  48842 curAtom.resNumber = atom.getResno();
376  48842 curAtom.occupancy = ms.occupancies != null
377    ? ms.occupancies[atom.getIndex()]
378    : Float.valueOf(atom.getOccupancy100());
379  48842 String fmt = new Format("%4i").form(curAtom.resNumber);
380  48842 curAtom.resNumIns = (fmt + curAtom.insCode);
381  48842 curAtom.tfactor = atom.getBfactor100() / 100f;
382  48842 curAtom.type = 0;
383    // significantAtoms.add(curAtom);
384    // ignore atoms from subsequent models
385  48842 if (!significantAtoms.contains(curAtom))
386    {
387  48838 significantAtoms.add(curAtom);
388    }
389  48842 prevAtom = atom;
390    }
391    }
392  244 return significantAtoms;
393    }
394   
 
395  48866 toggle private boolean atomValidated(org.jmol.modelset.Atom curAtom,
396    org.jmol.modelset.Atom prevAtom,
397    HashMap<String, org.jmol.modelset.Atom> chainTerMap)
398    {
399    // jalview.bin.Console.outPrintln("Atom: " + curAtom.getAtomNumber()
400    // + " Last atom index " + curAtom.group.lastAtomIndex);
401  48866 if (chainTerMap == null || prevAtom == null)
402    {
403  244 return true;
404    }
405  48622 String curAtomChId = curAtom.getChainIDStr();
406  48622 String prevAtomChId = prevAtom.getChainIDStr();
407    // new chain encoutered
408  48622 if (!prevAtomChId.equals(curAtomChId))
409    {
410    // On chain switch add previous chain termination to xTerMap if not exists
411  116 if (!chainTerMap.containsKey(prevAtomChId))
412    {
413  104 chainTerMap.put(prevAtomChId, prevAtom);
414    }
415    // if current atom belongs to an already terminated chain and the resNum
416    // diff < 5 then mark as valid and update termination Atom
417  116 if (chainTerMap.containsKey(curAtomChId))
418    {
419  24 if (curAtom.getResno() < chainTerMap.get(curAtomChId).getResno())
420    {
421  0 return false;
422    }
423  24 if ((curAtom.getResno()
424    - chainTerMap.get(curAtomChId).getResno()) < 5)
425    {
426  0 chainTerMap.put(curAtomChId, curAtom);
427  0 return true;
428    }
429  24 return false;
430    }
431    }
432    // atom with previously terminated chain encountered
433  48506 else if (chainTerMap.containsKey(curAtomChId))
434    {
435  0 if (curAtom.getResno() < chainTerMap.get(curAtomChId).getResno())
436    {
437  0 return false;
438    }
439  0 if ((curAtom.getResno()
440    - chainTerMap.get(curAtomChId).getResno()) < 5)
441    {
442  0 chainTerMap.put(curAtomChId, curAtom);
443  0 return true;
444    }
445  0 return false;
446    }
447    // HETATM with resNum jump > 2
448  48598 return !(curAtom.isHetero()
449    && ((curAtom.getResno() - prevAtom.getResno()) > 2));
450    }
451   
 
452  269 toggle private void createAnnotation(SequenceI sequence, PDBChain chain,
453    org.jmol.modelset.Atom[] jmolAtoms)
454    {
455  269 char[] secstr = new char[sequence.getLength()];
456  269 char[] secstrcode = new char[sequence.getLength()];
457   
458    // Ensure Residue size equals Seq size
459  269 if (chain.residues.size() != sequence.getLength())
460    {
461  0 return;
462    }
463  269 int annotIndex = 0;
464  269 for (Residue residue : chain.residues)
465    {
466  41382 Atom repAtom = residue.getAtoms().get(0);
467  41382 STR proteinStructureSubType = jmolAtoms[repAtom.atomIndex].group
468    .getProteinStructureSubType();
469  41382 setSecondaryStructure(proteinStructureSubType, annotIndex, secstr,
470    secstrcode);
471  41382 ++annotIndex;
472    }
473  269 addSecondaryStructureAnnotation(chain.pdbid, sequence, secstr,
474    secstrcode, chain.id, sequence.getStart());
475    }
476   
477    /**
478    * Helper method that adds an AlignmentAnnotation for secondary structure to
479    * the sequence, provided at least one secondary structure assignment has been
480    * made
481    *
482    * @param modelTitle
483    * @param seq
484    * @param secstr
485    * @param secstrcode
486    * @param chainId
487    * @param firstResNum
488    * @return
489    */
 
490  269 toggle protected void addSecondaryStructureAnnotation(String modelTitle,
491    SequenceI sq, char[] secstr, char[] secstrcode, String chainId,
492    int firstResNum)
493    {
494  269 int length = sq.getLength();
495  269 boolean ssFound = false;
496  269 Annotation asecstr[] = new Annotation[length
497    + (firstResNum - sq.getStart())];
498  41651 for (int p = 0; p < length; p++)
499    {
500  41382 if (secstr[p] >= 'A' && secstr[p] <= 'z')
501    {
502  16229 try
503    {
504  16229 asecstr[p] = new Annotation(null, null, secstrcode[p], Float.NaN);
505  16229 ssFound = true;
506    } catch (Exception e)
507    {
508    // e.printStackTrace();
509    }
510    }
511    }
512   
513  269 if (ssFound)
514    {
515  247 String mt = modelTitle == null ? getDataName() : modelTitle;
516  247 mt += chainId;
517  247 AlignmentAnnotation ann = new AlignmentAnnotation(
518    "Secondary Structure", "Secondary Structure for " + mt,
519    asecstr);
520  247 ann.belowAlignment = true;
521  247 ann.visible = true;
522  247 ann.autoCalculated = false;
523  247 ann.setCalcId(getClass().getName());
524  247 ann.adjustForAlignment();
525  247 ann.validateRangeAndDisplay();
526   
527  247 if (modelTitle != null)
528    {
529  247 ann.setProperty(Constants.PDBID, modelTitle);
530    }
531   
532  247 if (chainId != null)
533    {
534  247 ann.setProperty(Constants.CHAINID, chainId);
535    }
536  247 annotations.add(ann);
537  247 sq.addAlignmentAnnotation(ann);
538    }
539    }
540   
 
541  244 toggle private void waitForScript(Viewer jmd)
542    {
543  244 while (jmd.isScriptExecuting())
544    {
545  0 try
546    {
547  0 Thread.sleep(50);
548   
549    } catch (InterruptedException x)
550    {
551    }
552    }
553    }
554   
555    /**
556    * Convert Jmol's secondary structure code to Jalview's, and stored it in the
557    * secondary structure arrays at the given sequence position
558    *
559    * @param proteinStructureSubType
560    * @param pos
561    * @param secstr
562    * @param secstrcode
563    */
 
564  41388 toggle protected void setSecondaryStructure(STR proteinStructureSubType, int pos,
565    char[] secstr, char[] secstrcode)
566    {
567  41388 switch (proteinStructureSubType)
568    {
569  752 case HELIX310:
570  752 secstr[pos] = '3';
571  752 break;
572  4177 case HELIX:
573  5405 case HELIXALPHA:
574  9582 secstr[pos] = 'H';
575  9582 break;
576  1 case HELIXPI:
577  1 secstr[pos] = 'P';
578  1 break;
579  6650 case SHEET:
580  6650 secstr[pos] = 'E';
581  6650 break;
582  24403 default:
583  24403 secstr[pos] = 0;
584    }
585   
586  41388 switch (proteinStructureSubType)
587    {
588  752 case HELIX310:
589  5405 case HELIXALPHA:
590  1 case HELIXPI:
591  4177 case HELIX:
592  10335 secstrcode[pos] = 'H';
593  10335 break;
594  6650 case SHEET:
595  6650 secstrcode[pos] = 'E';
596  6650 break;
597  24403 default:
598  24403 secstrcode[pos] = 0;
599    }
600    }
601   
602    /**
603    * Convert any non-standard peptide codes to their standard code table
604    * equivalent. (Initial version only does Selenomethionine MSE->MET.)
605    *
606    * @param threeLetterCode
607    * @param seq
608    * @param pos
609    */
 
610  0 toggle protected void replaceNonCanonicalResidue(String threeLetterCode,
611    char[] seq, int pos)
612    {
613  0 String canonical = ResidueProperties
614    .getCanonicalAminoAcid(threeLetterCode);
615  0 if (canonical != null && !canonical.equalsIgnoreCase(threeLetterCode))
616    {
617  0 seq[pos] = ResidueProperties.getSingleCharacterCode(canonical);
618    }
619    }
620   
621    /**
622    * Not implemented - returns null
623    */
 
624  0 toggle @Override
625    public String print(SequenceI[] seqs, boolean jvSuffix)
626    {
627  0 return null;
628    }
629   
630    /**
631    * Not implemented
632    */
 
633  0 toggle @Override
634    public void setCallbackFunction(String callbackType,
635    String callbackFunction)
636    {
637    }
638   
 
639  0 toggle @Override
640    public void notifyCallback(CBK cbType, Object[] data)
641    {
642  0 String strInfo = (data == null || data[1] == null ? null
643    : data[1].toString());
644  0 switch (cbType)
645    {
646  0 case ECHO:
647  0 sendConsoleEcho(strInfo);
648  0 break;
649  0 case SCRIPT:
650  0 notifyScriptTermination((String) data[2],
651    ((Integer) data[3]).intValue());
652  0 break;
653  0 case MEASURE:
654  0 String mystatus = (String) data[3];
655  0 if (mystatus.indexOf("Picked") >= 0
656    || mystatus.indexOf("Sequence") >= 0)
657    {
658    // Picking mode
659  0 sendConsoleMessage(strInfo);
660    }
661  0 else if (mystatus.indexOf("Completed") >= 0)
662    {
663  0 sendConsoleEcho(strInfo.substring(strInfo.lastIndexOf(",") + 2,
664    strInfo.length() - 1));
665    }
666  0 break;
667  0 case MESSAGE:
668  0 sendConsoleMessage(data == null ? null : strInfo);
669  0 break;
670  0 case PICK:
671  0 sendConsoleMessage(strInfo);
672  0 break;
673  0 default:
674  0 break;
675    }
676    }
677   
678    String lastConsoleEcho = "";
679   
 
680  0 toggle private void sendConsoleEcho(String string)
681    {
682  0 lastConsoleEcho += string;
683  0 lastConsoleEcho += "\n";
684    }
685   
686    String lastConsoleMessage = "";
687   
 
688  0 toggle private void sendConsoleMessage(String string)
689    {
690  0 lastConsoleMessage += string;
691  0 lastConsoleMessage += "\n";
692    }
693   
694    int lastScriptTermination = -1;
695   
696    String lastScriptMessage = "";
697   
 
698  0 toggle private void notifyScriptTermination(String string, int intValue)
699    {
700  0 lastScriptMessage += string;
701  0 lastScriptMessage += "\n";
702  0 lastScriptTermination = intValue;
703    }
704   
 
705  0 toggle @Override
706    public boolean notifyEnabled(CBK callbackPick)
707    {
708  0 switch (callbackPick)
709    {
710  0 case MESSAGE:
711  0 case SCRIPT:
712  0 case ECHO:
713  0 case LOADSTRUCT:
714  0 case ERROR:
715  0 return true;
716  0 default:
717  0 return false;
718    }
719    }
720   
721    /**
722    * Not implemented - returns null
723    */
 
724  0 toggle @Override
725    public String eval(String strEval)
726    {
727  0 return null;
728    }
729   
730    /**
731    * Not implemented - returns null
732    */
 
733  0 toggle @Override
734    public float[][] functionXY(String functionName, int x, int y)
735    {
736  0 return null;
737    }
738   
739    /**
740    * Not implemented - returns null
741    */
 
742  0 toggle @Override
743    public float[][][] functionXYZ(String functionName, int nx, int ny,
744    int nz)
745    {
746  0 return null;
747    }
748   
749    /**
750    * Not implemented - returns null
751    */
 
752  0 toggle @Override
753    public String createImage(String fileName, String imageType,
754    Object text_or_bytes, int quality)
755    {
756  0 return null;
757    }
758   
759    /**
760    * Not implemented - returns null
761    */
 
762  0 toggle @Override
763    public Map<String, Object> getRegistryInfo()
764    {
765  0 return null;
766    }
767   
768    /**
769    * Not implemented
770    */
 
771  0 toggle @Override
772    public void showUrl(String url)
773    {
774    }
775   
776    /**
777    * Not implemented - returns null
778    */
 
779  0 toggle @Override
780    public int[] resizeInnerPanel(String data)
781    {
782  0 return null;
783    }
784   
 
785  0 toggle @Override
786    public Map<String, Object> getJSpecViewProperty(String arg0)
787    {
788  0 return null;
789    }
790   
 
791  0 toggle public boolean isPredictSecondaryStructure()
792    {
793  0 return predictSecondaryStructure;
794    }
795   
 
796  0 toggle public void setPredictSecondaryStructure(
797    boolean predictSecondaryStructure)
798    {
799  0 this.predictSecondaryStructure = predictSecondaryStructure;
800    }
801   
 
802  0 toggle public boolean isVisibleChainAnnotation()
803    {
804  0 return visibleChainAnnotation;
805    }
806   
 
807  0 toggle public void setVisibleChainAnnotation(boolean visibleChainAnnotation)
808    {
809  0 this.visibleChainAnnotation = visibleChainAnnotation;
810    }
811   
812    }