/** * Converts an Atom object to an {@link AtomSite} object. * @param a * @param model the model number for the output AtomSites * @param chainName the chain identifier (author id) for the output AtomSites * @param chainId the internal chain identifier (asym id) for the output AtomSites * @return */ public static AtomSite convertAtomToAtomSite(Atom a, int model, String chainName, String chainId) { return convertAtomToAtomSite(a, model, chainName, chainId, a.getPDBserial()); }
/** * Prints the connections in PDB style * * Rewritten since 5.0 to use {@link Bond}s * Will produce strictly one CONECT record per bond (won't group several bonds in one line) */ private String printPDBConnections(){ StringBuilder str = new StringBuilder(); for (Chain c:structure.getChains()) { for (Group g:c.getAtomGroups()) { for (Atom a:g.getAtoms()) { if (a.getBonds()!=null) { for (Bond b:a.getBonds()) { //7890123456789012345678901234567890123456789012345678901234567890 str.append(String.format("CONECT%5d%5d "+newline, b.getAtomA().getPDBserial(), b.getAtomB().getPDBserial())); } } } } } return str.toString(); }
public boolean hasContact(Atom atom1, Atom atom2) { return hasContact( new AtomIdentifier(atom1.getPDBserial(),atom1.getGroup().getChainId()), new AtomIdentifier(atom2.getPDBserial(),atom2.getGroup().getChainId()) ); }
/** * Returns the corresponding AtomContact or null if no contact exists between the 2 given atoms * @param atom1 * @param atom2 * @return */ public AtomContact getContact(Atom atom1, Atom atom2) { return contacts.get(new Pair<AtomIdentifier>( new AtomIdentifier(atom1.getPDBserial(),atom1.getGroup().getChainId()), new AtomIdentifier(atom2.getPDBserial(),atom2.getGroup().getChainId()) )); }
continue ; uniqueAtomSites.put(a.getPDBserial(), convertAtomToAtomSite(a, model, chainName, chainId));
int seri = a.getPDBserial() ; String serial = String.format("%5d",seri); String fullName = formatAtomName(a);
O.getPDBserial(),N.getPDBserial(),dno,dho,dhc,dnc,dno); logger.debug(" N ({}) O({}): {} : {} ",N.getPDBserial(),O.getPDBserial(),(float) dno,energy);
/** * {@inheritDoc} */ @Override public void addAtom(Atom atom){ atom.setGroup(this); atoms.add(atom); // TODO this check is useless, coords are always !=null since they are initialized to 0,0,0 in AtomImpl constructor. We need to review this - JD 2016-09-14 if (atom.getCoordsAsPoint3d() != null){ // we have got coordinates! setPDBFlag(true); } if (atomNameLookup != null){ Atom existingAtom = atomNameLookup.put(atom.getName(), atom); // if an atom with same name is added to the group that has to be some kind of problem, // we need to warn properly if (existingAtom != null) { String altLocStr = ""; char altLoc = atom.getAltLoc(); if (altLoc != ' ') altLocStr = "(alt loc '" + altLoc + "')"; logger.warn("An atom with name " + atom.getName() + " " + altLocStr + " is already present in group: " + this.toString() + ". The atom with serial " + atom.getPDBserial() + " will be ignored in look-ups."); } } };
logger.warn("Unrecognised atom "+atom.getName()+" with serial "+atom.getPDBserial()+ ", assigning the default vdw radius (Nitrogen vdw radius)."); return Element.N.getVDWRadius(); atom.getPDBserial()+", assigning its default vdw radius"); return atom.getElement().getVDWRadius();
int bondOrder = chemCompBond.getNumericalBondOrder(); logger.debug("Forming bond between atoms {}-{} and {}-{} with bond order {}", a.getPDBserial(), a.getName(), b.getPDBserial(), b.getName(), bondOrder); new BondImpl(a, b, bondOrder);
private Pair<AtomIdentifier> getAtomIdPairFromContact(AtomContact contact) { Pair<AtomIdentifier> pair = new Pair<AtomIdentifier>( new AtomIdentifier(contact.getPair().getFirst().getPDBserial(),contact.getPair().getFirst().getGroup().getChainId()), new AtomIdentifier(contact.getPair().getSecond().getPDBserial(),contact.getPair().getSecond().getGroup().getChainId())); return pair; }
mmtfDecoderInterface.setAtomInfo(atom.getName(), atom.getPDBserial(), altLoc, (float) atom.getX(), (float) atom.getY(), (float) atom.getZ(), atom.getOccupancy(), atom.getTempFactor(), atom.getElement().toString(), atom.getCharge());
Atom atom = atoms.get(atomnr); xw.openTag("atom"); xw.attribute("atomID",Integer.toString(atom.getPDBserial())); xw.attribute("atomName",formatAtomName(atom)); xw.attribute("x",Double.toString(atom.getX()));