Search in sources :

Example 1 with StructureException

use of org.biojava.nbio.structure.StructureException in project jstructure by JonStargaryen.

the class SecondaryStructureAnnotatorTest method getDSSPAnnotatedStructure.

private String getDSSPAnnotatedStructure(String id) throws IOException, StructureException {
    // load structure
    Structure protein = new PDBFileReader().getStructureById(id);
    // assign states
    new SecStrucCalc().calculate(protein, true);
    // return complete DSSP annotation string from BioJava
    return protein.getChains().stream().flatMap(chain -> chain.getAtomGroups(GroupType.AMINOACID).stream()).map(aminoAcid -> aminoAcid.getProperty(Group.SEC_STRUC)).map(SecStrucState.class::cast).map(SecStrucState::getType).map(type -> String.valueOf(type.type)).collect(Collectors.joining());
}
Also used : PDBFileReader(org.biojava.nbio.structure.io.PDBFileReader) AbstractFeatureProvider(de.bioforscher.jstructure.model.feature.AbstractFeatureProvider) ProteinParser(de.bioforscher.jstructure.parser.ProteinParser) Test(org.junit.Test) IOException(java.io.IOException) Collectors(java.util.stream.Collectors) StructureException(org.biojava.nbio.structure.StructureException) SecStrucState(org.biojava.nbio.structure.secstruc.SecStrucState) Group(org.biojava.nbio.structure.Group) Structure(org.biojava.nbio.structure.Structure) SecStrucCalc(org.biojava.nbio.structure.secstruc.SecStrucCalc) Protein(de.bioforscher.jstructure.model.structure.Protein) Assert(org.junit.Assert) GroupType(org.biojava.nbio.structure.GroupType) PDBFileReader(org.biojava.nbio.structure.io.PDBFileReader) FeatureProviderRegistry(de.bioforscher.jstructure.model.feature.FeatureProviderRegistry) Before(org.junit.Before) SecStrucCalc(org.biojava.nbio.structure.secstruc.SecStrucCalc) SecStrucState(org.biojava.nbio.structure.secstruc.SecStrucState) Structure(org.biojava.nbio.structure.Structure)

Aggregations

AbstractFeatureProvider (de.bioforscher.jstructure.model.feature.AbstractFeatureProvider)1 FeatureProviderRegistry (de.bioforscher.jstructure.model.feature.FeatureProviderRegistry)1 Protein (de.bioforscher.jstructure.model.structure.Protein)1 ProteinParser (de.bioforscher.jstructure.parser.ProteinParser)1 IOException (java.io.IOException)1 Collectors (java.util.stream.Collectors)1 Group (org.biojava.nbio.structure.Group)1 GroupType (org.biojava.nbio.structure.GroupType)1 Structure (org.biojava.nbio.structure.Structure)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 Test (org.junit.Test)1