test_class.file: singa-structure/src/test/java/bio/singa/structure/model/oak/StructuresTest.java
test_class.identifier: StructuresTest
test_case.body: @Test
      void renumberStructure() {
          OakStructure structure = ((OakStructure) StructureParser.pdb()
                  .pdbIdentifier("1szi")
                  .chainIdentifier("A")
                  .parse());
          LeafIdentifier leafIdentifier = new LeafIdentifier("1szi", 1, "A", 206);
          Map<LeafIdentifier, Integer> renumberingMap = new TreeMap<>();
          renumberingMap.put(leafIdentifier, 202);
          OakStructure renumberStructure = Structures.renumberStructure(structure, renumberingMap);
          StructureSelector.selectFrom(renumberStructure)
                  .model(1)
                  .chain("A")
                  .aminoAcid(202)
                  .selectAminoAcid();
      }
test_case.class_method_signature: StructuresTest.renumberStructure()
test_case.full_signature: @Test void renumberStructure()
test_case.identifier: renumberStructure
test_case.invocations: parse chainIdentifier pdbIdentifier pdb put renumberStructure selectAminoAcid aminoAcid chain model selectFrom
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void renumberStructure()
focal_class.file: singa-structure/src/main/java/bio/singa/structure/model/oak/Structures.java
focal_class.identifier: Structures
focal_class.class_method_signature: Structures.Structures()
focal_class.full_signature: private  Structures()
focal_class.identifier: Structures
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  Structures()
focal_class.class_method_signature: Structures.calculateDistanceMatrix(LeafSubstructureContainer leafSubstructureContainer)
focal_class.full_signature: public static LabeledSymmetricMatrix<LeafSubstructure<?>> calculateDistanceMatrix(LeafSubstructureContainer leafSubstructureContainer)
focal_class.identifier: calculateDistanceMatrix
focal_class.modifiers: public static
focal_class.parameters: (LeafSubstructureContainer leafSubstructureContainer)
focal_class.return: LabeledSymmetricMatrix<LeafSubstructure<?>>
focal_class.signature: LabeledSymmetricMatrix<LeafSubstructure<?>> calculateDistanceMatrix(LeafSubstructureContainer leafSubstructureContainer)
focal_class.class_method_signature: Structures.calculateSquaredDistanceMatrix(LeafSubstructureContainer leafSubstructureContainer)
focal_class.full_signature: public static LabeledSymmetricMatrix<LeafSubstructure<?>> calculateSquaredDistanceMatrix(LeafSubstructureContainer leafSubstructureContainer)
focal_class.identifier: calculateSquaredDistanceMatrix
focal_class.modifiers: public static
focal_class.parameters: (LeafSubstructureContainer leafSubstructureContainer)
focal_class.return: LabeledSymmetricMatrix<LeafSubstructure<?>>
focal_class.signature: LabeledSymmetricMatrix<LeafSubstructure<?>> calculateSquaredDistanceMatrix(LeafSubstructureContainer leafSubstructureContainer)
focal_class.class_method_signature: Structures.calculateExtent(LeafSubstructureContainer leafSubstructureContainer)
focal_class.full_signature: public static double calculateExtent(LeafSubstructureContainer leafSubstructureContainer)
focal_class.identifier: calculateExtent
focal_class.modifiers: public static
focal_class.parameters: (LeafSubstructureContainer leafSubstructureContainer)
focal_class.return: double
focal_class.signature: double calculateExtent(LeafSubstructureContainer leafSubstructureContainer)
focal_class.class_method_signature: Structures.calculateSquaredExtent(LeafSubstructureContainer leafSubstructureContainer)
focal_class.full_signature: public static double calculateSquaredExtent(LeafSubstructureContainer leafSubstructureContainer)
focal_class.identifier: calculateSquaredExtent
focal_class.modifiers: public static
focal_class.parameters: (LeafSubstructureContainer leafSubstructureContainer)
focal_class.return: double
focal_class.signature: double calculateSquaredExtent(LeafSubstructureContainer leafSubstructureContainer)
focal_class.class_method_signature: Structures.calculateAtomDistanceMatrix(AtomContainer atomContainer)
focal_class.full_signature: public static LabeledSymmetricMatrix<Atom> calculateAtomDistanceMatrix(AtomContainer atomContainer)
focal_class.identifier: calculateAtomDistanceMatrix
focal_class.modifiers: public static
focal_class.parameters: (AtomContainer atomContainer)
focal_class.return: LabeledSymmetricMatrix<Atom>
focal_class.signature: LabeledSymmetricMatrix<Atom> calculateAtomDistanceMatrix(AtomContainer atomContainer)
focal_class.class_method_signature: Structures.calculateAtomDistanceMatrix(List<Atom> atoms)
focal_class.full_signature: public static LabeledSymmetricMatrix<Atom> calculateAtomDistanceMatrix(List<Atom> atoms)
focal_class.identifier: calculateAtomDistanceMatrix
focal_class.modifiers: public static
focal_class.parameters: (List<Atom> atoms)
focal_class.return: LabeledSymmetricMatrix<Atom>
focal_class.signature: LabeledSymmetricMatrix<Atom> calculateAtomDistanceMatrix(List<Atom> atoms)
focal_class.class_method_signature: Structures.isAlphaCarbonStructure(Structure structure)
focal_class.full_signature: public static boolean isAlphaCarbonStructure(Structure structure)
focal_class.identifier: isAlphaCarbonStructure
focal_class.modifiers: public static
focal_class.parameters: (Structure structure)
focal_class.return: boolean
focal_class.signature: boolean isAlphaCarbonStructure(Structure structure)
focal_class.class_method_signature: Structures.isBackboneStructure(Structure structure)
focal_class.full_signature: public static boolean isBackboneStructure(Structure structure)
focal_class.identifier: isBackboneStructure
focal_class.modifiers: public static
focal_class.parameters: (Structure structure)
focal_class.return: boolean
focal_class.signature: boolean isBackboneStructure(Structure structure)
focal_class.class_method_signature: Structures.convertToSpheres(AtomContainer atomContainer)
focal_class.full_signature: public static List<Sphere> convertToSpheres(AtomContainer atomContainer)
focal_class.identifier: convertToSpheres
focal_class.modifiers: public static
focal_class.parameters: (AtomContainer atomContainer)
focal_class.return: List<Sphere>
focal_class.signature: List<Sphere> convertToSpheres(AtomContainer atomContainer)
focal_class.class_method_signature: Structures.calculateTorsionAngle(Atom a, Atom b, Atom c, Atom d)
focal_class.full_signature: public static double calculateTorsionAngle(Atom a, Atom b, Atom c, Atom d)
focal_class.identifier: calculateTorsionAngle
focal_class.modifiers: public static
focal_class.parameters: (Atom a, Atom b, Atom c, Atom d)
focal_class.return: double
focal_class.signature: double calculateTorsionAngle(Atom a, Atom b, Atom c, Atom d)
focal_class.class_method_signature: Structures.renumberStructure(OakStructure structure, Map<LeafIdentifier, Integer> renumberingMap)
focal_class.full_signature: public static OakStructure renumberStructure(OakStructure structure, Map<LeafIdentifier, Integer> renumberingMap)
focal_class.identifier: renumberStructure
focal_class.modifiers: public static
focal_class.parameters: (OakStructure structure, Map<LeafIdentifier, Integer> renumberingMap)
focal_class.return: OakStructure
focal_class.signature: OakStructure renumberStructure(OakStructure structure, Map<LeafIdentifier, Integer> renumberingMap)
focal_class.class_method_signature: Structures.getClosestDistance(AtomContainer atomContainer1, AtomContainer atomContainer2)
focal_class.full_signature: public static double getClosestDistance(AtomContainer atomContainer1, AtomContainer atomContainer2)
focal_class.identifier: getClosestDistance
focal_class.modifiers: public static
focal_class.parameters: (AtomContainer atomContainer1, AtomContainer atomContainer2)
focal_class.return: double
focal_class.signature: double getClosestDistance(AtomContainer atomContainer1, AtomContainer atomContainer2)
focal_class.class_method_signature: Structures.assignBFactors(Structure structure, Map<UniqueAtomIdentifer, Double> factors)
focal_class.full_signature: public static void assignBFactors(Structure structure, Map<UniqueAtomIdentifer, Double> factors)
focal_class.identifier: assignBFactors
focal_class.modifiers: public static
focal_class.parameters: (Structure structure, Map<UniqueAtomIdentifer, Double> factors)
focal_class.return: void
focal_class.signature: void assignBFactors(Structure structure, Map<UniqueAtomIdentifer, Double> factors)
focal_class.class_method_signature: Structures.mapAtomsByCoordinate(Structure structure, Set<Vector3D> coordinates, double eps)
focal_class.full_signature: public static Map<Vector3D, UniqueAtomIdentifer> mapAtomsByCoordinate(Structure structure, Set<Vector3D> coordinates, double eps)
focal_class.identifier: mapAtomsByCoordinate
focal_class.modifiers: public static
focal_class.parameters: (Structure structure, Set<Vector3D> coordinates, double eps)
focal_class.return: Map<Vector3D, UniqueAtomIdentifer>
focal_class.signature: Map<Vector3D, UniqueAtomIdentifer> mapAtomsByCoordinate(Structure structure, Set<Vector3D> coordinates, double eps)
focal_method.body: public static OakStructure renumberStructure(OakStructure structure, Map<LeafIdentifier, Integer> renumberingMap) {
          OakStructure renumberedStructure = new OakStructure();
          renumberedStructure.setPdbIdentifier(structure.getPdbIdentifier());
          for (Model model : structure.getAllModels()) {
              OakModel renumberedModel = new OakModel(model.getModelIdentifier());
              renumberedStructure.addModel(renumberedModel);
              // consecutive parts
              for (Chain chain : model.getAllChains()) {
                  OakChain oakChain = (OakChain) chain;
                  OakChain renumberedChain = new OakChain(chain.getChainIdentifier());
                  renumberedModel.addChain(renumberedChain);
                  for (LeafSubstructure leafSubstructure : oakChain.getConsecutivePart()) {
                      LeafIdentifier originalIdentifier = leafSubstructure.getIdentifier();
                      if (!renumberingMap.containsKey(originalIdentifier)) {
                          continue;
                      }
                      LeafIdentifier renumberedIdentifier = new LeafIdentifier(
                              originalIdentifier.getPdbIdentifier(),
                              originalIdentifier.getModelIdentifier(),
                              originalIdentifier.getChainIdentifier(),
                              renumberingMap.get(originalIdentifier),
                              originalIdentifier.getInsertionCode());
                      OakLeafSubstructure renumberedLeafSubstructure = createLeafSubstructure(renumberedIdentifier, leafSubstructure.getFamily());
                      renumberedChain.addLeafSubstructure(renumberedLeafSubstructure, true);
                      for (Atom atom : leafSubstructure.getAllAtoms()) {
                          OakAtom renumberedAtom = new OakAtom(
                                  atom.getAtomIdentifier(),
                                  atom.getElement(),
                                  atom.getAtomName(),
                                  atom.getPosition());
                          renumberedLeafSubstructure.addAtom(renumberedAtom);
                      }
                  }
              }
              // nonconsecutive parts are copied without renumbering
              for (Chain chain : model.getAllChains()) {
                  OakChain oakChain = (OakChain) chain;
                  OakChain renumberedChain = (OakChain) renumberedModel.getChain(chain.getChainIdentifier()).orElseThrow(NoSuchElementException::new);
                  for (LeafSubstructure leafSubstructure : oakChain.getNonConsecutivePart()) {
                      OakLeafSubstructure renumberedLeafSubstructure = createLeafSubstructure(leafSubstructure.getIdentifier(), leafSubstructure.getFamily());
                      renumberedLeafSubstructure.setAnnotatedAsHetAtom(true);
                      renumberedChain.addLeafSubstructure(renumberedLeafSubstructure);
                      for (Atom atom : leafSubstructure.getAllAtoms()) {
                          OakAtom renumberedAtom = new OakAtom(
                                  atom.getAtomIdentifier(),
                                  atom.getElement(),
                                  atom.getAtomName(),
                                  atom.getPosition());
                          renumberedLeafSubstructure.addAtom(renumberedAtom);
                      }
                  }
              }
          }
          return renumberedStructure;
      }
