private Structure getStructure(AtomCache cache, String name1, String file) PDBFileReader reader = new PDBFileReader(); if ( file != null ){ try { System.out.println(url); Structure s = reader.getStructure(url); Structure s= reader.getStructure(f); return fixStructureName(s, file); } catch (Exception e){
public static void main(String[] args){ try { PDBFileReader pdbr = new PDBFileReader(); pdbr.setPath("/tmp/"); String pdbCode = "5pti"; Structure struc = pdbr.getStructureById(pdbCode); BiojavaJmol jmolPanel = new BiojavaJmol(); jmolPanel.setStructure(struc); // send some RASMOL style commands to Jmol jmolPanel.evalString("select * ; color chain;"); jmolPanel.evalString("select *; spacefill off; wireframe off; backbone 0.4; "); jmolPanel.evalString("save STATE state_1"); } catch (Exception e){ e.printStackTrace(); } }
/** * Constructs a new PDBFileReader, initializing the extensions member variable. * The path is initialized to the given path, both autoFetch and splitDir are initialized to false. * * <p>If path is null, initialize using the system property/environment variable * {@link UserConfiguration#PDB_DIR}. * @param path Path to the PDB file directory */ public PDBFileReader(String path) { super(path); addExtension(".ent"); addExtension(".pdb"); addExtension(".ent.gz"); addExtension(".pdb.gz"); addExtension(".ent.Z"); addExtension(".pdb.Z"); }
protected Structure loadStructureFromPdbByPdbId(String pdbId) throws IOException, StructureException { logger.debug("Loading structure {} from PDB file {}.", pdbId, path); Structure s; flagLoading(pdbId); try { PDBFileReader reader = new PDBFileReader(path); reader.setFetchBehavior(fetchBehavior); reader.setObsoleteBehavior(obsoleteBehavior); reader.setFileParsingParameters(params); s = reader.getStructureById(pdbId.toLowerCase()); } finally { flagLoadingFinished(pdbId); } return s; }
private void checkFile(String repre) throws IOException, StructureException { StructureName name = new StructureName(repre); PDBFileReader reader = new PDBFileReader(); reader.setFetchBehavior(FetchBehavior.FETCH_REMEDIATED); reader.setPath(cache.getPath()); reader.setFileParsingParameters(cache.getFileParsingParams()); reader.prefetchStructure(name.getPdbId()); }
PDBFileReader reader = new PDBFileReader(cache.getPath()); reader.setFetchBehavior(cache.getFetchBehavior()); reader.setObsoleteBehavior(cache.getObsoleteBehavior()); reader.setFileParsingParameters(cache.getFileParsingParams()); return reader.getStructure(url);
public static void main(String[] args){ PDBFileReader pdbr = new PDBFileReader(); Structure s1 = pdbr.getStructureById(pdb1); Structure s2 = pdbr.getStructureById(pdb2);
String fileFormat = (String)fileType.getSelectedItem(); if ( fileFormat.equals(UserConfiguration.PDB_FORMAT)){ reader = new PDBFileReader(); } else if ( fileFormat.equals(UserConfiguration.MMCIF_FORMAT)){ reader = new MMCIFFileReader();
@Override public Structure getStructure(InputStream inStream) throws IOException { PDBFileParser pdbpars = new PDBFileParser(); pdbpars.setFileParsingParameters(getFileParsingParameters()); Structure struc = pdbpars.parsePDBFile(inStream) ; return struc ; }
PDBFileReader reader = new PDBFileReader(dir); Structure structure1 = reader.getStructureById(pdb);
private Structure loadCustomStructure(String userPath2, String userChain2) throws StructureException{ StructureIOFile reader = new PDBFileReader(); Structure s = null; try { s = reader.getStructure(userPath2); } catch (IOException e){ //e.printStackTrace(); throw new StructureException(e); } return StructureTools.getReducedStructure(s, userChain2); }
@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(); } } } } });
PDBFileReader pdbr = new PDBFileReader(); pdbr.setPath("/Users/andreas/WORK/PDB/"); Structure s1 = pdbr.getStructureById(pdb1); Structure s2 = pdbr.getStructureById(pdb2);
pdbreader = new PDBFileReader();
@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(); } } } } }
PDBFileReader reader = new PDBFileReader(); reader.setPath("."); Structure structure1 = reader.getStructureById(pdb);
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()); } }
public static void main(String[] args){ PDBFileReader pdbr = new PDBFileReader(); pdbr.setPath("/tmp/"); Structure s1 = pdbr.getStructureById(pdb1); Structure s2 = pdbr.getStructureById(pdb2);
/** 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(); }
SuperPosition sp = new SuperPositionQCP(true); if (type1 == null || type2 == null) return null; PDBFileReader pdbFileReader = new PDBFileReader(); 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();