/** * Removes all polymeric and solvent groups from a list of groups * */ public static List<Group> filterLigands(List<Group> allGroups) { List<Group> groups = new ArrayList<Group>(); for (Group g : allGroups) { if ( g.isPolymeric()) continue; if (!g.isWater()) { groups.add(g); } } return groups; }
@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; }
if(g.isPolymeric() ) {
.filter( (g) -> !g.isPolymeric() ) // already shouldn't be polymeric, but filter anyways