Пример #1
0
OBJEKT AMBER_loadPrep(char *file_prep)
{
	DICTIONARY      dUnits;
	DICTLOOP        dlLoop ;
	UNIT            uUnit = NULL;
	STRING          sName;
	LOOP            lResidues;
	RESIDUE         rRes;
	
	/* Read an AMBER PREP file into a dictionary.*/
	dUnits = dAmberReadPrepFile(file_prep);
	if ( dUnits != NULL )
	{
		dlLoop = ydlDictionaryLoop( dUnits );
		uUnit=(UNIT)yPDictionaryNext( dUnits, &dlLoop );
		strcpy( sName, sContainerName((CONTAINER) uUnit) );
		PrintInfo(( "Loaded UNIT: %s", sName ));
		/* Set the name for the UNIT */
		ContainerSetName( (CONTAINER) uUnit, sName );
		/* Set the name for the only residue in the unit */
		lResidues = lLoop( (OBJEKT)uUnit, RESIDUES );
		rRes = (RESIDUE)oNext(&lResidues);
		ContainerSetName( (CONTAINER) rRes, sName );    
		VariableSet( sName, (OBJEKT) uUnit );       /* adds 1 REF */
		return((OBJEKT)uUnit);
	}
	if (uUnit == NULL)
	PrintError( ("-- no UNIT  loaded \n"));
	return(NULL);
}
Пример #2
0
/*
 *	DictionaryDescribe
 *
 *	Author:	Christian Schafmeister (1991)
 *
 *	Describe the DICTIONARY.
 */
void
DictionaryDescribe( DICTIONARY dDict )
{
DICTLOOP	dlLoop;

    VP0(( "Dictionary with %d elements.\n", 
		iDictionaryElementCount(dDict) ));
    dlLoop = ydlDictionaryLoop(dDict);
    while ( yPDictionaryNext( dDict, &dlLoop ) ) {
	VP0(( "%40s = %lX\n", 
		sDictLoopKey(dlLoop), 
		PDictLoopData(dlLoop) ));
    }
}
Пример #3
0
OBJEKT AMBER_loadPrep(char*file_prep)
{
  /* version of function  oCmd_loadAmberPrep */

  DICTIONARY      dUnits;
  DICTLOOP        dlLoop ;
  UNIT            uUnit = NULL;
  STRING          sName;
  LOOP            lResidues;
  RESIDUE         rRes;

  /* Read an AMBER PREP file into a dictionary.*/

  dUnits = dAmberReadPrepFile(file_prep);

  if ( dUnits != NULL ) {
    dlLoop = ydlDictionaryLoop( dUnits );

      /* for move3d version only one UNIT with one residue loaded */

    uUnit=(UNIT)yPDictionaryNext( dUnits, &dlLoop );
    strcpy( sName, sContainerName((CONTAINER) uUnit) );
    printf( "Loaded UNIT: %s\n", sName );

                /* Set the name for the UNIT */

    ContainerSetName( (CONTAINER) uUnit, sName );

                /* Set the name for the only residue in the unit */

    lResidues = lLoop( (OBJEKT)uUnit, RESIDUES );
    rRes = (RESIDUE)oNext(&lResidues);
    ContainerSetName( (CONTAINER) rRes, sName );
    VariableSet( (char*)sName, (OBJEKT) uUnit );       /* adds 1 REF */
    
    if (uUnit != NULL)
      return((OBJEKT)uUnit);
    else{
      printf ("-- no UNIT  loaded \n");
      return(NULL);
    }
  }
  else
    return(NULL);
}