All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pl.poznan.put.protein.Chi3 Maven / Gradle / Ivy

package pl.poznan.put.protein;

import pl.poznan.put.atom.AtomName;
import pl.poznan.put.constant.Unicode;
import pl.poznan.put.pdb.analysis.MoleculeType;
import pl.poznan.put.torsion.ImmutableAtomBasedTorsionAngleType;
import pl.poznan.put.torsion.TorsionAngleType;
import pl.poznan.put.types.ImmutableQuadruple;
import pl.poznan.put.types.Quadruple;

import java.util.Collection;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;

final class Chi3 {
  public static final Quadruple ARGININE_ATOMS =
      ImmutableQuadruple.of(AtomName.CB, AtomName.CG, AtomName.CD, AtomName.NE);
  public static final Quadruple GLUTAMIC_ACID_ATOMS =
      ImmutableQuadruple.of(AtomName.CB, AtomName.CG, AtomName.CD, AtomName.OE1);
  public static final Quadruple GLUTAMINE_ATOMS =
      ImmutableQuadruple.of(AtomName.CB, AtomName.CG, AtomName.CD, AtomName.OE1);
  public static final Quadruple LYSINE_ATOMS =
      ImmutableQuadruple.of(AtomName.CB, AtomName.CG, AtomName.CD, AtomName.CE);
  public static final Quadruple METHIONINE_ATOMS =
      ImmutableQuadruple.of(AtomName.CB, AtomName.CG, AtomName.SD, AtomName.CE);

  private static final Map, TorsionAngleType> ANGLE_MAP =
      Stream.of(
              Chi3.ARGININE_ATOMS,
              Chi3.GLUTAMIC_ACID_ATOMS,
              Chi3.GLUTAMINE_ATOMS,
              Chi3.LYSINE_ATOMS,
              Chi3.METHIONINE_ATOMS)
          .collect(Collectors.toSet())
          .stream()
          .collect(
              Collectors.toMap(
                  Function.identity(),
                  quad ->
                      ImmutableAtomBasedTorsionAngleType.of(
                          MoleculeType.PROTEIN,
                          Unicode.CHI3,
                          "chi3",
                          quad,
                          ImmutableQuadruple.of(0, 0, 0, 0))));

  private Chi3() {
    super();
  }

  public static Collection angleTypes() {
    return Chi3.ANGLE_MAP.values();
  }

  public static TorsionAngleType getInstance(final Quadruple chiAtoms) {
    return Chi3.ANGLE_MAP.get(chiAtoms);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy