Search in sources :

Example 6 with AtomContainer

use of de.bioforscher.jstructure.model.structure.container.AtomContainer in project jstructure by JonStargaryen.

the class StructureCollectorsTest method shouldCreateDistinctContainer.

@Test
public void shouldCreateDistinctContainer() {
    // create copy
    AminoAcid original = protein.select().aminoAcids().asAminoAcid();
    String initialPdbRecord = original.getPdbRepresentation();
    AtomContainer copy = original.createDeepCopy();
    // manipulate coordinates of copy
    copy.getAtoms().get(0).setCoordinates(new double[] { 0, 0, 0 });
    // should not affect original
    Assert.assertNotEquals(initialPdbRecord, copy.getPdbRepresentation());
    Assert.assertEquals(initialPdbRecord, original.getPdbRepresentation());
}
Also used : AminoAcid(de.bioforscher.jstructure.model.structure.aminoacid.AminoAcid) AtomContainer(de.bioforscher.jstructure.model.structure.container.AtomContainer) Test(org.junit.Test)

Example 7 with AtomContainer

use of de.bioforscher.jstructure.model.structure.container.AtomContainer in project jstructure by JonStargaryen.

the class SelectionTest method shouldSelectAtomsFromGroupsFromChains.

@Test
public void shouldSelectAtomsFromGroupsFromChains() {
    System.out.println("alpha carbons and beta carbons of PHEs in chain 'A' and 'C'");
    AtomContainer atoms = protein.select().chainName("A", "C").groupName(Phenylalanine.THREE_LETTER_CODE).atomName(AminoAcid.ALPHA_CARBON_NAME, AminoAcid.BETA_CARBON_NAME).asIsolatedStructure();
    System.out.println(atoms.getPdbRepresentation());
}
Also used : AtomContainer(de.bioforscher.jstructure.model.structure.container.AtomContainer) Test(org.junit.Test)

Aggregations

AtomContainer (de.bioforscher.jstructure.model.structure.container.AtomContainer)7 Test (org.junit.Test)6 Transformation (de.bioforscher.jstructure.mathematics.Transformation)1 AminoAcid (de.bioforscher.jstructure.model.structure.aminoacid.AminoAcid)1 GroupContainer (de.bioforscher.jstructure.model.structure.container.GroupContainer)1 Array2DRowRealMatrix (org.apache.commons.math3.linear.Array2DRowRealMatrix)1 LUDecomposition (org.apache.commons.math3.linear.LUDecomposition)1 RealMatrix (org.apache.commons.math3.linear.RealMatrix)1 SingularValueDecomposition (org.apache.commons.math3.linear.SingularValueDecomposition)1