@Override public Structure getStructure(InputStream inStream) throws IOException { PDBFileParser pdbpars = new PDBFileParser(); pdbpars.setFileParsingParameters(getFileParsingParameters()); Structure struc = pdbpars.parsePDBFile(inStream) ; return struc ; }
/** * Parse a PDB file and return a datastructure implementing * PDBStructure interface. * * @param inStream an InputStream object * @return a Structure object * @throws IOException */ public Structure parsePDBFile(InputStream inStream) throws IOException { BufferedReader buf = getBufferedReader(inStream); return parsePDBFile(buf); }
pdb_ATOM_Handler(line); else if (recordName.equals("SEQRES")) pdb_SEQRES_Handler(line); else if (recordName.equals("HETATM")) pdb_ATOM_Handler(line); else if (recordName.equals("MODEL")) pdb_MODEL_Handler(line); else if (recordName.equals("TER")) pdb_TER_Handler(); else if (recordName.equals("HEADER")) pdb_HEADER_Handler(line); else if (recordName.equals("AUTHOR")) pdb_AUTHOR_Handler(line); else if (recordName.equals("TITLE")) pdb_TITLE_Handler(line); else if (recordName.equals("SOURCE")) pdb_JRNL_Handler(line); else if (recordName.equals("EXPDTA")) pdb_EXPDTA_Handler(line); else if (recordName.equals("CRYST1")) pdb_CRYST1_Handler(line); else if (recordName.startsWith("MTRIX")) pdb_MTRIXn_Handler(line); else if (recordName.equals("REMARK")) pdb_REMARK_Handler(line); else if (recordName.equals("CONECT")) pdb_CONECT_Handler(line); else if (recordName.equals("REVDAT"))
if (f.exists()) { if (parser == null) { parser = new PDBFileParser(); return parser.parsePDBFile(inStream); } else { if (cache == null) {
List<List<Chain>> splits = splitNonPolyChain(nonPoly); splitNonPolys.addAll(splits.get(0)); waterModel.addAll(splits.get(1)); assignAsymIds(polyModels, splitNonPolyModels, waterModels); for ( String chainId : chainIds) { List<List<Chain>> models = findChains(chainId, polyModels);
assignChainsAndEntities(); structure.setEntityInfos(entities); buildjournalArticle(); pdbHeader.setJournalArticle(journalArticle); linkSitesToGroups(); // will work now that setSites is called
Integer bond1 = conect_helper(line,11,16); Integer bond2 = conect_helper(line,16,21); Integer bond3 = conect_helper(line,21,26); Integer bond4 = conect_helper(line,26,31); Integer hyd1 = conect_helper(line,31,36); Integer hyd2 = conect_helper(line,36,41); Integer salt1 = conect_helper(line,41,46); Integer hyd3 = conect_helper(line,46,51); Integer hyd4 = conect_helper(line,51,56); Integer salt2 = conect_helper(line,56,61);
compndValueSetter(previousContinuationField, continuationString); previousContinuationField = continuationField; compndValueSetter(continuationField, continuationString); continuationString = ""; if (current_compound!=null) entities.add(current_compound);
journalArticle.setAuthorList(authorBuilder(auth.toString())); journalArticle.setEditorList(authorBuilder(edit.toString())); journalArticle.setRef(ref.toString()); JournalParser journalParser = new JournalParser(ref.toString());
/** * Opens filename, parses it and returns aStructure object . */ public Structure getStructure(String filename) throws IOException { File file = new File(filename); InputStreamProvider isp = new InputStreamProvider(); InputStream inStream = isp.getInputStream(file); PDBFileParser pdbpars = new PDBFileParser(); pdbpars.setFileParsingParameters(params); Structure struc = pdbpars.parsePDBFile(inStream); inStream.close(); return struc; } }
@Override public Structure getStructureById(String pdbId) throws IOException,StructureException { if (pdbId == null || pdbId.length()< 4) throw new StructureException("This does not look like a valid PDB ID! (" + pdbId + ")"); pdbId = pdbId.toLowerCase(); String middle = pdbId.substring(1,3).toLowerCase(); File f = new File(path + fileSeparator + middle + fileSeparator + pdbId + fileSeparator + "pdb" + pdbId + ".ent.gz"); if (! f.exists()){ } InputStreamProvider isp = new InputStreamProvider(); InputStream inputStream = isp.getInputStream(f); PDBFileParser pdbpars = new PDBFileParser(); pdbpars.setFileParsingParameters(params); Structure struc = pdbpars.parsePDBFile(inputStream) ; return struc ; // something is wrong with the file! // it probably should be downloaded again... // TODO: add auto-download functionality... }