System.out.println(url); Structure s = reader.getStructure(url); Structure s= reader.getStructure(f); return fixStructureName(s, file); } catch (Exception e){
@Override public void actionPerformed(ActionEvent e) { String cmd = e.getActionCommand(); if ( cmd.equals("Open")){ final JFileChooser fc = new JFileChooser(); // In response to a button click: int returnVal = fc.showOpenDialog(null); if ( returnVal == JFileChooser.APPROVE_OPTION) { File file = fc.getSelectedFile(); PDBFileReader reader = new PDBFileReader(); try { Structure s = reader.getStructure(file); BiojavaJmol jmol = new BiojavaJmol(); jmol.setStructure(s); jmol.evalString("select * ; color chain;"); jmol.evalString("select *; spacefill off; wireframe off; backbone 0.4; "); } catch (Exception ex){ ex.printStackTrace(); } } } } });
@Override public void actionPerformed(ActionEvent e) { String cmd = e.getActionCommand(); if ( cmd.equals("Open PDB file")){ final JFileChooser fc = new JFileChooser(); // In response to a button click: int returnVal = fc.showOpenDialog(null); if ( returnVal == JFileChooser.APPROVE_OPTION) { File file = fc.getSelectedFile(); PDBFileReader reader = new PDBFileReader(); try { Structure s = reader.getStructure(file); StructureAlignmentJmol jmol = new StructureAlignmentJmol(null,null,null); jmol.setStructure(s); jmol.evalString("set antialiasDisplay on; select all;spacefill off; wireframe off; backbone off; cartoon;color cartoon chain; select ligand;wireframe 0.16;spacefill 0.5; select all; color cartoon structure;"); jmol.evalString("save STATE state_1"); } catch (Exception ex){ ex.printStackTrace(); } } } } }
try{ PDBFileReader read=new PDBFileReader(); Structure pdb=read.getStructure(filename); System.out.println("PDB code :"+pdb.getPDBCode()); List chains=Collections.synchronizedList(new ArrayList()); chains=pdb.getChains(); for(Iterator iter=chains.iterator();iter.hasNext();){ Chain c=(Chain)(iter.next()); System.out.println("Chain :"+c.getName()+"\n"+"Seq aa :"+c.getAtomSequence()); for(int j=0;j<c.getAtomLength();j++){ for (int k=0; k < c.getAtomGroup(j).size(); k++ ){ Atom a=c.getAtomGroup(j).getAtom(k); System.out.println("Name : "+a.getName()+" X : "+a.getX()+" Y : "+a.getY()+" Z : "+a.getZ()); } }
/** Do a DB search with the input file against representative PDB domains * * @param cache * @param searchFile * @param outputFile * @throws ConfigurationException */ private void runDbSearch(AtomCache cache, String searchFile, String outputFile,int useNrCPUs, StartupParameters params) throws ConfigurationException { System.out.println("will use " + useNrCPUs + " CPUs."); PDBFileReader reader = new PDBFileReader(); Structure structure1 = null ; try { structure1 = reader.getStructure(searchFile); } catch (IOException e) { throw new ConfigurationException("could not parse as PDB file: " + searchFile); } File searchF = new File(searchFile); String name1 = "CUSTOM"; StructureAlignment algorithm = getAlgorithm(); MultiThreadedDBSearch dbSearch = new MultiThreadedDBSearch(name1, structure1, outputFile, algorithm, useNrCPUs, params.isDomainSplit()); dbSearch.setCustomFile1(searchF.getAbsolutePath()); dbSearch.run(); }
reader.setObsoleteBehavior(cache.getObsoleteBehavior()); reader.setFileParsingParameters(cache.getFileParsingParams()); return reader.getStructure(url);
Structure s1, s2; try { s1 = pdbFileReader.getStructure(new ByteArrayInputStream(STANDARD_BASES[type1].getBytes())); s2 = pdbFileReader.getStructure(new ByteArrayInputStream(STANDARD_BASES[type2].getBytes())); } catch (IOException e) { e.printStackTrace();