/** * {@inheritDoc} */ @Override public List<Group> getAtomGroups(GroupType type){ List<Group> tmp = new ArrayList<>() ; for (Group g : groups) { if (g.getType().equals(type)) { tmp.add(g); } } return tmp ; }
/** * Bundles everything not in AMINOACID or NUCLEOTIDE into the HETATM entry * @return */ private static Set<ResidueType> getHetatmTypes() { Set<ResidueType> unmatched = new HashSet<ResidueType>(); for(ResidueType restype : ResidueType.values()) { if(!AMINOACID.getResidueTypes().contains(restype) && !NUCLEOTIDE.getResidueTypes().contains(restype) ) { unmatched.add(restype); } } return Collections.unmodifiableSet(unmatched); } }
xw.openTag("group"); xw.attribute("name",gr.getPDBName()); xw.attribute("type",gr.getType().toString()); xw.attribute("groupID",gr.getResidueNumber().toString());
/** * {@inheritDoc} */ @Override public List<Group> getSeqResGroups(GroupType type) { List<Group> tmp = new ArrayList<>() ; for (Group g : seqResGroups) { if (g.getType().equals(type)) { tmp.add(g); } } return tmp ; }
/** * Returns the relative (complexed) ASA, i.e. the ASA of the residue * with respect to its ASA in an extended tri-peptide conformation (GLY-x-GLY) * @return */ public double getRelativeAsaC() { if (!g.getType().equals(GroupType.AMINOACID)) throw new IllegalArgumentException("Can not calculate relative ASA for non amino-acid"); char aa = ((AminoAcid)g).getAminoType(); return (asaC/tripeptAsa.get(aa)); }
/** * Returns the relative (uncomplexed) ASA, i.e. the ASA of the residue * with respect to its ASA in an extended tri-peptide conformation (GLY-x-GLY) * @return */ public double getRelativeAsaU() { if (!g.getType().equals(GroupType.AMINOACID)) throw new IllegalArgumentException("Can not calculate relative ASA for non amino-acid"); char aa = ((AminoAcid)g).getAminoType(); return (asaU/tripeptAsa.get(aa)); }
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(); } }
private void recordUnidentifiableModifiedResidues(List<ModifiedCompound> modComps) { Set<StructureGroup> identifiedComps = new HashSet<StructureGroup>(); for (ModifiedCompound mc : modComps) { identifiedComps.addAll(mc.getGroups(true)); } // TODO: use the ModifiedAminoAcid after Andreas add that. for (Group group : residues) { if (group.getType().equals(GroupType.HETATM)) { StructureGroup strucGroup = StructureUtil.getStructureGroup( group, true); strucGroup.setChainId(group.getChainId()); if (!identifiedComps.contains(strucGroup)) { unidentifiableModifiedResidues.add(strucGroup); } } } }
@Override public boolean isPolymeric() { ChemComp cc = getChemComp(); if ( cc == null) return getType().equals(GroupType.AMINOACID) || getType().equals(GroupType.NUCLEOTIDE); ResidueType rt = cc.getResidueType(); if ( rt.equals(ResidueType.nonPolymer)) return false; PolymerType pt = rt.getPolymerType(); return PolymerType.PROTEIN_ONLY.contains(pt) || PolymerType.POLYNUCLEOTIDE_ONLY.contains(pt) || ResidueType.lPeptideLinking.equals(rt); }
private static final Atom[] getAllNonHAtomArray(Structure s, boolean hetAtoms, AtomIterator iter) { List<Atom> atoms = new ArrayList<Atom>(); while (iter.hasNext()) { Atom a = iter.next(); if (a.getElement() == Element.H) continue; Group g = a.getGroup(); if (g.isWater()) continue; if (!hetAtoms && g.getType().equals(GroupType.HETATM)) continue; atoms.add(a); } return atoms.toArray(new Atom[atoms.size()]); }
/** * Returns and array of all non-Hydrogen atoms in the given molecule, including all * main chain HETATOM groups. Non main-chain HETATOM groups with fewer than minSizeHetAtomToInclude * non-Hydrogen atoms are not included. * @param m * @param minSizeHetAtomToInclude HETATOM groups (non main-chain) with fewer number of * non-Hydrogen atoms are not included * @return */ private static final Atom[] getAllNonHAtomArray(Atom[] m, int minSizeHetAtomToInclude) { List<Atom> atoms = new ArrayList<>(); for (Atom a:m){ if (a.getElement()==Element.H) continue; Group g = a.getGroup(); if (g.getType().equals(GroupType.HETATM) && !isInChain(g) && getSizeNoH(g)<minSizeHetAtomToInclude) { continue; } atoms.add(a); } return atoms.toArray(new Atom[atoms.size()]); }
/** * Returns and array of all non-Hydrogen atoms in the given Chain, * optionally including HET atoms or not Waters are not included. * * @param c * @param hetAtoms * if true HET atoms are included in array, if false they are not * @return */ public static final Atom[] getAllNonHAtomArray(Chain c, boolean hetAtoms) { List<Atom> atoms = new ArrayList<Atom>(); for (Group g : c.getAtomGroups()) { if (g.isWater()) continue; for (Atom a : g.getAtoms()) { if (a.getElement() == Element.H) continue; if (!hetAtoms && g.getType().equals(GroupType.HETATM)) continue; atoms.add(a); } } return atoms.toArray(new Atom[atoms.size()]); }
@Override public boolean isAminoAcid() { ChemComp cc = getChemComp(); if ( cc == null) return getType().equals(GroupType.AMINOACID); ResidueType rt = cc.getResidueType(); if ( rt.equals(ResidueType.nonPolymer)) return false; PolymerType pt = rt.getPolymerType(); return PolymerType.PROTEIN_ONLY.contains(pt); }
@Override public boolean isNucleotide() { ChemComp cc = getChemComp(); if ( cc == null) return getType().equals(GroupType.NUCLEOTIDE); ResidueType rt = cc.getResidueType(); if ( rt.equals(ResidueType.nonPolymer)) return false; PolymerType pt = rt.getPolymerType(); return PolymerType.POLYNUCLEOTIDE_ONLY.contains(pt); }
/** * Returns and array of all non-Hydrogen atoms coordinates in the given Chain, * optionally including HET atoms or not Waters are not included. * * @param c * @param hetAtoms * if true HET atoms are included in array, if false they are not * @return */ public static final Point3d[] getAllNonHCoordsArray(Chain c, boolean hetAtoms) { List<Point3d> atoms = new ArrayList<Point3d>(); for (Group g : c.getAtomGroups()) { if (g.isWater()) continue; for (Atom a : g.getAtoms()) { if (a.getElement() == Element.H) continue; if (!hetAtoms && g.getType().equals(GroupType.HETATM)) continue; atoms.add(a.getCoordsAsPoint3d()); } } return atoms.toArray(new Point3d[atoms.size()]); }
if ( ! pdbNameA.trim().equals(pdbNameS.trim())) { logger.info(s1 + " " + posSeq + " does not align with " + a1+ " " + posAtom + " should be: " + s + " : " + a); if ( s1.getType().equals(HetatomImpl.type) && a1.getType().equals(HetatomImpl.type)){ logger.info("they seem to be hetatoms, so ignoring mismatch.");
if ( type.equals(GroupType.HETATM) ) { record = "HETATM"; } else {
if ( g.getType().equals(GroupType.HETATM) ) { record = "HETATM"; } else {