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());
}
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());
}
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());
}
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()));
}
Aggregations