Search in sources :

Example 1 with PDBFileReader

use of org.biojava.nbio.structure.io.PDBFileReader 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)

Example 2 with PDBFileReader

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

the class DictionaryOfProteinSecondaryStructureTest method getDSSPAnnotatedStructure.

private String getDSSPAnnotatedStructure(String id) throws IOException, StructureException {
    // load structure
    org.biojava.nbio.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) 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) SecStrucCalc(org.biojava.nbio.structure.secstruc.SecStrucCalc) SecStrucState(org.biojava.nbio.structure.secstruc.SecStrucState)

Example 3 with PDBFileReader

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

the class AccessibleSurfaceAreaCalculatorTest method getBioJavaASA.

private static List<Double> getBioJavaASA(String id) throws IOException, StructureException {
    // load structure
    org.biojava.nbio.structure.Structure protein = new PDBFileReader().getStructureById(id);
    AsaCalculator groupAsas = new AsaCalculator(protein, AsaCalculator.DEFAULT_PROBE_SIZE, AsaCalculator.DEFAULT_N_SPHERE_POINTS, AsaCalculator.DEFAULT_NTHREADS, false);
    // assign ASA
    return Arrays.stream(groupAsas.getGroupAsas()).map(GroupAsa::getAsaU).collect(Collectors.toList());
}
Also used : PDBFileReader(org.biojava.nbio.structure.io.PDBFileReader) AsaCalculator(org.biojava.nbio.structure.asa.AsaCalculator)

Example 4 with PDBFileReader

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

the class DictionaryOfProteinSecondaryStructureTest method test1btaBiojava.

@Test
public void test1btaBiojava() throws IOException, StructureException {
    org.biojava.nbio.structure.Structure structure = new PDBFileReader().getStructureById("1bta");
    new SecStrucCalc().calculate(structure, true);
    // return complete DSSP annotation string from BioJava
    System.out.println(structure.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)).map(type -> type.equals(" ") ? "-" : type).collect(Collectors.joining()));
}
Also used : PDBFileReader(org.biojava.nbio.structure.io.PDBFileReader) 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) SecStrucCalc(org.biojava.nbio.structure.secstruc.SecStrucCalc) SecStrucState(org.biojava.nbio.structure.secstruc.SecStrucState) Test(org.junit.Test)

Aggregations

PDBFileReader (org.biojava.nbio.structure.io.PDBFileReader)4 IOException (java.io.IOException)3 Collectors (java.util.stream.Collectors)3 Group (org.biojava.nbio.structure.Group)3 GroupType (org.biojava.nbio.structure.GroupType)3 StructureException (org.biojava.nbio.structure.StructureException)3 SecStrucCalc (org.biojava.nbio.structure.secstruc.SecStrucCalc)3 SecStrucState (org.biojava.nbio.structure.secstruc.SecStrucState)3 Assert (org.junit.Assert)3 Before (org.junit.Before)3 Test (org.junit.Test)3 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 StructureParser (de.bioforscher.jstructure.model.structure.StructureParser)2 Stream (java.util.stream.Stream)2 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