void Command::btUsage(){ fprintf(stderr, "Usage: shrek binary [options] \n\n"); fprintf(stderr, "Required Arguments:\n"); fprintf(stderr, " -p | --pfile P-value file name\n"); fprintf(stderr, " -r | --bfile Reference Panel file prefix\n"); //Currently we only support plink format fprintf(stderr, " -K | --prevalence Population Prevalence of the trait\n"); fprintf(stderr, " -s | --stat Column name for summary statistic / p-value\n"); fprintf(stderr, " -S | --sign Column name for direction of effect\n"); fprintf(stderr, " e.g. OR, Z e.t.c\n"); fprintf(stderr, " -U | --null Null for direction of effect [0]\n"); fprintf(stderr, " e.g. -U 1 for OR, 0 for others\n"); fprintf(stderr, " -v | --conIndex Column containing the number of controls\n"); fprintf(stderr, " -V | --nControl Number of controls\n"); fprintf(stderr, " Only functional when -v not provided\n"); fprintf(stderr, " -w | --caseIndex Column containing the number of cases\n"); fprintf(stderr, " -W | --nCase Number of cases\n"); fprintf(stderr, " Only functional when -w not provided\n"); fprintf(stderr, " -c | --chr Column name for chromosome \n"); fprintf(stderr, " -m | --rs Column name for rsID \n"); fprintf(stderr, " -l | --loc Column name for coordinate \n"); fprintf(stderr, " -a | --ref Column name for reference allele\n"); fprintf(stderr, " -A | --alt Column name for alternative allele\n"); fprintf(stderr, " -i | --info Column name for impute info score\n"); generalOptions(); }
void MainWindow::writeConfig(KSharedConfigPtr config) { KConfigGroup generalOptions(config, "General Options"); m_recentFiles->saveEntries(KConfigGroup(config, "Recent Files")); config->sync(); }
void Command::qtUsage(){ fprintf(stderr, "Usage: shrek quant [options] \n\n"); fprintf(stderr, "Required Arguments:\n"); fprintf(stderr, " -p | --pfile P-value file name\n"); fprintf(stderr, " -r | --bFile Reference Panel file prefix\n"); //Currently we only support plink format fprintf(stderr, " -x | --extreme Extreme Adjustment, can be calculated as: \n"); fprintf(stderr, " Variance before selection / Variance after selection\n"); fprintf(stderr, " -n | --sampIndex Column name for the number of sample\n"); fprintf(stderr, " -N | --nSample Number of sample in the study\n"); fprintf(stderr, " Only functional when -n not provided\n"); fprintf(stderr, " -s | --stat Column name for summary statistic / p-value\n"); fprintf(stderr, " -S | --sign Column name for direction of effect\n"); fprintf(stderr, " e.g. OR, Z e.t.c\n"); fprintf(stderr, " -U | --null Null for direction of effect [0]\n"); fprintf(stderr, " e.g. -U 1 for OR, 0 for others\n"); fprintf(stderr, " -c | --chr Column name for chromosome \n"); fprintf(stderr, " -m | --rs Column name for rsID \n"); fprintf(stderr, " -l | --loc Column name for coordinate \n"); fprintf(stderr, " -A | --ref Column name for reference allele\n"); fprintf(stderr, " -a | --alt Column name for alternative allele\n"); fprintf(stderr, " -i | --info Column name for impute info score\n"); generalOptions(); }
bool IV::init( const int ac, char ** av ) { if( _init ) return true; _init = true; Global& global = Global::getInstance(); boost::program_options::options_description cmdOptions; // General Options boost::program_options::options_description generalOptions("General options"); generalOptions.add_options() ("help", "produce help message"); // Behavior Options boost::program_options::options_description behaviorOptions("Behavior options"); behaviorOptions.add_options() ("disable_cuda", "Disable cuda, by default enabled if available") ("max_num_threads", boost::program_options::value< uint32_t >(), "Select maximum number of threads") ; // Data Options boost::program_options::options_description dataOptions("Data options"); dataOptions.add_options() ("file_type", boost::program_options::value< DataHandler::file_type_t >(), "Select file type, required") ("data_file", boost::program_options::value< DataHandler::file_args_t >()->multitoken(), "File arguments, required") ("cube_level", boost::program_options::value< level_t >(), "Select cube level") ("brick_level", boost::program_options::value< level_t >(), "Select brick level") ("cube_inc", boost::program_options::value< uint32_t >(), "Select cube inc") ("brick_inc", boost::program_options::value< uint32_t >(), "Select brick inc") ("cube_cache_size", boost::program_options::value< uint32_t >(), "Select cube cache size in MB") ("brick_cache_size", boost::program_options::value< uint32_t >(), "Select brick cache size in MB") ("octree_file", boost::program_options::value< std::string >(), "Octree file") ("octree_level", boost::program_options::value< level_t >(), "Select octree level, by default equal to nLevels") ("isos", boost::program_options::value< std::vector< float > >()->multitoken(), "Set of Isosurfaces") ; // Other Options boost::program_options::options_description otherOptions("Other options"); otherOptions.add_options() ("output_file", boost::program_options::value< std::string >(), "Output file") ; cmdOptions.add(generalOptions).add(behaviorOptions).add(dataOptions).add(otherOptions); boost::program_options::variables_map vm; try { boost::program_options::store( boost::program_options::parse_command_line( ac, av, cmdOptions ), vm ); boost::program_options::notify( vm ); } catch(...) { std::cout << cmdOptions << std::endl; printHelp(); return false; } // General Options if( vm.count( "help" ) ) { std::cout << cmdOptions << std::endl; printHelp(); return false; } // Behavior Options #ifdef IV_USE_CUDA if( !vm.count( "disable_cuda" ) ) global.useCuda(); #endif if( vm.count( "max_num_threads" ) ) { global.setMaxNumThreads( vm["max_num_threads"].as< uint32_t >() ); } // Data parameters required if( !vm.count( "file_type" ) || !vm.count( "data_file" ) ) { std::cout << cmdOptions << std::endl; printHelp(); return false; } else { const DataHandler::file_type_t fileType = vm["file_type"].as<DataHandler::file_type_t>(); const DataHandler::file_args_t dataParam = vm["data_file"].as< DataHandler::file_args_t >(); switch( fileType ) { case IV_FILE_TYPE_HDF5: if( dataParam.size() < 2 ) { std::cout << cmdOptions << std::endl; printHelp(); return false; } break; case IV_FILE_TYPE_IVD: if( dataParam.size() < 1 ) { std::cout << cmdOptions << std::endl; printHelp(); return false; } break; case IV_FILE_TYPE_TEST: if( dataParam.size() < 1 ) { std::cout << cmdOptions << std::endl; printHelp(); return false; } break; default: std::cout << cmdOptions << std::endl; printHelp(); return false; } global.setFileType( fileType ); global.setFileArgs( dataParam ); } DataHandler::FileHandlerPtr file = DataHandler::FactoryFileHandler::CreateFileHandler( global.getFileType(), global.getFileArgs() ); if( !file ) return false; const level_t nLevels = file->getnLevels(); global.setnLevels( nLevels ); // Data parameters optional if( vm.count( "cube_inc" ) ) global.setCubeInc( vm["cube_inc"].as< uint32_t >() ); if( vm.count( "brick_inc" ) ) global.setBrickInc( vm["brick_inc"].as< uint32_t >() ); if( vm.count( "cube_cache_size" ) ) global.setCacheSizeCPU( vm["cube_cache_size"].as< uint32_t >() ); if( vm.count( "brick_cache_size" ) ) global.setCacheSizeGPU( vm["brick_cache_size"].as< uint32_t >() ); if( vm.count( "cube_level" ) ) global.setCubeLevel( vm["cube_level"].as< level_t >() ); else // By default 64 global.setCubeLevel( nLevels - 6 ); #ifdef IV_USE_CUDA if( vm.count( "brick_level" ) ) global.setBrickLevel( vm["brick_level"].as< level_t >() ); else // By default 32 global.setBrickLevel( nLevels - 5 ); if( global.getBrickLevel() < global.getCubeLevel() ) { std::cout << "Brick level must be >= Cube level" << std::endl; std::cout << cmdOptions << std::endl; printHelp(); } #endif if( vm.count( "octree_file" ) ) global.setOctreeFile( vm["octree_file"].as< std::string >() ); if( vm.count( "octree_level" ) ) global.setOctreeLevel( vm["octree_level"].as< level_t >() ); else // By default nLevels global.setOctreeLevel( nLevels ); if( vm.count( "isos" ) ) { std::vector< float > i = vm["isos"].as< std::vector< float > >(); std::set< float > isos( i.begin(), i.end() ); global.setIsosurfaces( isos ); } if( vm.count("output_file" ) ) global.setOutputFile( vm["output_file"].as< std::string >() ); return true; }