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

pl.poznan.put.protein.Chi1 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 Chi1 {
  public static final Quadruple ARGININE_ATOMS =
      ImmutableQuadruple.of(AtomName.N, AtomName.CA, AtomName.CB, AtomName.CG);
  public static final Quadruple ASPARAGINE_ATOMS =
      ImmutableQuadruple.of(AtomName.N, AtomName.CA, AtomName.CB, AtomName.CG);
  public static final Quadruple ASPARTIC_ACID_ATOMS =
      ImmutableQuadruple.of(AtomName.N, AtomName.CA, AtomName.CB, AtomName.CG);
  public static final Quadruple CYSTEINE_ATOMS =
      ImmutableQuadruple.of(AtomName.N, AtomName.CA, AtomName.CB, AtomName.SG);
  public static final Quadruple GLUTAMIC_ACID_ATOMS =
      ImmutableQuadruple.of(AtomName.N, AtomName.CA, AtomName.CB, AtomName.CG);
  public static final Quadruple GLUTAMINE_ATOMS =
      ImmutableQuadruple.of(AtomName.N, AtomName.CA, AtomName.CB, AtomName.CG);
  public static final Quadruple HISTIDINE_ATOMS =
      ImmutableQuadruple.of(AtomName.N, AtomName.CA, AtomName.CB, AtomName.CG);
  public static final Quadruple ISOLEUCINE_ATOMS =
      ImmutableQuadruple.of(AtomName.N, AtomName.CA, AtomName.CB, AtomName.CG1);
  public static final Quadruple LEUCINE_ATOMS =
      ImmutableQuadruple.of(AtomName.N, AtomName.CA, AtomName.CB, AtomName.CG);
  public static final Quadruple LYSINE_ATOMS =
      ImmutableQuadruple.of(AtomName.N, AtomName.CA, AtomName.CB, AtomName.CG);
  public static final Quadruple METHIONINE_ATOMS =
      ImmutableQuadruple.of(AtomName.N, AtomName.CA, AtomName.CB, AtomName.CG);
  public static final Quadruple PHENYLALANINE_ATOMS =
      ImmutableQuadruple.of(AtomName.N, AtomName.CA, AtomName.CB, AtomName.CG);
  public static final Quadruple PROLINE_ATOMS =
      ImmutableQuadruple.of(AtomName.N, AtomName.CA, AtomName.CB, AtomName.CG);
  public static final Quadruple SERINE_ATOMS =
      ImmutableQuadruple.of(AtomName.N, AtomName.CA, AtomName.CB, AtomName.OG);
  public static final Quadruple THREONINE_ATOMS =
      ImmutableQuadruple.of(AtomName.N, AtomName.CA, AtomName.CB, AtomName.OG1);
  public static final Quadruple TRYPTOPHAN_ATOMS =
      ImmutableQuadruple.of(AtomName.N, AtomName.CA, AtomName.CB, AtomName.CG);
  public static final Quadruple TYROSINE_ATOMS =
      ImmutableQuadruple.of(AtomName.N, AtomName.CA, AtomName.CB, AtomName.CG);
  public static final Quadruple VALINE_ATOMS =
      ImmutableQuadruple.of(AtomName.N, AtomName.CA, AtomName.CB, AtomName.CG1);

  private static final Map, TorsionAngleType> ANGLE_MAP =
      Stream.of(
              Chi1.ARGININE_ATOMS,
              Chi1.ASPARAGINE_ATOMS,
              Chi1.ASPARTIC_ACID_ATOMS,
              Chi1.CYSTEINE_ATOMS,
              Chi1.GLUTAMIC_ACID_ATOMS,
              Chi1.GLUTAMINE_ATOMS,
              Chi1.HISTIDINE_ATOMS,
              Chi1.ISOLEUCINE_ATOMS,
              Chi1.LEUCINE_ATOMS,
              Chi1.LYSINE_ATOMS,
              Chi1.METHIONINE_ATOMS,
              Chi1.PHENYLALANINE_ATOMS,
              Chi1.PROLINE_ATOMS,
              Chi1.SERINE_ATOMS,
              Chi1.THREONINE_ATOMS,
              Chi1.TRYPTOPHAN_ATOMS,
              Chi1.VALINE_ATOMS)
          .collect(Collectors.toSet())
          .stream()
          .collect(
              Collectors.toMap(
                  Function.identity(),
                  quad ->
                      ImmutableAtomBasedTorsionAngleType.of(
                          MoleculeType.PROTEIN,
                          Unicode.CHI1,
                          "chi1",
                          quad,
                          ImmutableQuadruple.of(0, 0, 0, 0))));

  private Chi1() {
    super();
  }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy