Skip to content

Commit

Permalink
added neighbor_proportion option instead of num_neighbor
Browse files Browse the repository at this point in the history
  • Loading branch information
gsneha26 committed Aug 20, 2020
1 parent 9e27372 commit f84a946
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions repeat_masker_src/graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ struct Configuration {
// Sequence parameters
std::string strand;
size_t seq_len;
float prop_neigh_interval;
uint32_t num_neigh_interval;

// Scoring
Expand Down Expand Up @@ -57,6 +58,8 @@ struct Configuration {
std::string output_format;
std::string output;
bool markend;
std::string cmd;
bool input_cmd;

// System parameters
uint32_t wga_chunk_size;
Expand Down
13 changes: 9 additions & 4 deletions repeat_masker_src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ int main(int argc, char** argv){
po::options_description desc{"Sequence Options"};
desc.add_options()
("strand", po::value<std::string>(&cfg.strand)->default_value("both"), "strand to search - plus/minus/both")
("neighbor_interval", po::value<uint32_t>(&cfg.num_neigh_interval)->default_value(0), "number of neighbouring intervals to align the query interval to");
("neighbor_proportion", po::value<float>(&cfg.prop_neigh_interval)->default_value(0.2), "proportion of neighbouring intervals to align the query interval to");

po::options_description scoring_desc{"Scoring Options"};
scoring_desc.add_options()
Expand Down Expand Up @@ -77,7 +77,8 @@ int main(int argc, char** argv){
output_desc.add_options()
// ("format", po::value<std::string>(&cfg.output_format)->default_value("maf-"), "format of output file (same formats as provided by LASTZ) - lav, lav+text, axt, axt+, maf, maf+, maf-, sam, softsam, sam-, softsam-, cigar, BLASTN, differences, rdotplot, text")
("output", po::value<std::string>(&cfg.output), "output filename")
("markend", po::bool_switch(&cfg.markend), "write a marker line just before completion");
("markend", po::bool_switch(&cfg.markend), "write a marker line just before completion")
("postprocessing_cmd", po::value<std::string>(&cfg.cmd), "command to run on each file for post-processing");

po::options_description system_desc{"System Options"};
system_desc.add_options()
Expand Down Expand Up @@ -169,6 +170,11 @@ int main(int argc, char** argv){
if(vm.count("gappedthresh") == 0)
cfg.gappedthresh = cfg.hspthresh;

if(vm.count("postprocessing_cmd") == 0)
cfg.input_cmd = false;
else
cfg.input_cmd = true;

cfg.gapped = !cfg.gapped;

int ambiguous_reward = -100;
Expand Down Expand Up @@ -346,8 +352,7 @@ int main(int argc, char** argv){
}

uint32_t total_query_intervals = ceil((float) cfg.seq_len/cfg.lastz_interval_size);
if(cfg.num_neigh_interval == 0)
cfg.num_neigh_interval = ceil((float) 0.2*total_query_intervals);
cfg.num_neigh_interval = ceil((float) cfg.prop_neigh_interval*total_query_intervals);

uint32_t left_intervals = ceil((float) (cfg.num_neigh_interval-1)/2);
uint32_t right_intervals = cfg.num_neigh_interval - 1 - left_intervals;
Expand Down

0 comments on commit f84a946

Please sign in to comment.