Search in sources :

Example 1 with DSSPSecondaryStructure

use of de.bioforscher.jstructure.feature.sse.dssp.DSSPSecondaryStructure in project jstructure by JonStargaryen.

the class DictionaryOfProteinSecondaryStructureTest method getSecondaryStructureAnnotation.

private String getSecondaryStructureAnnotation(String id) {
    // load structure
    Structure protein = StructureParser.fromPdbId(id).parse();
    // assign states
    featureProvider.process(protein);
    // return complete DSSP annotation string from jstructrue
    return protein.aminoAcids().map(residue -> residue.getFeature(DSSPSecondaryStructure.class)).map(DSSPSecondaryStructure::getSecondaryStructure).map(SecondaryStructureType::getOneLetterRepresentation).map(character -> character.equals("c") ? " " : character).collect(Collectors.joining());
}
Also used : DSSPSecondaryStructure(de.bioforscher.jstructure.feature.sse.dssp.DSSPSecondaryStructure) Structure(de.bioforscher.jstructure.model.structure.Structure) Test(org.junit.Test) IOException(java.io.IOException) StructureParser(de.bioforscher.jstructure.model.structure.StructureParser) Collectors(java.util.stream.Collectors) StructureException(org.biojava.nbio.structure.StructureException) SecStrucState(org.biojava.nbio.structure.secstruc.SecStrucState) Stream(java.util.stream.Stream) Group(org.biojava.nbio.structure.Group) SecStrucCalc(org.biojava.nbio.structure.secstruc.SecStrucCalc) Assert(org.junit.Assert) GroupType(org.biojava.nbio.structure.GroupType) PDBFileReader(org.biojava.nbio.structure.io.PDBFileReader) DictionaryOfProteinSecondaryStructure(de.bioforscher.jstructure.feature.sse.dssp.DictionaryOfProteinSecondaryStructure) Before(org.junit.Before) DSSPSecondaryStructure(de.bioforscher.jstructure.feature.sse.dssp.DSSPSecondaryStructure) DSSPSecondaryStructure(de.bioforscher.jstructure.feature.sse.dssp.DSSPSecondaryStructure) Structure(de.bioforscher.jstructure.model.structure.Structure) DictionaryOfProteinSecondaryStructure(de.bioforscher.jstructure.feature.sse.dssp.DictionaryOfProteinSecondaryStructure)

Example 2 with DSSPSecondaryStructure

use of de.bioforscher.jstructure.feature.sse.dssp.DSSPSecondaryStructure in project jstructure by JonStargaryen.

the class DictionaryOfProteinSecondaryStructureTest method test1bta.

@Test
public void test1bta() {
    Structure structure = StructureParser.fromPdbId("1bta").parse();
    featureProvider.process(structure);
    structure.aminoAcids().forEach(aminoAcid -> {
        System.out.println(aminoAcid);
        DSSPSecondaryStructure sse = aminoAcid.getFeature(DSSPSecondaryStructure.class);
        System.out.println(sse.getSecondaryStructure().name());
    });
    System.out.println(structure.getFirstChain().aminoAcids().map(aminoAcid -> aminoAcid.getFeature(DSSPSecondaryStructure.class).getSecondaryStructure().getOneLetterRepresentation()).collect(Collectors.joining()));
}
Also used : DSSPSecondaryStructure(de.bioforscher.jstructure.feature.sse.dssp.DSSPSecondaryStructure) DSSPSecondaryStructure(de.bioforscher.jstructure.feature.sse.dssp.DSSPSecondaryStructure) Structure(de.bioforscher.jstructure.model.structure.Structure) DictionaryOfProteinSecondaryStructure(de.bioforscher.jstructure.feature.sse.dssp.DictionaryOfProteinSecondaryStructure) Test(org.junit.Test)

Aggregations

DSSPSecondaryStructure (de.bioforscher.jstructure.feature.sse.dssp.DSSPSecondaryStructure)2 DictionaryOfProteinSecondaryStructure (de.bioforscher.jstructure.feature.sse.dssp.DictionaryOfProteinSecondaryStructure)2 Structure (de.bioforscher.jstructure.model.structure.Structure)2 Test (org.junit.Test)2 StructureParser (de.bioforscher.jstructure.model.structure.StructureParser)1 IOException (java.io.IOException)1 Collectors (java.util.stream.Collectors)1 Stream (java.util.stream.Stream)1 Group (org.biojava.nbio.structure.Group)1 GroupType (org.biojava.nbio.structure.GroupType)1 StructureException (org.biojava.nbio.structure.StructureException)1 PDBFileReader (org.biojava.nbio.structure.io.PDBFileReader)1 SecStrucCalc (org.biojava.nbio.structure.secstruc.SecStrucCalc)1 SecStrucState (org.biojava.nbio.structure.secstruc.SecStrucState)1 Assert (org.junit.Assert)1 Before (org.junit.Before)1