private static CharSequence getPDBPos(Atom atom) { Group g = atom.getGroup(); if ( g!= null){ Chain c = g.getChain(); if (c != null){ return g.getResidueNumber().toString()+":" + c.getName() ; //return g.getPDBCode()+":" + c.getName() + "." + getOneLetter(g) ; } } return "!"; }
private void rot_mol(Atom[] caA, Atom[] caB, int nse2, Matrix m , Atom shift) throws StructureException{ for(int l=0; l<nse2; l++) { Atom a = caA[l]; Group g = (Group)a.getGroup().clone(); //Group g = (Group)a.getParent(); Calc.rotate( g, m); Calc.shift( g, shift); caB[l] = g.getAtom(a.getName()); } }
/** * Adds a chain to the given structure to form a biological assembly, * adding the symmetry-expanded chains as new chains with renamed * chain ids and names (in the form originalAsymId_transformId and originalAuthId_transformId). * @param s * @param newChain * @param transformId */ private void addChainFlattened(Structure s, Chain newChain, String transformId) { newChain.setId(newChain.getId()+"_"+transformId); newChain.setName(newChain.getName()+"_"+transformId); s.addChain(newChain); }
/** * Check to see if an Deuterated atom has a non deuterated brother in the group. * @param atom the input atom that is putatively deuterium * @param currentGroup the group the atom is in * @return true if the atom is deuterated and it's hydrogen equive exists. */ public static boolean hasNonDeuteratedEquiv(Atom atom, Group currentGroup) { if(atom.getElement()==Element.D && currentGroup.hasAtom(replaceFirstChar(atom.getName(),'D', 'H'))) { // If it's deuterated and has a non-deuterated brother return true; } return false; }
private int getInternalNr(Group atomG) { if ( atomG.getType().equals(GroupType.AMINOACID)) { AminoAcidImpl aa = (AminoAcidImpl) atomG; return new Long(aa.getId()).intValue(); } else if ( atomG.getType().equals(GroupType.NUCLEOTIDE)) { NucleotideImpl nu = (NucleotideImpl) atomG; return new Long(nu.getId()).intValue(); } else { HetatomImpl he = (HetatomImpl) atomG; return new Long(he.getId()).intValue(); } }
/** * Translates a chain object, given a Vector3d (i.e. the vecmath library * double-precision 3-d vector) * * @param chain * @param v */ public static final void translate (Chain chain, Vector3d v) { for (Group g:chain.getAtomGroups()) { translate(g, v); } }
/** * Transforms a chain object, given a Matrix4d (i.e. the vecmath library * double-precision 4x4 rotation+translation matrix). The transformation * Matrix must be a post-multiplication Matrix. * * @param chain * @param m */ public static final void transform (Chain chain, Matrix4d m) { for (Group g : chain.getAtomGroups()) { transform(g, m); } }
/** {@inheritDoc} */ @Override public Chain getChainByPDB(String chainId) throws StructureException{ if(nrModels() < 1 ) { throw new StructureException("No chains are present."); } return getChainByPDB(chainId,0); }
private int getGroupNoHSize() { int count = 0; for (Atom atom:g.getAtoms()) { if (atom.getElement()!=Element.H) count++; } return count; }
/** {@inheritDoc} */ @Override public Chain getChainByPDB(String authId, int modelnr) throws StructureException{ Chain c = getPolyChainByPDB(authId, modelnr); if (c==null ) { throw new StructureException("Could not find chain with authId \"" + authId + "\"" + " for PDB id " + pdb_id + ", model "+modelnr); } return c; }
/** * {@inheritDoc} */ @Override public void setChain(Chain chain) { this.parent = chain; //TODO: setChain(), getChainName() and ResidueNumber.set/getChainName() are //duplicating functionality at present and could give different values. if (residueNumber != null) { residueNumber.setChainName(chain.getName()); } }
@Override public boolean isPureNonPolymer() { for (Group g : getAtomGroups()) { //ChemComp cc = g.getChemComp(); if ( g.isPolymeric() && !g.isHetAtomInFile() ) { // important: the aminoacid or nucleotide residue can be in Atom records return false; } } return true; }
@Override public EntityType getEntityType() { if (getEntityInfo()==null) return null; return getEntityInfo().getType(); }
@Override public Structure reduce(Structure input) throws StructureException { return toCanonical().reduce(input); } /**
@Override public boolean isWaterOnly() { for (Group g : getAtomGroups()) { if (!g.isWater()) return false; } return true; }
private void rot_mol(Atom[] caA, Atom[] caB, int nse2, Matrix m , Atom shift) throws StructureException{ for(int l=0; l<nse2; l++) { Atom a = caA[l]; Group g = (Group)a.getGroup().clone(); //Group g = (Group)a.getParent(); Calc.rotate( g, m); Calc.shift( g, shift); caB[l] = g.getAtom(a.getName()); } }
/** * Check to see if a Hydrogen has a Deuterated brother in the group. * @param atom the input atom that is putatively hydorgen * @param currentGroup the group the atom is in * @return true if the atom is hydrogen and it's Deuterium equiv exists. */ public static boolean hasDeuteratedEquiv(Atom atom, Group currentGroup) { if(atom.getElement()==Element.H && currentGroup.hasAtom(replaceFirstChar(atom.getName(),'H', 'D'))) { // If it's hydrogen and has a deuterated brother return true; } return false; }