/* * rna_interaction_search_parameters.cpp * * Created on: 2016/8/31 * Author: Tsukasa Fukunaga */ #include "rna_interaction_search_parameters.h" #include #include #include void RnaInteractionSearchParameters::SetParameters(int argc, char* argv[]) { int c; extern char *optarg; while ((c = getopt(argc, argv, "i:o:d:l:e:y:x:f:")) != -1) { switch (c) { case 'i': _input_filename = optarg; break; case 'o': _output_filename = optarg; break; case 'd': _db_filename = optarg; break; case 'l': _max_seed_length = atoi(optarg); break; case 'e': _hybrid_energy_threshold = atof(optarg); break; case 'f': _interaction_energy_threshold = atof(optarg); break; case 'x': _drop_out_length_w_gap = atoi(optarg); break; case 'y': _drop_out_length_wo_gap = atoi(optarg); break; default: cerr << "Error: The argument is invalid command." << endl; exit(1); } } } void RnaInteractionSearchParameters::SetDbParameters(){ ifstream ifs((GetDbFilename()+".bas").c_str(), ios::in | ios::binary); if (!ifs){ cout << "Error: can't open " << GetDbFilename() << ".bas." <(&temp_i), sizeof(int)); SetHashSize(temp_i); ifs.read(reinterpret_cast(&temp_i), sizeof(int)); SetRepeatFlag(temp_i); ifs.read(reinterpret_cast(&temp_i), sizeof(int)); SetMaximalSpan(temp_i); ifs.read(reinterpret_cast(&temp_i), sizeof(int)); SetMinAccessibleLength(temp_i); ifs.close(); }