/** * Gets crystallographic information for this structure * @return PDBCrystallographicInfo crystallographic information * @since 3.2 */ @Override public PDBCrystallographicInfo getCrystallographicInfo() { return pdbHeader.getCrystallographicInfo(); }
@Override public void newSymmetry(Symmetry symmetry) { String spaceGroup = symmetry.getSpace_group_name_H_M(); SpaceGroup sg = SymoplibParser.getSpaceGroup(spaceGroup); if (sg==null) { logger.warn("Space group '"+spaceGroup+"' not recognised as a standard space group"); structure.getPDBHeader().getCrystallographicInfo().setNonStandardSg(true); } else { structure.getPDBHeader().getCrystallographicInfo().setSpaceGroup(sg); structure.getPDBHeader().getCrystallographicInfo().setNonStandardSg(false); } }
public String toMMCIF() { StringBuilder str = new StringBuilder(); str.append(SimpleMMcifParser.MMCIF_TOP_HEADER+"BioJava_mmCIF_file"+newline); if (structure.getPDBHeader()!=null && structure.getPDBHeader().getCrystallographicInfo()!=null && structure.getPDBHeader().getCrystallographicInfo().getSpaceGroup()!=null && structure.getPDBHeader().getCrystallographicInfo().getCrystalCell()!=null) { str.append(MMCIFFileTools.toMMCIF("_cell", MMCIFFileTools.convertCrystalCellToCell(structure.getPDBHeader().getCrystallographicInfo().getCrystalCell()))); str.append(MMCIFFileTools.toMMCIF("_symmetry", MMCIFFileTools.convertSpaceGroupToSymmetry(structure.getPDBHeader().getCrystallographicInfo().getSpaceGroup()))); } str.append(getAtomSiteHeader()); List<AtomSite> list = MMCIFFileTools.convertStructureToAtomSites(structure); str.append(MMCIFFileTools.toMMCIF(list,AtomSite.class)); return str.toString(); }
public void newAtomSites(AtomSites atomSites) { try { Matrix4d m = new Matrix4d( Double.parseDouble(atomSites.getFract_transf_matrix11()), Double.parseDouble(atomSites.getFract_transf_matrix12()), Double.parseDouble(atomSites.getFract_transf_matrix13()), Double.parseDouble(atomSites.getFract_transf_vector1()), Double.parseDouble(atomSites.getFract_transf_matrix21()), Double.parseDouble(atomSites.getFract_transf_matrix22()), Double.parseDouble(atomSites.getFract_transf_matrix23()), Double.parseDouble(atomSites.getFract_transf_vector2()), Double.parseDouble(atomSites.getFract_transf_matrix31()), Double.parseDouble(atomSites.getFract_transf_matrix32()), Double.parseDouble(atomSites.getFract_transf_matrix33()), Double.parseDouble(atomSites.getFract_transf_vector3()), 0,0,0,1); parsedScaleMatrix = m; } catch (NumberFormatException e) { logger.warn("Some values in _atom_sites.fract_transf_matrix or _atom_sites.fract_transf_vector could not be parsed as numbers. Can't check whether coordinate frame convention is correct! Error: {}", e.getMessage()); structure.getPDBHeader().getCrystallographicInfo().setNonStandardCoordFrameConvention(false); // in this case parsedScaleMatrix stays null and can't be used in documentEnd() } }
/** * Whether this Structure is a crystallographic structure or not. * It will first check the experimental technique and if not present it will try * to guess from the presence of a space group and sensible cell parameters * * @return true if crystallographic, false otherwise */ @Override public boolean isCrystallographic() { if (pdbHeader.getExperimentalTechniques()!=null) { return ExperimentalTechnique.isCrystallographic(pdbHeader.getExperimentalTechniques()); } else { // no experimental technique known, we try to guess... if (pdbHeader.getCrystallographicInfo().getSpaceGroup()!=null) { // space group defined but no crystal cell: incomplete info, return false return pdbHeader.getCrystallographicInfo().getCrystalCell() != null && pdbHeader.getCrystallographicInfo().getCrystalCell().isCellReasonable(); } } return false; }
/** * Whether this Structure is a NMR structure or not. * It will first check the experimental technique and if not present it will try * to guess from the presence of more than 1 model and from b-factors being 0 in first chain of first model * @return true if NMR, false otherwise */ @Override public boolean isNmr() { // old implementation was: //return nmrflag; if (pdbHeader.getExperimentalTechniques()!=null) { return ExperimentalTechnique.isNmr(pdbHeader.getExperimentalTechniques()); } else { // no experimental technique known, we try to guess... if (nrModels()>1) { if (pdbHeader.getCrystallographicInfo().getSpaceGroup()!=null) { // multimodel, sg defined, but missing cell: must be NMR if (pdbHeader.getCrystallographicInfo().getCrystalCell()==null) return true; // multi-model, sg defined and cell unreasonable: must be NMR if (!pdbHeader.getCrystallographicInfo().getCrystalCell().isCellReasonable()) return true; } else { // multi-model and missing space group: must be NMR return true; } } } return false; }
@Override public void newCell(Cell cell) { try { float a = Float.parseFloat(cell.getLength_a()); float b = Float.parseFloat(cell.getLength_b()); float c = Float.parseFloat(cell.getLength_c()); float alpha = Float.parseFloat(cell.getAngle_alpha()); float beta = Float.parseFloat(cell.getAngle_beta()); float gamma = Float.parseFloat(cell.getAngle_gamma()); CrystalCell xtalCell = new CrystalCell(); xtalCell.setA(a); xtalCell.setB(b); xtalCell.setC(c); xtalCell.setAlpha(alpha); xtalCell.setBeta(beta); xtalCell.setGamma(gamma); if (!xtalCell.isCellReasonable()) { // If the entry describes a structure determined by a technique other than X-ray crystallography, // cell is (sometimes!) a = b = c = 1.0, alpha = beta = gamma = 90 degrees // if so we don't add and CrystalCell will be null logger.debug("The crystal cell read from file does not have reasonable dimensions (at least one dimension is below {}), discarding it.", CrystalCell.MIN_VALID_CELL_SIZE); return; } structure.getPDBHeader().getCrystallographicInfo().setCrystalCell(xtalCell); } catch (NumberFormatException e){ structure.getPDBHeader().getCrystallographicInfo().setCrystalCell(null); logger.info("could not parse some cell parameters ("+e.getMessage()+"), ignoring _cell "); } }
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()));