focal_method.class_method_signature: Structures.renumberStructure(OakStructure structure, Map<LeafIdentifier, Integer> renumberingMap)
focal_method.full_signature: public static OakStructure renumberStructure(OakStructure structure, Map<LeafIdentifier, Integer> renumberingMap)
focal_method.identifier: renumberStructure
focal_method.invocations: setPdbIdentifier getPdbIdentifier getAllModels getModelIdentifier addModel getAllChains getChainIdentifier addChain getConsecutivePart getIdentifier containsKey getPdbIdentifier getModelIdentifier getChainIdentifier get getInsertionCode createLeafSubstructure getFamily addLeafSubstructure getAllAtoms getAtomIdentifier getElement getAtomName getPosition addAtom getAllChains orElseThrow getChain getChainIdentifier getNonConsecutivePart createLeafSubstructure getIdentifier getFamily setAnnotatedAsHetAtom addLeafSubstructure getAllAtoms getAtomIdentifier getElement getAtomName getPosition addAtom
focal_method.modifiers: public static
focal_method.parameters: (OakStructure structure, Map<LeafIdentifier, Integer> renumberingMap)
focal_method.return: OakStructure
focal_method.signature: OakStructure renumberStructure(OakStructure structure, Map<LeafIdentifier, Integer> renumberingMap)