Skip to content

Commit

Permalink
clening useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
usama committed Jun 10, 2015
1 parent 1c50a05 commit eb122b5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 60 deletions.
3 changes: 0 additions & 3 deletions gaml.cc
Original file line number Diff line number Diff line change
Expand Up @@ -994,8 +994,6 @@ int main(int argc, char** argv) {
printf("%d ", len);
}
printf("\n");
// starting_paths[0].resize(2262);
// starting_paths[0].resize(2259);
printf("starting paths %d\n", starting_paths[0].size());
OutputPathsToFile(starting_paths, gr, 61, 500, "starting3");
printf("\n");
Expand All @@ -1020,7 +1018,6 @@ int main(int argc, char** argv) {

//TODO: configure optimazation


Optimize(gr, pc, starting_paths, advice_paired, advice_pacbio, longest_read, settings);
}

Expand Down
57 changes: 0 additions & 57 deletions moves.cc
Original file line number Diff line number Diff line change
Expand Up @@ -567,16 +567,9 @@ bool ExtendPaths(vector<vector<int> >& new_paths, Graph& gr, int threshold,
}

unordered_map<int, vector<int> > path_ends;
unordered_map<int, vector<pair<int, int> > > path_poses;
for (int i = 0; i < new_paths.size(); i++) {
path_ends[new_paths[i][0]].push_back(i+1);
path_ends[new_paths[i].back()^1].push_back(-(i+1));
for (int j = 1; j < new_paths[i].size() - 1; j++) {
if (new_paths[i][j] >= 0 && gr.nodes[new_paths[i][j]]->s.length() > threshold) {
path_poses[new_paths[i][j]].push_back(make_pair(i, j));
path_poses[new_paths[i][j]^1].push_back(make_pair(i, j));
}
}
}

int join = 0;
Expand Down Expand Up @@ -626,36 +619,6 @@ bool ExtendPaths(vector<vector<int> >& new_paths, Graph& gr, int threshold,
}
int pt = path.size() - 1;

/* geometric_distribution<int> dist(0.2);
int extend_limit = 2 + dist(generator);
for (int extend = 0; extend < extend_limit; extend++) {
if (path_poses.count(path.back())) {
vector<pair<int, int> > choices;
for (int i = 0; i < path_poses[path.back()].size(); i++) {
if (path_poses[path.back()][i].first != rp) {
choices.push_back(path_poses[path.back()][i]);
}
}
if (!choices.empty()) {
inner_join = choices[rand()%choices.size()];
found = true;
break;
}
}
if (gr.nodes[path.back()]->s.length() > threshold && extend > 0) {
break;
}
Node*next = gr.nodes[path.back()]->SampleNext();
if (!next) {
break;
}
path.push_back(next->id);
}
if (!found) {
continue;
}*/

if (join != 0) {
vector<int> join_path;
int join_num;
Expand Down Expand Up @@ -686,28 +649,8 @@ bool ExtendPaths(vector<vector<int> >& new_paths, Graph& gr, int threshold,
}
new_paths.push_back(path);
} else {
/* if (path.back() == paths[inner_join.first][inner_join.second]) {
for (int i = inner_join.second + 1; i < paths[inner_join.first].size(); i++) {
path.push_back(paths[inner_join.first][i]);
}
new_paths[inner_join.first].resize(inner_join.second+1);
new_paths.erase(new_paths.begin() + rp);
new_paths.push_back(path);
} else if (path.back()^1 == paths[inner_join.first][inner_join.second]) {
for (int i = inner_join.second - 1; i >= 0; i--) {
path.push_back(paths[inner_join.first][i]^1);
}
new_paths[inner_join.first].erase(
new_paths[inner_join.first].begin(),
new_paths[inner_join.first].begin() + inner_join.second);
new_paths.erase(new_paths.begin() + rp);
new_paths.push_back(path);
} else {
assert(false);
}*/
new_paths.erase(new_paths.begin() + rp);
new_paths.push_back(path);
// printf("path join %d %d %d\n", rp, inner_join.first, inner_join.second);
}
if (!found) {
return false;
Expand Down

0 comments on commit eb122b5

Please sign in to comment.