/* ## ## ######### ## ########## ########## ### ### ## ########## ## #### #### ## ########## ## ## ## ## ## ## ## ########## ## ######## ## ## ## ## ## ## ###### ######## ## ## ## ## ## ###### ### ## ## ## ############## ## ### ## ########## ## ############## ## ### ################# ######## ## ########### ######### ## ######### ## ########### ## ## ## ### ## ########## ## ## ## ###### ## ## ########## ## ## ## ###### ######## ## # ## ## ######### ## # ## ## ## ## ## ### ########## ## ## ## ### ########## ########## ######### */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** ** ** ** ** E N S E M B L E ** ** ** ** Version 2.1 ** ** ** ** ** ** Principal Investigator: Julie D. Forman-Kay ** ** ** ** Author: Mickaƫl Krzeminski ** ** ** ** Date: November 2012 ** ** ** ** ** ************************************************************************************* ** ** ** ** ** Copyright (C) The Hospital for Sick Children, 2001 ** ** ** ** Distribution of substantively modified versions of this module is prohibited ** ** without the explicit permission of the copyright holder. ** ** ** ** Any use of this work or derivative works in whole or in part for any ** ** commercial purpose or for monetary gain is prohibited. ** ** ** ** ** ** NO WARRANTY ** ** This software package is provided 'as is' without warranty of any kind, ** ** expressed or implied. ** ** ** ** ** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* COMPILATION gcc -O3 -lm -o get_info get_info.c */ #include "Include/ens.h" enum toolsPrograms TP = __GET_INFO__; int main(int argc, char *argv[]) { /***********************************************************\ |* *| |* *| |* Variables declaration *| |* *| |* *| \***********************************************************/ counter count; char type[4]; unsigned long fileSize, expFileSize; unsigned short nbModules; double effNrg; uint32_t nbConfs, nbAtoms, confBlockSize; uint32_t nbIPs, nbRestraints, runNb; uint32_t nbBestEns; unsigned short nbElements; FILE *ENSFile; /***********************************************************\ |* *| |* *| |* Giving information about provided arguments (files) *| |* *| |* *| \***********************************************************/ if (argc < 2) { __USAGE__ } type[3] = '\0'; for (count = 1; count < argc; count++) { if ((ENSFile = fopen(argv[count], "rb")) != NULL) { // Size of the file (Must not be larger than 4Gb!) fseek(ENSFile, 0, SEEK_END); fileSize = ftell(ENSFile); if (fileSize == 0) { strcpy(type, "Emp"); } else { fseek(ENSFile, 0, SEEK_SET); fread(&type, CHAR_SIZE, 3, ENSFile); // The 3 first characters specify the file type } if (!strcmp(type, "Inp")) // Initial Pool file { /* A Initial Pool file type contains: 1. The data file type code (Inp) 2. The number of IP 3. For each IP: a. The run number b. The code for Compacted or Added conformers - Compacted: 2 ("Start of text") - Added : 3 ("End of text") c. The number of conformers d. The conformer numbers */ counter ipNb; char compact; // Number of IPs and expected file size expFileSize = 3 * CHAR_SIZE + INT32_SIZE; fread(&nbIPs, INT32_SIZE, 1, ENSFile); for (ipNb=0; ipNb