Re: how to write out...

From: F. Ryjacek <ryjacek_at_indy.jh-inst.cas.cz>
Date: Fri 14 Sep 2001 19:23:20 +0200

Hi Michal,
replace function 'newpath()' in coord.c (amber/src/carnal) with this code.
The only change I did, was replacement of %d with %05d.
The zero is filling character, and five is total length of the number.
Best,

        Filip Ryjacek




/************************************************************************
                                                        NEWPATH()
************************************************************************/

/*
 * newpath() - try to create a file using iteration as extension
 */

FILE *
newpath(path, base, nonumber)
char *path, *base;
{
        FILE *file;
        int exists;

        if (nonumber)
                sprintf(path, "%s", base);
        else
                sprintf(path, "%s.%05d", base, it+1);
        if (fileprob(path, 0, &exists, "COORD")) {
                /*
                 * another chance:
                 */
                sprintf(path, "%s.a%05d", base, it+1);
                if (fileprob(path, 0, &exists, "COORD")) {
                        printf( "COORD: file %s.%05d exists: not written\n",
                                                                path, it);
                        return(NULL);
                }
        }
        printf("starting new coord output file: %s\n", path);
        if ((file = fopen(path, "w")) == NULL) {
                perror(path);
                return(NULL);
        }
        return(file);
}








At 13.9.2001 Michal Otyepka wrote:
------------------------------------------------------------------
Dear AMBER,

does anybody have idea how to write out PDB files using by CARNAL in this
format
a.0001
a.0002
etc rather than
a.1
a.2
....
a.1000

Thanks for your suggestions,

Michal Otyepka

*---------------------------------------------[*]-*
| Department of Inorganic and Physical Chemistry |
| Palacky University |
| tr. Svobody 26, 771 46 Olomouc, Czech Republic |
| |
|ph. +420 68 563 4756 fax +420 68 522 5737|
| fax +420 68 563 4420|
|http://aix.upol.cz/~otyepka |
|http://www.upol.cz/kafch |
*-------------------------------------------------*
Received on Fri Sep 14 2001 - 10:23:20 PDT
Custom Search