@Override public void newDatabasePDBrevRecord(DatabasePdbrevRecord record) { PDBHeader header = structure.getPDBHeader(); if ( header == null) { header = new PDBHeader(); structure.setPDBHeader(header); } List<DatabasePdbrevRecord> revRecords = header.getRevisionRecords(); if ( revRecords == null) { revRecords = new ArrayList<DatabasePdbrevRecord>(); header.setRevisionRecords(revRecords); } revRecords.add(record); }
private void printResolution(StringBuffer buf){ if (getResolution() == DEFAULT_RESOLUTION){ return; } DecimalFormat d2 = (DecimalFormat)NumberFormat.getInstance(java.util.Locale.UK); d2.setMaximumIntegerDigits(2); d2.setMinimumFractionDigits(2); d2.setMaximumFractionDigits(2); buf.append("REMARK 2 RESOLUTION. "); String x = d2.format(resolution); buf.append(x); buf.append(" ANGSTROMS."); fillLine(buf,34+x.length()); buf.append(newline); }
/** * Handler for * TITLE Record Format * <pre> COLUMNS DATA TYPE FIELD DEFINITION ---------------------------------------------------------------------------------- 1 - 6 Record name "TITLE " 9 - 10 Continuation continuation Allows concatenation of multiple records. 11 - 70 String title Title of the experiment. * </pre> * */ private void pdb_TITLE_Handler(String line) { String title; if ( line.length() > 79) title = line.substring(10,80).trim(); else title = line.substring(10,line.length()).trim(); String t = pdbHeader.getTitle(); if ( (t != null) && (! t.equals("")) ){ if (t.endsWith("-")) t += ""; // if last line ends with a hyphen then we don't add space else t += " "; } else t = ""; t += title; pdbHeader.setTitle(t); }
private void printAuthors(StringBuffer buf){ String authors = getAuthors(); if ( authors == null) return; if ( authors.equals("")){ return; } printMultiLine(buf, "AUTHOR ", authors,','); }
private void printTitle(StringBuffer buf) { // 1 2 3 4 5 6 7 //01234567890123456789012345678901234567890123456789012345678901234567890123456789 //HEADER COMPLEX (SERINE PROTEASE/INHIBITORS) 06-FEB-98 1A4W //TITLE CRYSTAL STRUCTURES OF THROMBIN WITH THIAZOLE-CONTAINING //TITLE 2 INHIBITORS: PROBES OF THE S1' BINDING SITE String title = getTitle(); if ( (title == null) || (title.trim().isEmpty()) ) return; printMultiLine(buf, "TITLE ", title,' '); }
/** * Parses the following record: * <pre> * COLUMNS DATA TYPE FIELD DEFINITION * ------------------------------------------------------------------------------------ * 1 - 6 Record name "AUTHOR" * 9 - 10 Continuation continuation Allows concatenation of multiple records. * 11 - 79 List authorList List of the author names, separated * by commas. * * </pre> * @param line */ private void pdb_AUTHOR_Handler(String line) { String authors = line.substring(10).trim(); String auth = pdbHeader.getAuthors(); if (auth == null){ pdbHeader.setAuthors(authors); } else { auth += authors; pdbHeader.setAuthors(auth); } }
PDBCrystallographicInfo xtalInfo = pdbHeader.getCrystallographicInfo(); mmtfDecoderInterface.setHeaderInfo(pdbHeader.getRfree(), pdbHeader.getRwork(), pdbHeader.getResolution(), pdbHeader.getTitle(), MmtfUtils.dateToIsoString(pdbHeader.getDepDate()), MmtfUtils.dateToIsoString(pdbHeader.getRelDate()), MmtfUtils.techniquesToStringArray(pdbHeader.getExperimentalTechniques())); mmtfDecoderInterface.setXtalInfo(MmtfUtils.getSpaceGroupAsString(xtalInfo.getSpaceGroup()), MmtfUtils.getUnitCellAsArray(xtalInfo), MmtfUtils.getNcsAsArray(xtalInfo.getNcsOperators())); storeBioassemblyInformation(chainIdToIndexMap, pdbHeader.getBioAssemblies());
pdbHeader.setTitle(title); pdbHeader.setResolution(resolution); pdbHeader.setRfree(rFree); pdbHeader.setRwork(rWork); pdbHeader.setExperimentalTechnique(techniqueStr); try { Date depDate = formatter.parse(depositionDate); pdbHeader.setDepDate(depDate); } catch (ParseException e) { logger.warn("Could not parse date string '{}', depositon date will be unavailable", depositionDate); pdbHeader.setDepDate(new Date(0)); pdbHeader.setRelDate(relDate); } catch (ParseException e) { logger.warn("Could not parse date string '{}', release date will be unavailable", releaseDate); pdbHeader.setRelDate(new Date(0));
if (pdbHeader.getResolution()!=PDBHeader.DEFAULT_RESOLUTION) { logger.warn("More than 1 resolution value present, will use last one {} and discard previous {} " ,r.getLs_d_res_high(), String.format("%4.2f",pdbHeader.getResolution())); pdbHeader.setResolution(Float.parseFloat(r.getLs_d_res_high())); } catch (NumberFormatException e){ logger.info("Could not parse resolution from " + r.getLs_d_res_high() + " " + e.getMessage()); if (pdbHeader.getRfree()!=PDBHeader.DEFAULT_RFREE) { logger.warn("More than 1 Rfree value present, will use last one {} and discard previous {} ", r.getLs_R_factor_R_free(), String.format("%4.2f",pdbHeader.getRfree())); } else { try { pdbHeader.setRfree(Float.parseFloat(r.getLs_R_factor_R_free())); } catch (NumberFormatException e){ if(pdbHeader.getRwork()!=PDBHeader.DEFAULT_RFREE) { logger.warn("More than 1 R work value present, will use last one {} and discard previous {} ", r.getLs_R_factor_R_work(), String.format("%4.2f",pdbHeader.getRwork())); pdbHeader.setRwork(Float.parseFloat(r.getLs_R_factor_R_work()));
Date modDate = pdbHeader.getModDate(); if ( modDate.equals(new Date(0)) ) { Date depositionDate = pdbHeader.getDepDate(); pdbHeader.setDepDate(depositionDate); pdbHeader.setJournalArticle(journalArticle); pdbHeader.setBioAssemblies(bioAssemblyParser.getTransformationMap()); pdbHeader.setRfree(rfreeNoCutoffLine); } else if (rfreeNoCutoffLine>0 && rfreeStandardLine>0) { pdbHeader.setRfree(rfreeStandardLine); } else if (rfreeNoCutoffLine<0 && rfreeStandardLine>0) { pdbHeader.setRfree(rfreeStandardLine);
@Override public void setStruct(Struct struct) { PDBHeader header = structure.getPDBHeader(); if ( header == null) header = new PDBHeader(); header.setTitle(struct.getTitle()); header.setIdCode(struct.getEntry_id()); //header.setDescription(struct.getPdbx_descriptor()); //header.setClassification(struct.getPdbx_descriptor()); //header.setDescription(struct.getPdbx_descriptor()); structure.setPDBHeader(header); structure.setPDBCode(struct.getEntry_id()); }
header = new PDBHeader(); header.setDepDate(dep); header.setRelDate(rel); header.setModDate(mod);
public static Structure toMultimodelStructure(MultipleAlignment multAln, List<Atom[]> transformedAtoms) throws StructureException { PDBHeader header = new PDBHeader(); String title = multAln.getEnsemble().getAlgorithmName() + " V." + multAln.getEnsemble().getVersion() + " : "; for (StructureIdentifier name : multAln.getEnsemble() .getStructureIdentifiers()) { title += name.getIdentifier() + " "; } Structure artificial = getAlignedStructure(transformedAtoms); artificial.setPDBHeader(header); header.setTitle(title); return artificial; }
@Override public void newStructKeywords(StructKeywords kw){ PDBHeader header = structure.getPDBHeader(); if ( header == null) header = new PDBHeader(); header.setDescription(kw.getPdbx_keywords()); header.setClassification(kw.getPdbx_keywords()); }
@Override public void newPdbxAuditRevisionHistory(PdbxAuditRevisionHistory history) { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd",Locale.US); PDBHeader header = structure.getPDBHeader(); if ( header == null) { header = new PDBHeader(); } // first entry in revision history is the release date if (history.getOrdinal().equals("1")){ try { Date releaseDate = dateFormat.parse(history.getRevision_date()); header.setRelDate(releaseDate); } catch (ParseException e){ logger.warn("Could not parse date string '{}', release date will be unavailable", history.getRevision_date()); } } else { // all other dates are revision dates; // since this method may be called multiple times, // the last revision date will "stick" try { Date revisionDate = dateFormat.parse(history.getRevision_date()); header.setModDate(revisionDate); } catch (ParseException e){ logger.warn("Could not parse date string '{}', revision date will be unavailable", history.getRevision_date()); } } structure.setPDBHeader(header); }
private void printHeader(StringBuffer buf){ String classification = getClassification(); if (classification == null || classification.isEmpty()) return; // we can;t display this line since the classification is not there... buf.append("HEADER "); buf.append(classification); buf.append(" "); // fill up the white space to the right column int l = classification.length() + 10 ; while (l < 49){ l++; buf.append(" "); } Date d = getDepDate(); if ( d != null){ // provide correct display of Dep date... buf.append(dateFormat.format(d)); } else { buf.append(" "); } buf.append(" "); String id = getIdCode(); if ( id != null){ buf.append(getIdCode()); buf.append(" "); } else buf.append(" "); buf.append(newline); }
/** * Constructs a StructureImpl object. */ public StructureImpl() { super(); models = new ArrayList<>(); name = ""; entityInfos = new ArrayList<>(); dbrefs = new ArrayList<>(); pdbHeader = new PDBHeader(); ssbonds = new ArrayList<>(); sites = new ArrayList<>(); }
@Override protected void initCoords() { try { if (multAln == null) { if (structure != null) setStructure(structure); else { logger.error("Could not find anything to display!"); return; } } Structure artificial = MultipleAlignmentTools.toMultimodelStructure(multAln, transformedAtoms); setStructure(artificial); logger.info(artificial.getPDBHeader().getTitle()); } catch (StructureException e) { e.printStackTrace(); } }
@Override public void newPdbxDatabaseStatus(PdbxDatabaseStatus status) { // the deposition date field is only available in mmCIF 5.0 if (status.getRecvd_initial_deposition_date() == null) { // skip this method for older mmCIF versions return; } SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd",Locale.US); PDBHeader header = structure.getPDBHeader(); if (header == null) { header = new PDBHeader(); } try { Date depositionDate = dateFormat.parse(status.getRecvd_initial_deposition_date()); header.setDepDate(depositionDate); } catch (ParseException e){ logger.warn("Could not parse date string '{}', deposition date will be unavailable", status.getRecvd_initial_deposition_date()); } structure.setPDBHeader(header); }
try { float res = Float.parseFloat(mR.group(1)); if (pdbHeader.getResolution()!=PDBHeader.DEFAULT_RESOLUTION) { logger.warn("More than 1 resolution value present, will use last one {} and discard previous {} " ,mR.group(1), String.format("%4.2f",pdbHeader.getResolution())); pdbHeader.setResolution(res); } catch (NumberFormatException e) { logger.info("Could not parse resolution '{}', ignoring it",mR.group(1));