Search in sources :

Example 31 with Structure

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

the class ProteinLigandInteractionProfiler method parseHydrophobicInteractions.

private void parseHydrophobicInteractions(Structure structure, Element interactionElement, List<Interaction> interactions) {
    Elements hydrophobicInteractions = interactionElement.getElementsByTag("hydrophobic_interaction");
    hydrophobicInteractions.stream().map(element -> parseHydrophobicInteraction(structure, element)).filter(Optional::isPresent).map(Optional::get).forEach(interactions::add);
}
Also used : java.util(java.util) Logger(org.slf4j.Logger) ComputationException(de.bioforscher.jstructure.model.feature.ComputationException) ExternalLocalService(de.bioforscher.jstructure.service.ExternalLocalService) Files(java.nio.file.Files) URL(java.net.URL) LoggerFactory(org.slf4j.LoggerFactory) Structure(de.bioforscher.jstructure.model.structure.Structure) IOException(java.io.IOException) InputStreamReader(java.io.InputStreamReader) Collectors(java.util.stream.Collectors) UncheckedIOException(java.io.UncheckedIOException) Stream(java.util.stream.Stream) de.bioforscher.jstructure.feature.plip.model(de.bioforscher.jstructure.feature.plip.model) Group(de.bioforscher.jstructure.model.structure.Group) URLConnection(java.net.URLConnection) Atom(de.bioforscher.jstructure.model.structure.Atom) Document(org.jsoup.nodes.Document) Element(org.jsoup.nodes.Element) Chain(de.bioforscher.jstructure.model.structure.Chain) Jsoup(org.jsoup.Jsoup) Elements(org.jsoup.select.Elements) BufferedReader(java.io.BufferedReader) Path(java.nio.file.Path) Elements(org.jsoup.select.Elements)

Example 32 with Structure

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

the class ProteinLigandInteractionProfilerTest method test_ligand_1h2t.

@Test
public void test_ligand_1h2t() {
    Structure structure = StructureParser.fromPdbId("1h2t").parse();
    Group ligand = structure.select().chainId("Z").residueNumber(1151).asGroup();
    InteractionContainer interactions = instance.annotateLigandInteractions(structure).getSubsetOfInteractions(ligand);
    Assert.assertFalse(interactions.getInteractions().isEmpty());
// TODO offset in renumbering of residues
// Group res20 = structure.getGroups().get(21);
// Group res43 = structure.select().residueNumber(43).asGroup();
// Group res112 = structure.select().residueNumber(112).asGroup();
// Group res116 = structure.select().residueNumber(116).asGroup();
// Assert.assertFalse(interactions.getSubsetOfInteractions(res20).getPiStackingInteractions().isEmpty());
// Assert.assertFalse(interactions.getSubsetOfInteractions(res43).getPiStackingInteractions().isEmpty());
// Assert.assertFalse(interactions.getSubsetOfInteractions(res112).getHydrogenBonds().isEmpty());
// Assert.assertFalse(interactions.getSubsetOfInteractions(res116).getSaltBridges().isEmpty());
}
Also used : InteractionContainer(de.bioforscher.jstructure.feature.plip.model.InteractionContainer) Group(de.bioforscher.jstructure.model.structure.Group) Structure(de.bioforscher.jstructure.model.structure.Structure) Test(org.junit.Test)

Example 33 with Structure

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

the class ProteinLigandInteractionProfilerTest method test_ligand_3g1h.

@Test
public void test_ligand_3g1h() {
    Structure structure = StructureParser.fromPdbId("3g1h").parse();
    InteractionContainer interactionContainer = instance.annotateLigandInteractions(structure);
    // there are strange effects regarding how interactions are associated to individual ligands
    Group ligand_H2U_A_229 = structure.select().chainId("A").residueNumber(229).asGroup();
    InteractionContainer ic_H2U_A_229 = interactionContainer.getSubsetOfInteractions(ligand_H2U_A_229);
    Assert.assertEquals("hydrophobic count does not match", 1, ic_H2U_A_229.getHydrophobicInteractions().size());
    Assert.assertEquals("hydrogen bond count does not match", 9, ic_H2U_A_229.getHydrogenBonds().size());
    Assert.assertEquals("water bridge count does not match", // offset between PLIP CLI and web server
    4 + 1, ic_H2U_A_229.getWaterBridges().size());
    Assert.assertEquals("salt bridge count does not match", 1, ic_H2U_A_229.getSaltBridges().size());
}
Also used : InteractionContainer(de.bioforscher.jstructure.feature.plip.model.InteractionContainer) Group(de.bioforscher.jstructure.model.structure.Group) Structure(de.bioforscher.jstructure.model.structure.Structure) Test(org.junit.Test)

Example 34 with Structure

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

the class SecondaryStructureElementTest method shouldFailOnStructureWithNonStandardAminoAcids.

@Test(expected = ComputationException.class)
public void shouldFailOnStructureWithNonStandardAminoAcids() {
    String pdbId = "5tcx";
    Structure structure = StructureParser.fromPdbId(pdbId).minimalParsing(true).parse();
    structure.aminoAcids().forEach(aminoAcid -> aminoAcid.getFeature(GenericSecondaryStructure.class).getSurroundingSecondaryStructureElement(aminoAcid));
}
Also used : Structure(de.bioforscher.jstructure.model.structure.Structure) Test(org.junit.Test)

Example 35 with Structure

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

the class SecondaryStructureElementTest method shouldHandleStructureWithNonStandardAminoAcids.

@Test
public void shouldHandleStructureWithNonStandardAminoAcids() {
    String pdbId = "5tcx";
    Structure structure = StructureParser.fromPdbId(pdbId).parse();
    structure.aminoAcids().forEach(aminoAcid -> aminoAcid.getFeature(GenericSecondaryStructure.class).getSurroundingSecondaryStructureElement(aminoAcid));
}
Also used : Structure(de.bioforscher.jstructure.model.structure.Structure) Test(org.junit.Test)

Aggregations

Structure (de.bioforscher.jstructure.model.structure.Structure)61 IOException (java.io.IOException)45 Collectors (java.util.stream.Collectors)40 Chain (de.bioforscher.jstructure.model.structure.Chain)39 Files (java.nio.file.Files)35 StructureParser (de.bioforscher.jstructure.model.structure.StructureParser)30 Path (java.nio.file.Path)26 AminoAcid (de.bioforscher.jstructure.model.structure.aminoacid.AminoAcid)23 List (java.util.List)22 StandardFormat (de.bioforscher.jstructure.StandardFormat)21 Logger (org.slf4j.Logger)20 LoggerFactory (org.slf4j.LoggerFactory)20 Test (org.junit.Test)19 Group (de.bioforscher.jstructure.model.structure.Group)18 UncheckedIOException (java.io.UncheckedIOException)18 Pattern (java.util.regex.Pattern)17 Stream (java.util.stream.Stream)17 Jsoup (org.jsoup.Jsoup)17 ComputationException (de.bioforscher.jstructure.model.feature.ComputationException)16 java.util (java.util)15