Esempio n. 1
0
 private void addAtomType(String line) {
   List<String> split = reworkLine(line);
   // TODO replace when atom atom translation dictionary exists --> special handling of oplsaa FF
   // produces errors if oplsaa is used
   if (split.size() == 8) {
     String s = split.get(0);
     String s1 = split.get(1);
     split.remove(0);
     split.remove(0);
     split.add(0, s + " " + s1);
   }
   if (split.size() == 7) {
     List<AtomType> atomTypes = structure.getAtomTypes();
     AtomTypeImpl at = new AtomTypeImpl();
     at.setName(split.get(0));
     at.setNum(split.get(1));
     at.setC1(new BigDecimal(split.get(2)));
     at.setC2(new BigDecimal(split.get(3)));
     at.setParticleType(split.get(4));
     at.setC3(new BigDecimal(split.get(5)));
     at.setC4(new BigDecimal(split.get(6)));
     atomTypes.add(at);
   } else {
     ch.printErrorln(String.format("some ATOMTYPES values are lost! --> %s", line));
   }
 }
Esempio n. 2
0
  private void removeUnnecessaryData() {
    Set<AtomType> clear = Sets.newHashSet();
    List<Atom> atoms = Lists.newArrayList();
    List<AtomType> atomTypes = structure.getAtomTypes();

    for (Section section : structure.getSections()) {
      if (section.getSectionType().equals(SectionType.STRUCTUREDATA)) {
        atoms.addAll(section.getAtoms());
      }
    }
    for (AtomType atomType : atomTypes) {
      AtomType delete = atomType;
      for (Atom atom : atoms) {
        if (atomType.getName().contains(atom.getType())) {
          delete = null;
        }
      }
      if (delete != null) {
        clear.add(delete);
      }
    }
    clear.forEach(atomTypes::remove);
  }