Skip to content

Commit

Permalink
Merge branch 'update-spoa' into 'dev'
Browse files Browse the repository at this point in the history
Update spoa and add `min_coverage` param

See merge request epi2melabs/pyspoa!3
  • Loading branch information
julibeg committed Oct 2, 2023
2 parents d651967 + e6c9c8e commit ec00b28
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v0.2.0]
### Changed
- Updated SPOA to v4.1.2
### Added
- `min_coverage` option recently introduced in SPOA

## [v0.1.0]
### Changed
- Moved CI to internal infrastructure
Expand Down
7 changes: 4 additions & 3 deletions pyspoa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using namespace pybind11::literals; // for _a in pybind def

auto poa(std::vector<std::string> sequences, int algorithm, bool genmsa,
int m, int n, int g, int e, int q, int c) -> pybind11::tuple
int m, int n, int g, int e, int q, int c, int min_coverage) -> pybind11::tuple
{
auto alignment_engine = spoa::AlignmentEngine::Create(
static_cast<spoa::AlignmentType>(algorithm), m, n, g, e, q, c
Expand All @@ -18,7 +18,7 @@ auto poa(std::vector<std::string> sequences, int algorithm, bool genmsa,
graph.AddAlignment(alignment, it);
}

auto consensus = graph.GenerateConsensus();
auto consensus = graph.GenerateConsensus(min_coverage);
std::vector<std::string> msa;
if (genmsa)
msa = graph.GenerateMultipleSequenceAlignment();
Expand All @@ -30,7 +30,8 @@ PYBIND11_MODULE(spoa, m) {
m.def(
"poa", &poa, "",
"sequences"_a, "algorithm"_a=0, "genmsa"_a=true,
"m"_a=5, "n"_a=-4, "g"_a=-8, "e"_a=-6, "q"_a=-10, "c"_a=-4
"m"_a=5, "n"_a=-4, "g"_a=-8, "e"_a=-6, "q"_a=-10, "c"_a=-4,
"min_coverage"_a=-1
);

m.attr("__version__") = VERSION_INFO;
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def build_extensions(self):

setup(
name='pyspoa',
version='0.1.0',
version='0.2.0',
author='Oxford Nanoporetech Technologies, Ltd.',
author_email='support@nanoporetech.com',
url='https://github.com/nanoporetech/pyspoa',
Expand Down

0 comments on commit ec00b28

Please sign in to comment.