/* Output from p2c 1.21alpha-07.Dec.93, the Pascal-to-C translator */ /* From input file "rf.p" */ #include /* calculate Rfrequency Dr. Thomas D. Schneider National Cancer Institute Laboratory of Experimental and Computational Biology Frederick, Maryland 21702-1201 toms@ncifcrf.gov permanent email: toms@alum.mit.edu http://www.lecb.ncifcrf.gov/~toms/ */ /* begin module version */ #define version 1.08 main(argc, argv) int argc; Char *argv[]; { /* of rf.p 2000 June 13 1.08, 2000 June 13: report frequency in exponential form last change: 1988 October 14 origin 1986 feb 14 */ /* end module version */ /* begin module describe.rf */ /* name rf: calculate Rfrequency synopsis rf(input: in, output: out) files input: interactive input from the user output: messages to the user description calculate Rfrequency as Rf = - log (number of binding sites / genome size) where the log is to the base 2, giving the result in bits. documentation Schneider, T.D., G.D. Stormo, L. Gold and A. Ehrenfeucht (1986) The information content of binding sites on nucleotide sequences. J. Mol. Biol. 188: 415-431. author thomas d. schneider bugs The program depends on interactive procedures on a particular computer and so may need to be modified on transportation. */ /* end module describe.rf */ double gamma, g; /* number of sites and genome size */ double f; /* frequency of sites */ PASCAL_MAIN(argc, argv); printf("rf %4.2f\n", version); printf("number of potential binding sites, G: "); scanf("%lg%*[^\n]", &g); getchar(); printf("number of sites in the genome, gamma: "); scanf("%lg%*[^\n]", &gamma); getchar(); f = gamma / g; printf("f = % .3E\n", f); printf("Rfrequency = %5.2f bits\n", -(log(f) / log(2.0))); exit(EXIT_SUCCESS); } /* End. */