msasim 25.9.3__tar.gz → 25.9.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: msasim
3
- Version: 25.9.3
3
+ Version: 25.9.5
4
4
  Summary: A fast MSA simulator
5
5
  Home-page: https://github.com/elyawy/Sailfish-backend
6
6
  Author: Elya Wygoda
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: msasim
3
- Version: 25.9.3
3
+ Version: 25.9.5
4
4
  Summary: A fast MSA simulator
5
5
  Home-page: https://github.com/elyawy/Sailfish-backend
6
6
  Author: Elya Wygoda
@@ -4,12 +4,9 @@ from pathlib import Path
4
4
  from pybind11.setup_helpers import Pybind11Extension, build_ext
5
5
  from setuptools import setup, find_packages
6
6
 
7
- from datetime import datetime
8
7
 
9
- now = datetime.now()
10
8
 
11
-
12
- __version__ = f"{now.year % 100}.{now.month+1}.3"
9
+ __version__ = "25.9.5"
13
10
 
14
11
  # The main interface is through Pybind11Extension.
15
12
  # * You can add cxx_std=11/14/17, and then build_ext can be removed.
@@ -92,14 +92,7 @@ std::shared_ptr<stochasticProcess> modelFactory::getStochasticProcess() {
92
92
  if (_state!=factoryState::COMPLETE) {
93
93
  std::cout << "Please set all the required model parameters.\n";
94
94
  // return;
95
- }
96
-
97
- alphabet *selectedAlphabet;
98
- nucleotide nuc;
99
- amino ami;
100
- if (_alphabet==alphabetCode::NUCLEOTIDE) selectedAlphabet = &nuc;
101
- if (_alphabet==alphabetCode::AMINOACID) selectedAlphabet = &ami;
102
-
95
+ }
103
96
 
104
97
  std::unique_ptr<replacementModel> repModel;
105
98
 
@@ -134,8 +127,9 @@ std::shared_ptr<stochasticProcess> modelFactory::getStochasticProcess() {
134
127
  repModel = std::make_unique<tamura92>(theta, TrTv);
135
128
  break;
136
129
  }
137
- // case modelCode::WYANGMODEL:
138
- // repModel = &wYangModel();
130
+ case modelCode::WYANGMODEL:
131
+ throw std::runtime_error("Model not implemented: " + std::to_string(static_cast<int>(_model)));
132
+ break;
139
133
  case modelCode::CPREV45:
140
134
  repModel = std::make_unique<pupAll>(datMatrixHolder::cpREV45);
141
135
  break;
@@ -175,6 +169,9 @@ std::shared_ptr<stochasticProcess> modelFactory::getStochasticProcess() {
175
169
  case modelCode::EHO_HELIX:
176
170
  repModel = std::make_unique<pupAll>(datMatrixHolder::EHO_HELIX);
177
171
  break;
172
+ case modelCode::EHO_OTHER:
173
+ repModel = std::make_unique<pupAll>(datMatrixHolder::EHO_OTHER);
174
+ break;
178
175
  case modelCode::EX_EHO_BUR_EXT:
179
176
  repModel = std::make_unique<pupAll>(datMatrixHolder::EX_EHO_BUR_EXT);
180
177
  break;
@@ -226,11 +223,21 @@ std::shared_ptr<stochasticProcess> modelFactory::getStochasticProcess() {
226
223
  alphabet* modelFactory::getAlphabet() {
227
224
  if (_alphabet==alphabetCode::NULLCODE) {
228
225
  std::cout << "alphabet was not set! returning null pointer\n";
229
- _alph = nullptr;
226
+ _alphPtr = nullptr;
230
227
  }
231
- if (_alphabet==alphabetCode::NUCLEOTIDE) _alph = new nucleotide();
232
- if (_alphabet==alphabetCode::AMINOACID) _alph = new amino();
233
- return _alph;
228
+ // if (_alphabet==alphabetCode::NUCLEOTIDE) _alph = new nucleotide();
229
+ // if (_alphabet==alphabetCode::AMINOACID) _alph = new amino();
230
+ if (!_alphPtr) {
231
+ if (_alphabet == alphabetCode::NUCLEOTIDE) {
232
+ _alphPtr = std::make_unique<nucleotide>();
233
+ } else if (_alphabet == alphabetCode::AMINOACID) {
234
+ _alphPtr = std::make_unique<amino>();
235
+ } else {
236
+ return nullptr;
237
+ }
238
+ }
239
+ return _alphPtr.get();
240
+ // return _alph;
234
241
  }
235
242
 
236
243
  bool modelFactory::isModelValid() {
@@ -239,9 +246,6 @@ bool modelFactory::isModelValid() {
239
246
 
240
247
 
241
248
 
242
- modelFactory::~modelFactory()
243
- {
244
- delete _alph;
245
- }
249
+ modelFactory::~modelFactory() {}
246
250
 
247
251
 
@@ -108,7 +108,7 @@ void rateMatrixSim::generate_substitution_log(int seqLength) {
108
108
  for (int h = 0; h < seqLength; h++) {
109
109
  int selectedRandomCategory = _rateSampler->drawSample() - 1;
110
110
  _rateCategories[h] = selectedRandomCategory;
111
- if (selectedRandomCategory == _sp->categories()) {
111
+ if (selectedRandomCategory >= _sp->categories()) {
112
112
  ratesVec[h] = 0.0;
113
113
  continue;
114
114
  }
@@ -253,7 +253,7 @@ std::unique_ptr<sequenceContainer> rateMatrixSim::getSequenceContainer() {
253
253
  // myseqData->add(*std::move(_simulatedSequences[i]));
254
254
  // }
255
255
 
256
- return std::move(outputSequences);
256
+ return outputSequences;
257
257
  }
258
258
 
259
259
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes