/* * ResidueDescribe * * Author: Christian Schafmeister (1991) * * Call the specific routine for the class to print a description * of the RESIDUE to the file fOut. * * Arguments: * oObject - The object to describe. * */ void ResidueDescribe( RESIDUE rResidue ) { int i; LOOP lContents; OBJEKT oObj; STRING sTemp; VP0(( "RESIDUE name: %s\n", rResidue->cHeader.sName )); if ( bResidueFlagsSet( rResidue, RESIDUEUNKNOWN ) ) VP0(( "!!!This is an unknown residue!\n" )); VP0(( "RESIDUE sequence number: %d\n", iContainerSequence(rResidue) )); VP0(( "RESIDUE PDB sequence number: %d\n", iResiduePdbSequence(rResidue) )); VP0(( "Type: %s\n", sResidueTypeNameFromChar(cResidueType(rResidue)) )); if ( cResidueType(rResidue) == RESTYPESOLVENT ) { VP0(( "Solvent imaging atom: " )); if ( aResidueImagingAtom(rResidue) == NULL ) { VP0(( "None.\n" )); } else { VP0(( "%s\n", sContainerDescriptor((CONTAINER)aResidueImagingAtom(rResidue),sTemp) )); } } VP0(( "Connection atoms:\n" )); for ( i=0; i<MAXCONNECT; i++ ) { if ( bResidueConnectUsed(rResidue,i) ) { VP0(( " Connect atom %d: %s\n", i, sContainerDescriptor( (CONTAINER)rResidue->aaConnect[i], sTemp ) )); } } if ( rResidue->vaImpropers ) { VP0(( "No improper torsions\n" )); } else { VP0(( "Improper torsions:\n" )); } BasicsResetInterrupt(); VP0(( "Contents: \n" )); lContents = lLoop( (OBJEKT)rResidue, DIRECTCONTENTS ); while ( oObj = oNext(&lContents ) ) { VP0(( "%s\n", sContainerDescriptor( (CONTAINER)oObj, sTemp ) )); if ( bBasicsInterrupt() ) { BasicsResetInterrupt(); VP0(( "Interrupted\n" )); break; } } }
OBJEKT AMBER_Combine(OBJEKT objProt, OBJEKT objLig) { // version of function oCmd_combine UNIT uCombined, uCurrent; LOOP lTemp; RESIDUE rRes = NULL; OBJEKT oObj; /* add only one uCurrent unit (Ligand) to uCombined unit (Protein) */ uCombined = (UNIT)objProt; oObj = objLig; if ( iObjectType( oObj ) != UNITid ) { printf( "%s: is type %s\n", "Ligand", sObjectType(oObj) ); } uCurrent = (UNIT)objLig; printf( " Ligand: %s\n", sContainerName((CONTAINER) uCurrent) ); if ( uCombined == NULL ) { printf( "--- no Protein unit \n" ); } else { printf( "Joining Protein and Ligand \n" ); UnitJoin( uCombined, uCurrent ); } if ( uCombined == NULL ) { printf( "No UNITS, so no combine performed\n" ); return(NULL); } /* Define PDB sequence */ lTemp = lLoop( (OBJEKT)uCombined, RESIDUES ); while ( rRes == (RESIDUE)oNext(&lTemp) ) { ResidueSetPdbSequence( rRes, iContainerSequence((CONTAINER) rRes) ); } return((OBJEKT)uCombined); }
OBJEKT AMBER_Combine(OBJEKT objProt, OBJEKT objLig) { UNIT uCombined, uCurrent; LOOP lTemp; RESIDUE rRes = NULL; OBJEKT oObj; uCombined = (UNIT)objProt; oObj = objLig; if ( iObjectType( oObj ) != UNITid ) { PrintInfo(( "%s: is type %s", "Ligand", sObjectType(oObj) )); } uCurrent = (UNIT)oCopy(oObj ); PrintInfo(( " Sequence: %s", sContainerName((CONTAINER) uCurrent) )); if ( uCombined == NULL ) { printf( "Copying the first UNIT\n" ); uCombined = uCurrent; } else { printf( "Copied a subsequent UNIT\n" ); printf( "Joining two UNITS \n" ); UnitJoin( uCombined, uCurrent ); } if ( uCombined == NULL ) { printf( "No UNITS, so no combine performed\n" ); return(NULL); } lTemp = lLoop( (OBJEKT)uCombined, RESIDUES ); while ( rRes == (RESIDUE)oNext(&lTemp) ) { ResidueSetPdbSequence( rRes, iContainerSequence((CONTAINER) rRes) ); } return((OBJEKT)uCombined); }