@ Deprecated public static final Structure getReducedStructure ( Structure s , String chainId ) throws StructureException { // since we deal here with structure alignments, // only use Model 1... Structure newS = new StructureImpl ( ) ; newS . setPDBCode ( s . getPDBCode ( ) ) ; newS . setPDBHeader ( s . getPDBHeader ( ) ) ; newS . setName ( s . getName ( ) ) ; newS . setSSBonds ( s . getSSBonds ( ) ) ; newS . setDBRefs ( s . getDBRefs ( ) ) ; newS . setSites ( s . getSites ( ) ) ; newS . setBiologicalAssembly ( s . isBiologicalAssembly ( ) ) ; newS . setEntityInfos ( s . getEntityInfos ( ) ) ; newS . setSSBonds ( s . getSSBonds ( ) ) ; newS . setSites ( s . getSites ( ) ) ; if ( chainId != null ) chainId = chainId . trim ( ) ; if ( chainId == null || chainId . equals ( "" ) ) { // only get model 0 List < Chain > model0 = s . getModel ( 0 ) ; for ( Chain c : model0 ) { newS . addChain ( c ) ; } return newS ; } Chain c = null ; try { c = s . getChainByPDB ( chainId ) ; } catch ( StructureException e ) { logger . warn ( e . getMessage ( ) + ". Chain id " + chainId + " did not match, trying upper case Chain id." ) ; c = s . getChainByPDB ( chainId . toUpperCase ( ) ) ; } if ( c != null ) { newS . addChain ( c ) ; for ( EntityInfo comp : s . getEntityInfos ( ) ) { if ( comp . getChainIds ( ) != null && comp . getChainIds ( ) . contains ( c . getChainID ( ) ) ) { // found matching entity info. set description... newS . getPDBHeader ( ) . setDescription ( "Chain " + c . getChainID ( ) + " of " + s . getPDBCode ( ) + " " + comp . getDescription ( ) ) ; } } } return newS ; }
Reduce a structure to provide a smaller representation . Only takes the first model of the structure . If chainName is provided only return a structure containing that Chain ID . Converts lower case chain IDs to upper case if structure does not contain a chain with that ID .