2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
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.
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.
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.
21 package jalview.ext.rbvi.chimera;
23 import jalview.api.AlignmentViewPanel;
24 import jalview.api.FeatureRenderer;
25 import jalview.api.SequenceRenderer;
26 import jalview.bin.Cache;
27 import jalview.datamodel.AlignmentI;
28 import jalview.datamodel.ColumnSelection;
29 import jalview.datamodel.PDBEntry;
30 import jalview.datamodel.SequenceI;
31 import jalview.httpserver.AbstractRequestHandler;
32 import jalview.schemes.ColourSchemeI;
33 import jalview.schemes.ResidueProperties;
34 import jalview.structure.AtomSpec;
35 import jalview.structure.StructureMappingcommandSet;
36 import jalview.structure.StructureSelectionManager;
37 import jalview.structures.models.AAStructureBindingModel;
38 import jalview.util.MessageManager;
40 import java.awt.Color;
41 import java.net.BindException;
42 import java.util.ArrayList;
43 import java.util.Hashtable;
44 import java.util.LinkedHashMap;
45 import java.util.List;
48 import ext.edu.ucsf.rbvi.strucviz2.ChimeraManager;
49 import ext.edu.ucsf.rbvi.strucviz2.ChimeraModel;
50 import ext.edu.ucsf.rbvi.strucviz2.StructureManager;
51 import ext.edu.ucsf.rbvi.strucviz2.StructureManager.ModelType;
53 public abstract class JalviewChimeraBinding extends AAStructureBindingModel
55 // Chimera clause to exclude alternate locations in atom selection
56 private static final String NO_ALTLOCS = "&~@.B-Z&~@.2-9";
58 private static final String COLOURING_CHIMERA = MessageManager
59 .getString("status.colouring_chimera");
61 private static final boolean debug = false;
63 private static final String PHOSPHORUS = "P";
65 private static final String ALPHACARBON = "CA";
67 private List<String> chainNames = new ArrayList<String>();
69 private Hashtable<String, String> chainFile = new Hashtable<String, String>();
71 * Object through which we talk to Chimera
73 private ChimeraManager viewer;
76 * Object which listens to Chimera notifications
78 private AbstractRequestHandler chimeraListener;
81 * set if chimera state is being restored from some source - instructs binding
82 * not to apply default display style when structure set is updated for first
85 private boolean loadingFromArchive = false;
88 * flag to indicate if the Chimera viewer should ignore sequence colouring
89 * events from the structure manager because the GUI is still setting up
91 private boolean loadingFinished = true;
93 public String fileLoadingError;
96 * Map of ChimeraModel objects keyed by PDB full local file name
98 private Map<String, List<ChimeraModel>> chimeraMaps = new LinkedHashMap<String, List<ChimeraModel>>();
101 * the default or current model displayed if the model cannot be identified
102 * from the selection message
104 private int frameNo = 0;
106 private String lastCommand;
108 String lastHighlightCommand;
111 * incremented every time a load notification is successfully handled -
112 * lightweight mechanism for other threads to detect when they can start
113 * referring to new structures.
115 private long loadNotifiesHandled = 0;
118 * Open a PDB structure file in Chimera and set up mappings from Jalview.
120 * We check if the PDB model id is already loaded in Chimera, if so don't
121 * reopen it. This is the case if Chimera has opened a saved session file.
126 public boolean openFile(PDBEntry pe)
128 String file = pe.getFile();
131 List<ChimeraModel> modelsToMap = new ArrayList<ChimeraModel>();
132 List<ChimeraModel> oldList = viewer.getModelList();
133 boolean alreadyOpen = false;
136 * If Chimera already has this model, don't reopen it, but do remap it.
138 for (ChimeraModel open : oldList)
140 if (open.getModelName().equals(pe.getId()))
143 modelsToMap.add(open);
148 * If Chimera doesn't yet have this model, ask it to open it, and retrieve
149 * the model name(s) added by Chimera.
153 viewer.openModel(file, pe.getId(), ModelType.PDB_MODEL);
154 List<ChimeraModel> newList = viewer.getModelList();
155 // JAL-1728 newList.removeAll(oldList) does not work
156 for (ChimeraModel cm : newList)
158 if (cm.getModelName().equals(pe.getId()))
165 chimeraMaps.put(file, modelsToMap);
167 if (getSsm() != null)
169 getSsm().addStructureViewerListener(this);
170 // ssm.addSelectionListener(this);
171 FeatureRenderer fr = getFeatureRenderer(null);
179 } catch (Exception q)
181 log("Exception when trying to open model " + file + "\n"
197 public JalviewChimeraBinding(StructureSelectionManager ssm,
198 PDBEntry[] pdbentry, SequenceI[][] sequenceIs, String protocol)
200 super(ssm, pdbentry, sequenceIs, protocol);
201 viewer = new ChimeraManager(
202 new ext.edu.ucsf.rbvi.strucviz2.StructureManager(true));
206 * Start a dedicated HttpServer to listen for Chimera notifications, and tell
207 * it to start listening
209 public void startChimeraListener()
213 chimeraListener = new ChimeraListener(this);
214 viewer.startListening(chimeraListener.getUri());
215 } catch (BindException e)
217 System.err.println("Failed to start Chimera listener: "
223 * Construct a title string for the viewer window based on the data Jalview
229 public String getViewerTitle(boolean verbose)
231 return getViewerTitle("Chimera", verbose);
235 * Tells Chimera to display only the specified chains
239 public void showChains(List<String> toshow)
242 * Construct a chimera command like
244 * ~display #*;~ribbon #*;ribbon :.A,:.B
246 StringBuilder cmd = new StringBuilder(64);
247 boolean first = true;
248 for (String chain : toshow)
250 int modelNumber = getModelNoForChain(chain);
251 String showChainCmd = modelNumber == -1 ? "" : modelNumber + ":."
252 + chain.split(":")[1];
257 cmd.append(showChainCmd);
262 * could append ";focus" to this command to resize the display to fill the
263 * window, but it looks more helpful not to (easier to relate chains to the
266 final String command = "~display #*; ~ribbon #*; ribbon :"
268 sendChimeraCommand(command, false);
272 * Close down the Jalview viewer and listener, and (optionally) the associated
275 public void closeViewer(boolean closeChimera)
277 getSsm().removeStructureViewerListener(this, this.getPdbFile());
280 viewer.exitChimera();
282 if (this.chimeraListener != null)
284 chimeraListener.shutdown();
285 chimeraListener = null;
290 releaseUIResources();
293 public void colourByChain()
295 colourBySequence = false;
296 sendAsynchronousCommand("rainbow chain", COLOURING_CHIMERA);
300 * Constructs and sends a Chimera command to colour by charge
302 * <li>Aspartic acid and Glutamic acid (negative charge) red</li>
303 * <li>Lysine and Arginine (positive charge) blue</li>
304 * <li>Cysteine - yellow</li>
305 * <li>all others - white</li>
308 public void colourByCharge()
310 colourBySequence = false;
311 String command = "color white;color red ::ASP;color red ::GLU;color blue ::LYS;color blue ::ARG;color yellow ::CYS";
312 sendAsynchronousCommand(command, COLOURING_CHIMERA);
316 * Construct and send a command to align structures against a reference
317 * structure, based on one or more sequence alignments
320 * an array of alignments to process
321 * @param _refStructure
322 * an array of corresponding reference structures (index into pdb
323 * file array); if a negative value is passed, the first PDB file
324 * mapped to an alignment sequence is used as the reference for
327 * an array of corresponding hidden columns for each alignment
329 public void superposeStructures(AlignmentI[] _alignment,
330 int[] _refStructure, ColumnSelection[] _hiddenCols)
332 StringBuilder allComs = new StringBuilder(128);
333 String[] files = getPdbFile();
335 if (!waitForFileLoad(files))
341 StringBuilder selectioncom = new StringBuilder(256);
342 for (int a = 0; a < _alignment.length; a++)
344 int refStructure = _refStructure[a];
345 AlignmentI alignment = _alignment[a];
346 ColumnSelection hiddenCols = _hiddenCols[a];
348 if (refStructure >= files.length)
350 System.err.println("Ignoring invalid reference structure value "
356 * 'matched' array will hold 'true' for visible alignment columns where
357 * all sequences have a residue with a mapping to the PDB structure
359 boolean matched[] = new boolean[alignment.getWidth()];
360 for (int m = 0; m < matched.length; m++)
362 matched[m] = (hiddenCols != null) ? hiddenCols.isVisible(m) : true;
365 SuperposeData[] structures = new SuperposeData[files.length];
366 for (int f = 0; f < files.length; f++)
368 structures[f] = new SuperposeData(alignment.getWidth());
372 * Calculate the superposable alignment columns ('matched'), and the
373 * corresponding structure residue positions (structures.pdbResNo)
375 int candidateRefStructure = findSuperposableResidues(alignment,
376 matched, structures);
377 if (refStructure < 0)
380 * If no reference structure was specified, pick the first one that has
381 * a mapping in the alignment
383 refStructure = candidateRefStructure;
387 for (boolean b : matched)
396 // TODO: bail out here because superposition illdefined?
400 * Generate select statements to select regions to superimpose structures
402 String[] selcom = new String[files.length];
403 for (int pdbfnum = 0; pdbfnum < files.length; pdbfnum++)
405 String chainCd = "." + structures[pdbfnum].chain;
408 StringBuilder molsel = new StringBuilder();
409 for (int r = 0; r < matched.length; r++)
413 int pdbResNum = structures[pdbfnum].pdbResNo[r];
414 if (lpos != pdbResNum - 1)
417 * discontiguous - append last residue now
421 molsel.append(String.valueOf(lpos));
422 molsel.append(chainCd);
430 * extending a contiguous run
435 * start the range selection
437 molsel.append(String.valueOf(lpos));
447 * and terminate final selection
451 molsel.append(String.valueOf(lpos));
452 molsel.append(chainCd);
454 if (molsel.length() > 1)
456 selcom[pdbfnum] = molsel.toString();
457 selectioncom.append("#").append(String.valueOf(pdbfnum))
459 selectioncom.append(selcom[pdbfnum]);
460 selectioncom.append(" ");
461 if (pdbfnum < files.length - 1)
463 selectioncom.append("| ");
468 selcom[pdbfnum] = null;
472 StringBuilder command = new StringBuilder(256);
473 for (int pdbfnum = 0; pdbfnum < files.length; pdbfnum++)
475 if (pdbfnum == refStructure || selcom[pdbfnum] == null
476 || selcom[refStructure] == null)
480 if (command.length() > 0)
486 * Form Chimera match command, from the 'new' structure to the
487 * 'reference' structure e.g. (50 residues, chain B/A, alphacarbons):
489 * match #1:1-30.B,81-100.B@CA #0:21-40.A,61-90.A@CA
492 * https://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/match.html
494 command.append("match ").append(getModelSpec(pdbfnum)).append(":");
495 command.append(selcom[pdbfnum]);
496 command.append("@").append(
497 structures[pdbfnum].isRna ? PHOSPHORUS : ALPHACARBON);
498 // JAL-1757 exclude alternate CA locations
499 command.append(NO_ALTLOCS);
500 command.append(" ").append(getModelSpec(refStructure)).append(":");
501 command.append(selcom[refStructure]);
502 command.append("@").append(
503 structures[refStructure].isRna ? PHOSPHORUS : ALPHACARBON);
504 command.append(NO_ALTLOCS);
506 if (selectioncom.length() > 0)
510 System.out.println("Select regions:\n" + selectioncom.toString());
511 System.out.println("Superimpose command(s):\n"
512 + command.toString());
514 allComs.append("~display all; chain @CA|P; ribbon ")
515 .append(selectioncom.toString())
516 .append(";" + command.toString());
519 if (selectioncom.length() > 0)
521 // TODO: visually distinguish regions that were superposed
522 if (selectioncom.substring(selectioncom.length() - 1).equals("|"))
524 selectioncom.setLength(selectioncom.length() - 1);
528 System.out.println("Select regions:\n" + selectioncom.toString());
530 allComs.append("; ~display all; chain @CA|P; ribbon ")
531 .append(selectioncom.toString()).append("; focus");
532 sendChimeraCommand(allComs.toString(), false);
538 * Helper method to construct model spec in Chimera format:
540 * <li>#0 (#1 etc) for a PDB file with no sub-models</li>
541 * <li>#0.1 (#1.1 etc) for a PDB file with sub-models</li>
543 * Note for now we only ever choose the first of multiple models. This
544 * corresponds to the hard-coded Jmol equivalent (compare {1.1}). Refactor in
545 * future if there is a need to select specific sub-models.
550 protected String getModelSpec(int pdbfnum)
552 if (pdbfnum < 0 || pdbfnum >= getPdbCount())
558 * For now, the test for having sub-models is whether multiple Chimera
559 * models are mapped for the PDB file; the models are returned as a response
560 * to the Chimera command 'list models type molecule', see
561 * ChimeraManager.getModelList().
563 List<ChimeraModel> maps = chimeraMaps.get(getPdbFile()[pdbfnum]);
564 boolean hasSubModels = maps != null && maps.size() > 1;
565 return "#" + String.valueOf(pdbfnum) + (hasSubModels ? ".1" : "");
569 * Launch Chimera, unless an instance linked to this object is already
570 * running. Returns true if chimera is successfully launched, or already
571 * running, else false.
575 public boolean launchChimera()
577 if (!viewer.isChimeraLaunched())
579 return viewer.launchChimera(StructureManager.getChimeraPaths());
581 if (viewer.isChimeraLaunched())
585 log("Failed to launch Chimera!");
590 * Answers true if the Chimera process is still running, false if ended or not
595 public boolean isChimeraRunning()
597 return viewer.isChimeraLaunched();
601 * Send a command to Chimera, and optionally log any responses.
606 public void sendChimeraCommand(final String command, boolean logResponse)
610 // ? thread running after viewer shut down
613 viewerCommandHistory(false);
614 if (lastCommand == null || !lastCommand.equals(command))
616 // trim command or it may never find a match in the replyLog!!
617 List<String> lastReply = viewer.sendChimeraCommand(command.trim(),
619 if (logResponse && debug)
621 log("Response from command ('" + command + "') was:\n" + lastReply);
624 viewerCommandHistory(true);
625 lastCommand = command;
629 * Send a Chimera command asynchronously in a new thread. If the progress
630 * message is not null, display this message while the command is executing.
635 protected abstract void sendAsynchronousCommand(String command,
639 * colour any structures associated with sequences in the given alignment
640 * using the getFeatureRenderer() and getSequenceRenderer() renderers but only
641 * if colourBySequence is enabled.
643 public void colourBySequence(boolean showFeatures,
644 jalview.api.AlignmentViewPanel alignmentv)
646 if (!colourBySequence || !loadingFinished)
650 if (getSsm() == null)
654 String[] files = getPdbFile();
656 SequenceRenderer sr = getSequenceRenderer(alignmentv);
658 FeatureRenderer fr = null;
661 fr = getFeatureRenderer(alignmentv);
663 AlignmentI alignment = alignmentv.getAlignment();
665 for (jalview.structure.StructureMappingcommandSet cpdbbyseq : getColourBySequenceCommands(
666 files, sr, fr, alignment))
668 for (String command : cpdbbyseq.commands)
670 sendAsynchronousCommand(command, COLOURING_CHIMERA);
682 protected StructureMappingcommandSet[] getColourBySequenceCommands(
683 String[] files, SequenceRenderer sr, FeatureRenderer fr,
684 AlignmentI alignment)
686 return ChimeraCommands.getColourBySequenceCommand(getSsm(), files,
687 getSequence(), sr, fr, alignment);
693 protected void executeWhenReady(String command)
696 sendChimeraCommand(command, false);
700 private void waitForChimera()
702 while (viewer != null && viewer.isBusy())
707 } catch (InterruptedException q)
713 // End StructureListener
714 // //////////////////////////
717 * returns the current featureRenderer that should be used to colour the
724 public abstract FeatureRenderer getFeatureRenderer(
725 AlignmentViewPanel alignment);
728 * instruct the Jalview binding to update the pdbentries vector if necessary
729 * prior to matching the viewer's contents to the list of structure files
730 * Jalview knows about.
732 public abstract void refreshPdbEntries();
734 private int getModelNum(String modelFileName)
736 String[] mfn = getPdbFile();
741 for (int i = 0; i < mfn.length; i++)
743 if (mfn[i].equalsIgnoreCase(modelFileName))
752 * map between index of model filename returned from getPdbFile and the first
753 * index of models from this file in the viewer. Note - this is not trimmed -
754 * use getPdbFile to get number of unique models.
756 private int _modelFileNameMap[];
758 // ////////////////////////////////
759 // /StructureListener
761 public synchronized String[] getPdbFile()
765 return new String[0];
768 return chimeraMaps.keySet().toArray(
769 modelFileNames = new String[chimeraMaps.size()]);
773 * returns the current sequenceRenderer that should be used to colour the
780 public abstract SequenceRenderer getSequenceRenderer(
781 AlignmentViewPanel alignment);
784 * Construct and send a command to highlight zero, one or more atoms. We do
785 * this by sending an "rlabel" command to show the residue label at that
789 public void highlightAtoms(List<AtomSpec> atoms)
791 if (atoms == null || atoms.size() == 0)
796 StringBuilder cmd = new StringBuilder(128);
797 boolean first = true;
798 boolean found = false;
800 for (AtomSpec atom : atoms)
802 int pdbResNum = atom.getPdbResNum();
803 String chain = atom.getChain();
804 String pdbfile = atom.getPdbFile();
805 List<ChimeraModel> cms = chimeraMaps.get(pdbfile);
806 if (cms != null && !cms.isEmpty())
810 cmd.append("rlabel #").append(cms.get(0).getModelNumber())
818 cmd.append(pdbResNum);
819 if (!chain.equals(" "))
821 cmd.append(".").append(chain);
826 String command = cmd.toString();
829 * avoid repeated commands for the same residue
831 if (command.equals(lastHighlightCommand))
837 * unshow the label for the previous residue
839 if (lastHighlightCommand != null)
841 viewer.sendChimeraCommand("~" + lastHighlightCommand, false);
845 viewer.sendChimeraCommand(command, false);
847 this.lastHighlightCommand = command;
851 * Query Chimera for its current selection, and highlight it on the alignment
853 public void highlightChimeraSelection()
856 * Ask Chimera for its current selection
858 List<String> selection = viewer.getSelectedResidueSpecs();
861 * Parse model number, residue and chain for each selected position,
862 * formatted as #0:123.A or #1.2:87.B (#model.submodel:residue.chain)
864 List<AtomSpec> atomSpecs = new ArrayList<AtomSpec>();
865 for (String atomSpec : selection)
867 int colonPos = atomSpec.indexOf(":");
870 continue; // malformed
873 int hashPos = atomSpec.indexOf("#");
874 String modelSubmodel = atomSpec.substring(hashPos + 1, colonPos);
875 int dotPos = modelSubmodel.indexOf(".");
879 modelId = Integer.valueOf(dotPos == -1 ? modelSubmodel
880 : modelSubmodel.substring(0, dotPos));
881 } catch (NumberFormatException e)
883 // ignore, default to model 0
886 String residueChain = atomSpec.substring(colonPos + 1);
887 dotPos = residueChain.indexOf(".");
888 int pdbResNum = Integer.parseInt(dotPos == -1 ? residueChain
889 : residueChain.substring(0, dotPos));
891 String chainId = dotPos == -1 ? "" : residueChain
892 .substring(dotPos + 1);
895 * Work out the pdbfilename from the model number
897 String pdbfilename = modelFileNames[frameNo];
898 findfileloop: for (String pdbfile : this.chimeraMaps.keySet())
900 for (ChimeraModel cm : chimeraMaps.get(pdbfile))
902 if (cm.getModelNumber() == modelId)
904 pdbfilename = pdbfile;
909 atomSpecs.add(new AtomSpec(pdbfilename, chainId, pdbResNum, 0));
913 * Broadcast the selection (which may be empty, if the user just cleared all
916 getSsm().mouseOverStructure(atomSpecs);
919 private void log(String message)
921 System.err.println("## Chimera log: " + message);
924 private void viewerCommandHistory(boolean enable)
926 // log("(Not yet implemented) History "
927 // + ((debug || enable) ? "on" : "off"));
930 public long getLoadNotifiesHandled()
932 return loadNotifiesHandled;
935 public void setJalviewColourScheme(ColourSchemeI cs)
937 colourBySequence = false;
944 // Chimera expects RBG values in the range 0-1
945 final double normalise = 255D;
946 viewerCommandHistory(false);
947 StringBuilder command = new StringBuilder(128);
949 List<String> residueSet = ResidueProperties.getResidues(isNucleotide(),
951 for (String res : residueSet)
953 Color col = cs.findColour(res.charAt(0));
954 command.append("color " + col.getRed() / normalise + ","
955 + col.getGreen() / normalise + "," + col.getBlue()
956 / normalise + " ::" + res + ";");
959 sendAsynchronousCommand(command.toString(), COLOURING_CHIMERA);
960 viewerCommandHistory(true);
964 * called when the binding thinks the UI needs to be refreshed after a Chimera
965 * state change. this could be because structures were loaded, or because an
966 * error has occurred.
968 public abstract void refreshGUI();
971 public void setLoadingFromArchive(boolean loadingFromArchive)
973 this.loadingFromArchive = loadingFromArchive;
978 * @return true if Chimeral is still restoring state or loading is still going
979 * on (see setFinsihedLoadingFromArchive)
982 public boolean isLoadingFromArchive()
984 return loadingFromArchive && !loadingFinished;
988 * modify flag which controls if sequence colouring events are honoured by the
989 * binding. Should be true for normal operation
991 * @param finishedLoading
994 public void setFinishedLoadingFromArchive(boolean finishedLoading)
996 loadingFinished = finishedLoading;
1000 * Send the Chimera 'background solid <color>" command.
1003 * ://www.cgl.ucsf.edu/chimera/current/docs/UsersGuide/midas/background
1007 public void setBackgroundColour(Color col)
1009 viewerCommandHistory(false);
1010 double normalise = 255D;
1011 final String command = "background solid " + col.getRed() / normalise
1012 + "," + col.getGreen() / normalise + "," + col.getBlue()
1014 viewer.sendChimeraCommand(command, false);
1015 viewerCommandHistory(true);
1019 * Ask Chimera to save its session to the given file. Returns true if
1020 * successful, else false.
1025 public boolean saveSession(String filepath)
1027 if (isChimeraRunning())
1029 List<String> reply = viewer.sendChimeraCommand("save " + filepath,
1031 if (reply.contains("Session written"))
1038 .error("Error saving Chimera session: " + reply.toString());
1045 * Ask Chimera to open a session file. Returns true if successful, else false.
1046 * The filename must have a .py extension for this command to work.
1051 public boolean openSession(String filepath)
1053 sendChimeraCommand("open " + filepath, true);
1054 // todo: test for failure - how?
1059 * Returns a list of chains mapped in this viewer. Note this list is not
1060 * currently scoped per structure.
1066 * Send a 'focus' command to Chimera to recentre the visible display
1068 public void focusView()
1070 sendChimeraCommand("focus", false);
1074 * Send a 'show' command for all atoms in the currently selected columns
1076 * TODO: pull up to abstract structure viewer interface
1080 public void highlightSelection(AlignmentViewPanel vp)
1082 List<Integer> cols = vp.getAlignViewport().getColumnSelection()
1084 AlignmentI alignment = vp.getAlignment();
1085 StructureSelectionManager sm = getSsm();
1086 for (SequenceI seq : alignment.getSequences())
1089 * convert selected columns into sequence positions
1091 int[] positions = new int[cols.size()];
1093 for (Integer col : cols)
1095 positions[i++] = seq.findPosition(col);
1097 sm.highlightStructure(this, seq, positions);
1103 public List<String> getChainNames()
1108 public Hashtable<String, String> getChainFile()
1113 public List<ChimeraModel> getChimeraModelByChain(String chain)
1115 return chimeraMaps.get(chainFile.get(chain));
1118 public int getModelNoForChain(String chain)
1120 List<ChimeraModel> foundModels = getChimeraModelByChain(chain);
1121 if (foundModels != null && !foundModels.isEmpty())
1123 return foundModels.get(0).getModelNumber();