phykit 2.0.1__tar.gz → 2.0.2__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.
Files changed (72) hide show
  1. {phykit-2.0.1 → phykit-2.0.2}/PKG-INFO +12 -5
  2. {phykit-2.0.1 → phykit-2.0.2}/README.md +2 -3
  3. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/alignment/dna_threader.py +15 -6
  4. phykit-2.0.2/phykit/version.py +1 -0
  5. {phykit-2.0.1 → phykit-2.0.2}/phykit.egg-info/PKG-INFO +12 -5
  6. phykit-2.0.1/phykit/version.py +0 -1
  7. {phykit-2.0.1 → phykit-2.0.2}/LICENSE.md +0 -0
  8. {phykit-2.0.1 → phykit-2.0.2}/phykit/__init__.py +0 -0
  9. {phykit-2.0.1 → phykit-2.0.2}/phykit/__main__.py +0 -0
  10. {phykit-2.0.1 → phykit-2.0.2}/phykit/helpers/__init__.py +0 -0
  11. {phykit-2.0.1 → phykit-2.0.2}/phykit/helpers/boolean_argument_parsing.py +0 -0
  12. {phykit-2.0.1 → phykit-2.0.2}/phykit/helpers/files.py +0 -0
  13. {phykit-2.0.1 → phykit-2.0.2}/phykit/helpers/stats_summary.py +0 -0
  14. {phykit-2.0.1 → phykit-2.0.2}/phykit/phykit.py +0 -0
  15. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/__init__.py +0 -0
  16. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/alignment/__init__.py +0 -0
  17. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/alignment/alignment_length.py +0 -0
  18. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/alignment/alignment_length_no_gaps.py +0 -0
  19. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/alignment/alignment_recoding.py +0 -0
  20. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/alignment/base.py +0 -0
  21. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/alignment/column_score.py +0 -0
  22. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/alignment/compositional_bias_per_site.py +0 -0
  23. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/alignment/create_concatenation_matrix.py +0 -0
  24. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/alignment/evolutionary_rate_per_site.py +0 -0
  25. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/alignment/faidx.py +0 -0
  26. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/alignment/gc_content.py +0 -0
  27. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/alignment/pairwise_identity.py +0 -0
  28. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/alignment/parsimony_informative_sites.py +0 -0
  29. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/alignment/rcv.py +0 -0
  30. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/alignment/rcvt.py +0 -0
  31. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/alignment/rename_fasta_entries.py +0 -0
  32. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/alignment/sum_of_pairs_score.py +0 -0
  33. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/alignment/variable_sites.py +0 -0
  34. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/base.py +0 -0
  35. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/__init__.py +0 -0
  36. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/base.py +0 -0
  37. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/bipartition_support_stats.py +0 -0
  38. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/branch_length_multiplier.py +0 -0
  39. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/collapse_branches.py +0 -0
  40. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/covarying_evolutionary_rates.py +0 -0
  41. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/dvmc.py +0 -0
  42. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/evolutionary_rate.py +0 -0
  43. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/hidden_paralogy_check.py +0 -0
  44. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/internal_branch_stats.py +0 -0
  45. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/internode_labeler.py +0 -0
  46. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/last_common_ancestor_subtree.py +0 -0
  47. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/lb_score.py +0 -0
  48. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/monophyly_check.py +0 -0
  49. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/nearest_neighbor_interchange.py +0 -0
  50. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/patristic_distances.py +0 -0
  51. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/polytomy_test.py +0 -0
  52. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/print_tree.py +0 -0
  53. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/prune_tree.py +0 -0
  54. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/rename_tree_tips.py +0 -0
  55. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/rf_distance.py +0 -0
  56. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/root_tree.py +0 -0
  57. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/saturation.py +0 -0
  58. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/spurious_sequence.py +0 -0
  59. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/terminal_branch_stats.py +0 -0
  60. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/tip_labels.py +0 -0
  61. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/tip_to_tip_distance.py +0 -0
  62. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/tip_to_tip_node_distance.py +0 -0
  63. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/total_tree_length.py +0 -0
  64. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/treeness.py +0 -0
  65. {phykit-2.0.1 → phykit-2.0.2}/phykit/services/tree/treeness_over_rcv.py +0 -0
  66. {phykit-2.0.1 → phykit-2.0.2}/phykit.egg-info/SOURCES.txt +0 -0
  67. {phykit-2.0.1 → phykit-2.0.2}/phykit.egg-info/dependency_links.txt +0 -0
  68. {phykit-2.0.1 → phykit-2.0.2}/phykit.egg-info/entry_points.txt +0 -0
  69. {phykit-2.0.1 → phykit-2.0.2}/phykit.egg-info/requires.txt +0 -0
  70. {phykit-2.0.1 → phykit-2.0.2}/phykit.egg-info/top_level.txt +0 -0
  71. {phykit-2.0.1 → phykit-2.0.2}/setup.cfg +0 -0
  72. {phykit-2.0.1 → phykit-2.0.2}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: phykit
3
- Version: 2.0.1
3
+ Version: 2.0.2
4
4
  Home-page: https://github.com/jlsteenwyk/phykit
5
5
  Author: Jacob L. Steenwyk
6
6
  Author-email: jlsteenwyk@gmail.com
@@ -18,6 +18,14 @@ Requires-Dist: numpy>=1.24.0
18
18
  Requires-Dist: scipy>=1.11.3
19
19
  Requires-Dist: scikit-learn>=1.4.2
20
20
  Requires-Dist: cython
