use of org.biojava.nbio.structure.secstruc.SecStrucCalc 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());
}
Aggregations