// predict-2nd.cc // Kevin Karplus // 22 Nov 1995 // This main program is a very simple shell for the commands in the // *Commands.cc files #include "Command/Command.h" #include "Command/HelpCommand.h" #include "EqualStrings/EqualStrings.h" #include "Alphabet/Alph.h" #include "NamedClass/NameToPtr.h" #include "PrintInColumns/PrintInColumns.h" #include "Alphabet/MultiFeatureAlphabet.h" #include "Alphabet/FeatureRangeAlphabet.h" #include "Alphabet/CombinedAlphabet.h" #include "Alphabet/GaussianAlphabet.h" #include "SeqWeight.h" // only needed for Help command #include "LearningParam.h" // only needed for Help command #include "InterfaceDescription.h" // only needed for Help command #include "Globals.h" #include "Regularizer/all-reg.h" #include #include static DirichletReg DummyToEnsureLoading; class NeuralLayer; static int ExtraHelp(istream&in, const char*word, ostream&log_file) { if (EqualStrings(word, "alphabets", 1)) { for (int i=0; iname() << "\n"; return 1; } if (EqualStrings(word, "SequenceWeightObjects", 1)) { PrintNames(log_file, SequenceWeightObject::weighter_table()); return 1; } if (EqualStrings(word, "LearningParams", 1)) { PrintNames(log_file, LearningParam::command_table()); return 1; } if (EqualStrings(word, "IFcommands" , 1)) { PrintNames(log_file, InterfaceDescription::command_table()); return 1; } const Alphabet* al = Alphabet::name_to_alphabet(word,ZeroIfNew); if (al) { al->describe(log_file); return 1; } log_file << "No help available for " << word << "\n" << "Try 'help alphabets' for list of alphabets\n" << "or 'help SequenceWeightObjects' for list of SequenceWeightObject\n" << "or 'help LearningParams' for list of learning parameters\n" << "or 'help IFCommands for list of InterfaceDescription commands\n" << "or 'help command' for list of commands\n" << "or 'help' with no arguments for more options\n" << "Note: alphabet recognition is currently case-sensitive.\n"; return 1; } void EstInitHelp(void) { UnknownHelpFunction=ExtraHelp; AddHelpCommandTable(); AddHelpCommandTable(IdObject::lookup_table(), " (Regularizer, Alphabet, ...)"); AddHelpCommandTable(SequenceWeightObject::weighter_table(), ""); LearningParam::init_command_table(); AddHelpCommandTable(LearningParam::command_table(), ""); InterfaceDescription::init_command_table(); AddHelpCommandTable(InterfaceDescription::command_table(), ""); } int main(int argc, const char** argv) { gettimeofday(&(Globals::StartWallTime),0); struct rusage resources; getrusage(RUSAGE_SELF, &resources); Globals::StartCpuTime = resources.ru_utime; int load_default_alphabets=1; for (int i=1; i(Alphabet::name_to_alphabet_table()); alpha_table->apply_all(&DeleteNamedObject ); delete alpha_table; return 0; } //CHANGE LOG: // 21 July 1997 Keivn Karplus // Copied from estimate-dist and added EHL alphabet // 12 March 1998 Kevin Karplus // Moved Globals cleanup to Globals.cc // 30 March 1998 Kevin Karplus // Added DSSPAlphabet // 2 Apr 1998 Kevin karplus // Added EHTLAlphabet and modified EHL so it could read // DSSP alphabet strings, avoiding need for derived EHL files. // 20 Apr 1998 Melissa Cline // Added RBK alphabet to handle alignment columns with respect // to alignment trimming. The alphabet represents the three // classes of alignment columns and the action to be taken on them: // Keep = keep it in the alignment; Remove = trim it from the // alignment; Borderline = either trimming or keeping would be reasonable. // 7 June 1998 Kevin Karplus // Modified DSSP, EHL, and EHTL alphabets to make 'C' for coil be // last character, with 'L' just as alias. This should not affect // any currently input files, but will change output to using C, // as desired for CASP3 format. // 25 March 1999 Kevin Karplus // updated to use improved Alphabet class: // improved help slightly, and now load alphabets from file // 21 May 2004 Sol Katzman // Added time functions // 23 June 2005 Kevin Karplus // Eliminated preloading alphabets, other than standard ones from // Alph class // 23 June 2005 Kevin Karplus // Added PrintNames() calls for listing SequenceWeightObjects // and LearningParams // Thu Jul 16 13:31:38 PDT 2009 Kevin Karplus // Improved 'help' print with illegal argument. // Added InterfaceDescription commands to help. // Sat Aug 22 11:58:20 PDT 2009 Kevin Karplus // Added asserts to make sure that Alphabet derived classes are // linked in.