msasim 2024.5.22__cp311-cp311-macosx_10_9_x86_64.whl → 2024.5.2719__cp311-cp311-macosx_10_9_x86_64.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.
Binary file
@@ -368,8 +368,8 @@ class Msa:
368
368
  '''
369
369
  The MSA class from the simulator
370
370
  '''
371
- def __init__(self, species_dict: Dict[str, BlockTree], root_node):
372
- self._msa = _Sailfish.Msa(species_dict, root_node)
371
+ def __init__(self, species_dict: Dict[str, BlockTree], root_node, save_list: List[bool]):
372
+ self._msa = _Sailfish.Msa(species_dict, root_node, save_list)
373
373
 
374
374
  def generate_msas(self, node):
375
375
  self._msa.generate_msas(node)
@@ -504,7 +504,15 @@ class Simulator:
504
504
  def gen_indels(self) -> BlockTreePython:
505
505
  return BlockTreePython(self._simulator.gen_indels())
506
506
 
507
+ def get_sequences_to_save(self) -> List[bool]:
508
+ return self._simulator.get_saved_nodes_mask()
507
509
 
510
+ def save_root_sequence(self):
511
+ self._simulator.save_root_sequence()
512
+
513
+ def save_all_nodes_sequences(self):
514
+ self._simulator.save_all_nodes_sequences()
515
+
508
516
  def gen_substitutions(self, length: int):
509
517
  if not self._is_sub_model_init:
510
518
  self._init_sub_model()
@@ -515,10 +523,14 @@ class Simulator:
515
523
  Msas = []
516
524
  for _ in range(times):
517
525
  if self._simProtocol._is_insertion_rate_zero and self._simProtocol._is_deletion_rate_zero:
518
- msa = Msa(self._simProtocol.get_tree().get_num_leaves(), self._simProtocol.get_sequence_size())
526
+ msa = Msa(sum(self.get_sequences_to_save()),
527
+ self._simProtocol.get_sequence_size(),
528
+ self.get_sequences_to_save())
519
529
  else:
520
530
  blocktree = self.gen_indels()
521
- msa = Msa(blocktree._get_Sailfish_blocks(), self._simProtocol._get_root())
531
+ msa = Msa(blocktree._get_Sailfish_blocks(),
532
+ self._simProtocol._get_root(),
533
+ self.get_sequences_to_save())
522
534
 
523
535
  # sim.init_substitution_sim(mFac)
524
536
  substitutions = self.gen_substitutions(msa.get_length())
@@ -0,0 +1,54 @@
1
+ Metadata-Version: 2.1
2
+ Name: msasim
3
+ Version: 2024.5.2719
4
+ Summary: A fast MSA simulator
5
+ Home-page: https://github.com/elyawy/Sailfish-backend
6
+ Author: Elya Wygoda
7
+ Author-email: elya.wygoda@gmail.com
8
+ Requires-Python: >=3.6
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Provides-Extra: test
12
+ Requires-Dist: pytest ; extra == 'test'
13
+
14
+ # Sailfish
15
+
16
+ Sailfish is a performant multiple sequence alignment(MSA) simulator, written in C++ and Python, allowing for quick and easy generation of large simulated datasets.
17
+
18
+ ## Project goals
19
+
20
+ - Ease of use
21
+ - Speed
22
+ - Modularity
23
+
24
+ ## Installation
25
+
26
+ ```bash
27
+ pip install msasim
28
+ ```
29
+
30
+ ## Example
31
+
32
+ ```python
33
+ from msasim import sailfish as sim
34
+ from msasim.sailfish import MODEL_CODES, ZipfDistribution
35
+
36
+ ROOT_SEQUENCE_LENGTH = 100
37
+
38
+ sim_protocol = sim.SimProtocol("(A:0.5,B:0.5);",
39
+ deletion_rate=0.01,
40
+ insertion_rate=0.01,
41
+ deletion_dist=ZipfDistribution(1.08, 50),
42
+ insertion_dist=ZipfDistribution(1.08, 50),
43
+ seed=50)
44
+ sim_protocol.set_sequence_size(ROOT_SEQUENCE_LENGTH)
45
+
46
+ simulation = sim.Simulator(sim_protocol, simulation_type=sim.SIMULATION_TYPE.PROTEIN)
47
+
48
+ simulation.set_replacement_model(model=MODEL_CODES.WAG,
49
+ gamma_parameters_alpha=1.0,
50
+ gamma_parameters_catergories=4)
51
+ msa = simulation()
52
+ msa.print_msa()
53
+
54
+ ```
@@ -0,0 +1,8 @@
1
+ _Sailfish.cpython-311-darwin.so,sha256=WnoOEIz3wJW-8ZpCOSvOhbWQmuNcR0toeRngyTXz0Gk,1053472
2
+ msasim-2024.5.2719.dist-info/RECORD,,
3
+ msasim-2024.5.2719.dist-info/LICENSE,sha256=p1Aa_mM2Nu6dG3XqMVU62Jhf04lNOwtXUrhhvhcDips,10312
4
+ msasim-2024.5.2719.dist-info/WHEEL,sha256=3Ij8bI-sb8yCMxXItr4MLlNoRGZb2WoUxQe9xIFR_DQ,111
5
+ msasim-2024.5.2719.dist-info/top_level.txt,sha256=NS1ILx5V94Yyh_M7yDrrqbBPu1TL_zJuxhsI90YEJVY,17
6
+ msasim-2024.5.2719.dist-info/METADATA,sha256=5p-hn1n9BUM6raNbLdTi40KzDDqGazDEchhJoHVQLI4,1472
7
+ msasim/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ msasim/sailfish.py,sha256=zLW65fPWCwOUDpVyq4zdZK2YsGcwMUZxnUVzeRnFVbo,24791
@@ -1,2 +1,2 @@
1
- Sailfish
2
1
  _Sailfish
2
+ msasim
@@ -1,13 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: msasim
3
- Version: 2024.5.22
4
- Summary: A fast MSA simulator
5
- Home-page: https://github.com/elyawy/Sailfish-backend
6
- Author: Elya Wygoda
7
- Author-email: elya.wygoda@gmail.com
8
- Requires-Python: >=3.6
9
- License-File: LICENSE
10
- Provides-Extra: test
11
- Requires-Dist: pytest ; extra == 'test'
12
-
13
- Sailfish is a performant multiple sequence alignment simulator, written in C++, allowing fast generation of large simualted datasets.
@@ -1,8 +0,0 @@
1
- _Sailfish.cpython-311-darwin.so,sha256=_zpL3YC0-xVeN9PMmk8yBq7ssMMt7grbGGuAvwOa4Aw,1028112
2
- msasim-2024.5.22.dist-info/RECORD,,
3
- msasim-2024.5.22.dist-info/LICENSE,sha256=p1Aa_mM2Nu6dG3XqMVU62Jhf04lNOwtXUrhhvhcDips,10312
4
- msasim-2024.5.22.dist-info/WHEEL,sha256=3Ij8bI-sb8yCMxXItr4MLlNoRGZb2WoUxQe9xIFR_DQ,111
5
- msasim-2024.5.22.dist-info/top_level.txt,sha256=mVJT9Q6vqdBJyJ6acJvUdopsnVCQH7wEMQ-3iT6C-Jg,19
6
- msasim-2024.5.22.dist-info/METADATA,sha256=xZjkEbQzNYYvB1WB75UQGh14FnS4rM7CUgujkplkRkA,435
7
- Sailfish/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- Sailfish/simulator.py,sha256=CTFAnavIHy918aF141FKeZjO5Y-oYASI-TR5MMGGVks,24324
File without changes