001/*
002 *                    BioJava development code
003 *
004 * This code may be freely distributed and modified under the
005 * terms of the GNU Lesser General Public Licence.  This should
006 * be distributed with the code.  If you do not have a copy,
007 * see:
008 *
009 *      http://www.gnu.org/copyleft/lesser.html
010 *
011 * Copyright for this code is held jointly by the individual
012 * authors.  These should be listed in @author doc comments.
013 *
014 * For more information on the BioJava project and its aims,
015 * or to join the biojava-l mailing list, visit the home page
016 * at:
017 *
018 *      http://www.biojava.org/
019 *
020 */
021package demo;
022
023import org.biojava.nbio.structure.Structure;
024import org.biojava.nbio.structure.align.gui.jmol.StructureAlignmentJmol;
025import org.biojava.nbio.structure.StructureIO;
026
027public class DemoShowBiolAssembly {
028
029        public static void main(String[] args){
030
031                try{
032                        // see also: http://www.pdb.org/pdb/101/static101.do?p=education_discussion/Looking-at-Structures/bioassembly_tutorial.html
033                        // good examples: 1stp 1gav 1hv4 1hho 7dfr 3fad  1qqp
034
035                        // assembly 0 ... asym Unit
036                        // assembly 1 ... the first bio assembly
037                        // example 1fah has  2 assemblies (two copies of the assembly in asymmetric unit)
038
039
040                        // Various interesting symmetries: (see Lawson, 2008)
041                        // Circular    - 1TJA
042                        // Dihedral    - 1ei7
043                        // Icosahedral - 1a34
044                        // Helical     - 1cgm
045
046
047                        // DNA 173D .. 2
048
049                        //Structure bioAssembly = StructureIO.getBiologicalAssembly("4A1I",2);
050
051                        Structure bioAssembly = StructureIO.getBiologicalAssembly("1pdr",1);
052
053                        StructureAlignmentJmol jmolPanel = new StructureAlignmentJmol();
054                        //jmolPanel.evalString("set autobond=false");
055                        jmolPanel.setStructure(bioAssembly);
056
057                        // send some commands to Jmol
058                        jmolPanel.evalString("select * ; color structure ; spacefill off; wireframe off; backbone off; cartoon on; select ligands ; spacefill 0.4; color cpk; model 0;");
059
060                        System.out.println("done!");
061
062                } catch (Exception e) {
063                        e.printStackTrace();
064                }
065        }
066}