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.quaternary.io.BioUnitDataProviderFactory;
026import org.biojava.nbio.structure.StructureIO;
027
028public class DemoShowBiolAssembly {
029
030        public static void main(String[] args){
031
032                try{
033                        // see also: http://www.pdb.org/pdb/101/static101.do?p=education_discussion/Looking-at-Structures/bioassembly_tutorial.html
034                        // good examples: 1stp 1gav 1hv4 1hho 7dfr 3fad  1qqp
035
036                        // assembly 0 ... asym Unit
037                        // assembly 1 ... the first bio assembly
038                        // example 1fah has  2 assemblies (two copies of the assembly in asymmetric unit)
039
040
041                        // Various interesting symmetries: (see Lawson, 2008)
042                        // Circular    - 1TJA
043                        // Dihedral    - 1ei7
044                        // Icosahedral - 1a34
045                        // Helical     - 1cgm
046
047
048                        // DNA 173D .. 2
049
050                        BioUnitDataProviderFactory.setBioUnitDataProvider(BioUnitDataProviderFactory.pdbProviderClassName);
051                        //Structure bioAssembly = StructureIO.getBiologicalAssembly("4A1I",2);
052
053                        Structure bioAssembly = StructureIO.getBiologicalAssembly("1pdr",1);
054
055                        StructureAlignmentJmol jmolPanel = new StructureAlignmentJmol();
056                        //jmolPanel.evalString("set autobond=false");
057                        jmolPanel.setStructure(bioAssembly);
058
059                        // send some commands to Jmol
060                        jmolPanel.evalString("select * ; color structure ; spacefill off; wireframe off; backbone off; cartoon on; select ligands ; spacefill 0.4; color cpk; model 0;");
061
062                        System.out.println("done!");
063
064                } catch (Exception e) {
065                        e.printStackTrace();
066                }
067        }
068}