msasim 24.10.4__cp38-cp38-win_amd64.whl → 24.12.0__cp38-cp38-win_amd64.whl
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.
Potentially problematic release.
This version of msasim might be problematic. Click here for more details.
- _Sailfish.cp38-win_amd64.pyd +0 -0
- msasim/sailfish.py +23 -6
- {msasim-24.10.4.dist-info → msasim-24.12.0.dist-info}/METADATA +1 -1
- msasim-24.12.0.dist-info/RECORD +8 -0
- {msasim-24.10.4.dist-info → msasim-24.12.0.dist-info}/WHEEL +1 -1
- msasim-24.10.4.dist-info/RECORD +0 -8
- {msasim-24.10.4.dist-info → msasim-24.12.0.dist-info}/LICENSE +0 -0
- {msasim-24.10.4.dist-info → msasim-24.12.0.dist-info}/top_level.txt +0 -0
_Sailfish.cp38-win_amd64.pyd
CHANGED
|
Binary file
|
msasim/sailfish.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _Sailfish
|
|
2
|
-
import os, warnings, math, operator, time, profile
|
|
2
|
+
import os, warnings, math, operator, time, profile, tempfile, pathlib
|
|
3
3
|
from functools import reduce
|
|
4
4
|
from typing import List, Optional, Dict
|
|
5
5
|
from re import split
|
|
@@ -101,12 +101,9 @@ class ZipfDistribution(Distribution):
|
|
|
101
101
|
"""
|
|
102
102
|
self.p = p
|
|
103
103
|
self.truncation = truncation
|
|
104
|
-
HARMONIC = lambda n,s: sum([(i**-s) for i in range(1,n+1)])
|
|
105
|
-
PMF = lambda x: (x**-p)*(1.0/HARMONIC(truncation, p))
|
|
106
|
-
CDF = lambda x: HARMONIC(x, p) / HARMONIC(truncation, p)
|
|
107
|
-
norm_factor = CDF(truncation) - CDF(0)
|
|
108
104
|
|
|
109
|
-
|
|
105
|
+
norm_factor = sum([(i**-p) for i in range(1,truncation+1)])
|
|
106
|
+
probabilities = [(i**-p)/norm_factor for i in range(1, truncation+1)]
|
|
110
107
|
|
|
111
108
|
self.set_dist(probabilities)
|
|
112
109
|
|
|
@@ -537,6 +534,26 @@ class Simulator:
|
|
|
537
534
|
Msas.append(msa)
|
|
538
535
|
return Msas
|
|
539
536
|
|
|
537
|
+
def simulate_low_memory(self, output_file_path: pathlib.Path) -> Msa:
|
|
538
|
+
if self._simProtocol._is_insertion_rate_zero and self._simProtocol._is_deletion_rate_zero:
|
|
539
|
+
msa = Msa(sum(self.get_sequences_to_save()),
|
|
540
|
+
self._simProtocol.get_sequence_size(),
|
|
541
|
+
self.get_sequences_to_save())
|
|
542
|
+
else:
|
|
543
|
+
blocktree = self.gen_indels()
|
|
544
|
+
msa = Msa(blocktree._get_Sailfish_blocks(),
|
|
545
|
+
self._simProtocol._get_root(),
|
|
546
|
+
self.get_sequences_to_save())
|
|
547
|
+
|
|
548
|
+
# sim.init_substitution_sim(mFac)
|
|
549
|
+
if self._simulation_type != SIMULATION_TYPE.NOSUBS:
|
|
550
|
+
with tempfile.TemporaryDirectory() as tmpdirname:
|
|
551
|
+
self._simulator.gen_substitutions_to_dir(msa.get_length(), tmpdirname)
|
|
552
|
+
msa._msa.set_substitutions_folder(tmpdirname)
|
|
553
|
+
msa._msa.write_msa_from_dir(str(output_file_path))
|
|
554
|
+
|
|
555
|
+
|
|
556
|
+
|
|
540
557
|
def __call__(self) -> Msa:
|
|
541
558
|
return self.simulate(1)[0]
|
|
542
559
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
_Sailfish.cp38-win_amd64.pyd,sha256=zY0asthjGJK060sL8T0lttcx4DTpCb0aR3F0dftl0Gs,608768
|
|
2
|
+
msasim/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
msasim/sailfish.py,sha256=ElArIFObfW_1qc8no5Q0DKqTDwuF15lFibEVV0wUqzM,26261
|
|
4
|
+
msasim-24.12.0.dist-info/LICENSE,sha256=MgvumWWAhx44Y7XYvLMzqDUZv_Mn4nZLuC-EBl9E0l0,10483
|
|
5
|
+
msasim-24.12.0.dist-info/METADATA,sha256=95EV7J2PoOQ0yavAR20_fSxzndd82B_mzi04tAfOtrA,1522
|
|
6
|
+
msasim-24.12.0.dist-info/WHEEL,sha256=rTcqimtzpX3smAWAhGmiRSWAxTY4PqYPNE-p4kscHDQ,99
|
|
7
|
+
msasim-24.12.0.dist-info/top_level.txt,sha256=NS1ILx5V94Yyh_M7yDrrqbBPu1TL_zJuxhsI90YEJVY,17
|
|
8
|
+
msasim-24.12.0.dist-info/RECORD,,
|
msasim-24.10.4.dist-info/RECORD
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
_Sailfish.cp38-win_amd64.pyd,sha256=16hamv0pyoarn0vhdHTc0mvl-qdQ9JH1yveSp6BuZZc,578560
|
|
2
|
-
msasim/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
msasim/sailfish.py,sha256=A9ETx3KB9sFHaYP4dcR5aaPjts9VbUhSmOR04qTzn-Q,25442
|
|
4
|
-
msasim-24.10.4.dist-info/LICENSE,sha256=MgvumWWAhx44Y7XYvLMzqDUZv_Mn4nZLuC-EBl9E0l0,10483
|
|
5
|
-
msasim-24.10.4.dist-info/METADATA,sha256=6yT55WNrZ-6ie4KblmXszp1BuK4N19yI-0j667hb8wc,1522
|
|
6
|
-
msasim-24.10.4.dist-info/WHEEL,sha256=1rwUt2BQv3N5S0pE0N9WlEu1uiKd-mQhEp4H-4r377U,99
|
|
7
|
-
msasim-24.10.4.dist-info/top_level.txt,sha256=NS1ILx5V94Yyh_M7yDrrqbBPu1TL_zJuxhsI90YEJVY,17
|
|
8
|
-
msasim-24.10.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|