21
+ Dynamic: author
22
+ Dynamic: author-email
23
+ Dynamic: classifier
24
+ Dynamic: description
25
+ Dynamic: description-content-type
26
+ Dynamic: home-page
27
+ Dynamic: license-file
28
+ Dynamic: requires-dist
21
29
 
22
30
  <p align="center">
23
31
  <a href="https://github.com/jlsteenwyk/phykit">
@@ -40,9 +48,8 @@ Requires-Dist: cython
40
48
  <a href="https://github.com/jlsteenwyk/phykit/graphs/contributors" alt="Contributors">
41
49
  <img src="https://img.shields.io/github/contributors/jlsteenwyk/phykit">
42
50
  </a>
43
- <a href="https://twitter.com/intent/follow?screen_name=jlsteenwyk" alt="Author Twitter">
44
- <img src="https://img.shields.io/twitter/follow/jlsteenwyk?style=social&logo=twitter"
45
- alt="follow on Twitter">
51
+ <a href="https://bsky.app/profile/jlsteenwyk.bsky.social" target="_blank" rel="noopener noreferrer">
52
+ <img src="https://img.shields.io/badge/Bluesky-0285FF?logo=bluesky&logoColor=fff">
46
53
  </a>
47
54
  <br />
48
55
  <a href="https://pepy.tech/badge/phykit">
@@ -19,9 +19,8 @@
19
19
  <a href="https://github.com/jlsteenwyk/phykit/graphs/contributors" alt="Contributors">
20
20
  <img src="https://img.shields.io/github/contributors/jlsteenwyk/phykit">
21
21
  </a>
22
- <a href="https://twitter.com/intent/follow?screen_name=jlsteenwyk" alt="Author Twitter">
23
- <img src="https://img.shields.io/twitter/follow/jlsteenwyk?style=social&logo=twitter"
24
- alt="follow on Twitter">
22
+ <a href="https://bsky.app/profile/jlsteenwyk.bsky.social" target="_blank" rel="noopener noreferrer">
23
+ <img src="https://img.shields.io/badge/Bluesky-0285FF?logo=bluesky&logoColor=fff">
25
24
  </a>
26
25
  <br />
27
26
  <a href="https://pepy.tech/badge/phykit">
@@ -49,12 +49,21 @@ class DNAThreader(Alignment):
49
49
  # triplicate each amino acid
50
50
  return ''.join(c * 3 for c in p_seq)
51
51
 
52
- def normalize_n_seq(self, n_seq: Seq, normalized_p_seq: str) -> str:
53
- # insert gaps at corresponding positions in the nucleotide sequence based on the protein sequence
54
- normalized_n_seq = list(n_seq)
55
- for idx, c in enumerate(normalized_p_seq):
56
- if c in "-?*Xx":
57
- normalized_n_seq.insert(idx, "-")
52
+ def normalize_n_seq(self, n_seq: Seq, p_seq: Seq) -> str:
53
+ codons = [str(n_seq[i:i+3]) for i in range(0, len(n_seq), 3)]
54
+ normalized_n_seq = []
55
+
56
+ codon_idx = 0
57
+ for aa in p_seq:
58
+ if aa in "-?*Xx":
59
+ normalized_n_seq.append("---")
60
+ else:
61
+ if codon_idx < len(codons):
62
+ normalized_n_seq.append(codons[codon_idx])
63
+ codon_idx += 1
64
+ else:
65
+ normalized_n_seq.append("---") # fallback in case of misalignment
66
+
58
67
  return ''.join(normalized_n_seq)
59
68
 
60
69
  def thread(self, prot_records) -> Dict[str, str]:
@@ -0,0 +1 @@
1
+ __version__ = "2.0.2"
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: phykit
3
- Version: 2.0.1
3
+ Version: 2.0.2
4
4
  Home-page: https://github.com/jlsteenwyk/phykit
5
5
  Author: Jacob L. Steenwyk
6
6
  Author-email: jlsteenwyk@gmail.com
@@ -18,6 +18,14 @@ Requires-Dist: numpy>=1.24.0
18
18
  Requires-Dist: scipy>=1.11.3
19
19
  Requires-Dist: scikit-learn>=1.4.2
20
20
  Requires-Dist: cython
21
+ Dynamic: author
22
+ Dynamic: author-email
23
+ Dynamic: classifier
24
+ Dynamic: description
25
+ Dynamic: description-content-type
26
+ Dynamic: home-page
27
+ Dynamic: license-file
28
+ Dynamic: requires-dist
21
29
 
22
30
  <p align="center">
23
31
  <a href="https://github.com/jlsteenwyk/phykit">
@@ -40,9 +48,8 @@ Requires-Dist: cython
40
48
  <a href="https://github.com/jlsteenwyk/phykit/graphs/contributors" alt="Contributors">
41
49
  <img src="https://img.shields.io/github/contributors/jlsteenwyk/phykit">
42
50
  </a>
43
- <a href="https://twitter.com/intent/follow?screen_name=jlsteenwyk" alt="Author Twitter">
44
- <img src="https://img.shields.io/twitter/follow/jlsteenwyk?style=social&logo=twitter"
45
- alt="follow on Twitter">
51
+ <a href="https://bsky.app/profile/jlsteenwyk.bsky.social" target="_blank" rel="noopener noreferrer">
52
+ <img src="https://img.shields.io/badge/Bluesky-0285FF?logo=bluesky&logoColor=fff">
46
53
  </a>
47
54
  <br />
48
55
  <a href="https://pepy.tech/badge/phykit">
@@ -1 +0,0 @@
1
- __version__ = "2.0.1"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes