-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/bioinfologics/sdg
- Loading branch information
Showing
14 changed files
with
154 additions
and
274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// Created by Bernardo Clavijo (EI) on 2019-08-22. | ||
// | ||
|
||
#include <sdglib/indexers/NKmerIndex.hpp> | ||
#include <sdglib/mappers/SequenceMapper.hpp> | ||
#include "GraphSelfAligner.hpp" | ||
#include <sdglib/views/NodeView.hpp> | ||
|
||
void GraphSelfAligner::self_align() { | ||
matches.clear(); | ||
matches.resize(dg.sdg.nodes.size()); | ||
SequenceMapper sm(dg,k,max_kfreq); | ||
auto nvs=dg.get_all_nodeviews(); | ||
#pragma omp parallel for schedule(static,200) | ||
for (auto i=0;i<nvs.size();++i){ | ||
auto &nv=nvs[i]; | ||
for (auto &m:sm.map_sequence(nv.sequence().c_str(),nv.node_id())){ | ||
if (llabs(m.node)!=nv.node_id()){ | ||
matches[llabs(nv.node_id())].emplace_back(nv.node_id(),m.node,m.qStart,m.qEnd,m.nStart,m.nEnd,m.score); | ||
} | ||
} | ||
std::sort(matches[llabs(nv.node_id())].begin(),matches[llabs(nv.node_id())].end()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// Created by Bernardo Clavijo (EI) on 2019-08-22. | ||
// | ||
|
||
#pragma once | ||
|
||
#include <sdglib/graph/DistanceGraph.hpp> | ||
#include <sdglib/types/MappingTypes.hpp> | ||
|
||
class GraphSelfAligner { | ||
|
||
public: | ||
GraphSelfAligner(const DistanceGraph &_dg, int _k=31, int _max_kfreq=200):dg(_dg),k(_k),max_kfreq(_max_kfreq){}; | ||
explicit GraphSelfAligner(const SequenceDistanceGraph &_dg, int _k=31, int _max_kfreq=200): | ||
GraphSelfAligner(static_cast<const DistanceGraph &>(_dg),_k,_max_kfreq){}; | ||
|
||
void self_align(); | ||
|
||
const DistanceGraph &dg; | ||
int k; | ||
int max_kfreq; | ||
std::vector<std::vector<SequenceMatch>> matches; | ||
}; |
Oops, something went wrong.