public void loadFromDirectAccess ( ) { String pdbId = "1A4W" ; StructureProvider pdbreader = new MMCIFFileReader ( ) ; try { Structure s = pdbreader . getStructureById ( pdbId ) ; System . out . println ( "Getting chain H of 1A4W" ) ; List < Chain > hs = s . getNonPolyChainsByPDB ( "H" ) ; Chain h = hs . get ( 0 ) ; List < Group > ligands = h . getAtomGroups ( ) ; System . out . println ( "These ligands have been found in chain " + h . getName ( ) ) ; for ( Group l : ligands ) { System . out . println ( l ) ; } System . out . println ( "Accessing QWE directly: " ) ; Group qwe = s . getNonPolyChainsByPDB ( "H" ) . get ( 2 ) . getGroupByPDB ( new ResidueNumber ( "H" , 373 , null ) ) ; System . out . println ( qwe . getChemComp ( ) ) ; System . out . println ( h . getSeqResSequence ( ) ) ; System . out . println ( h . getAtomSequence ( ) ) ; System . out . println ( h . getAtomGroups ( GroupType . HETATM ) ) ; System . out . println ( "Entities: " + s . getEntityInfos ( ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } }
An example demonstrating how to directly use the mmCif file parsing classes . This could potentially be used to use the parser to populate a data - structure that is different from the biojava - structure data model .