eff-len 0.1.0__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 (57) hide show
  1. eff_len-0.1.0/.github/workflows/publish.yml +20 -0
  2. eff_len-0.1.0/.gitignore +5 -0
  3. eff_len-0.1.0/PKG-INFO +91 -0
  4. eff_len-0.1.0/README.md +75 -0
  5. eff_len-0.1.0/data/Azo/azo_exp.str +1 -0
  6. eff_len-0.1.0/data/Azo/azo_rfam_aln.seq +817 -0
  7. eff_len-0.1.0/data/Azo/azo_wt.seq +1 -0
  8. eff_len-0.1.0/data/Azo/design_db.csv +46298 -0
  9. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF00005.txt +60000 -0
  10. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF00028.txt +5222 -0
  11. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF00050.txt +8474 -0
  12. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF00059.txt +24750 -0
  13. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF00080.txt +1664 -0
  14. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF00114.txt +1896 -0
  15. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF00162.txt +12226 -0
  16. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF00167.txt +7980 -0
  17. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF00168.txt +11305 -0
  18. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF00169.txt +14157 -0
  19. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF00234.txt +1886 -0
  20. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF00379.txt +7834 -0
  21. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF00380.txt +4248 -0
  22. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF00442.txt +2544 -0
  23. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF00504.txt +9200 -0
  24. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF01051.txt +12639 -0
  25. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF01725.txt +2178 -0
  26. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF01734.txt +7074 -0
  27. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF01750.txt +5157 -0
  28. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF01786.txt +1758 -0
  29. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF01831.txt +2100 -0
  30. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF01852.txt +7077 -0
  31. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF01854.txt +6858 -0
  32. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF02001.txt +7090 -0
  33. eff_len-0.1.0/data/FC_NAR/RNA_MSA/RF02553.txt +582 -0
  34. eff_len-0.1.0/data/test/PF00636.25.fa +1840 -0
  35. eff_len-0.1.0/data/test/RF00028.fa +5222 -0
  36. eff_len-0.1.0/pyproject.toml +24 -0
  37. eff_len-0.1.0/reproducibility.org +1432 -0
  38. eff_len-0.1.0/scratch/RF01734_cluster.fa +708 -0
  39. eff_len-0.1.0/scratch/tmp_cluster.fa +708 -0
  40. eff_len-0.1.0/scratch/vae_RF01734.pt +0 -0
  41. eff_len-0.1.0/scratch/vae_RF01734_cluster.pt +0 -0
  42. eff_len-0.1.0/scratch/vae_RF01734_full.pt +0 -0
  43. eff_len-0.1.0/scratch/vae_test_RF01734.pkl +0 -0
  44. eff_len-0.1.0/scratch/vae_tmp_cluster.pt +0 -0
  45. eff_len-0.1.0/scripts/.#div.py +1 -0
  46. eff_len-0.1.0/scripts/data.py +287 -0
  47. eff_len-0.1.0/scripts/dca/new_dca.py +123 -0
  48. eff_len-0.1.0/scripts/dca/utils.py +193 -0
  49. eff_len-0.1.0/scripts/utils.py +330 -0
  50. eff_len-0.1.0/scripts/vae/model.py +65 -0
  51. eff_len-0.1.0/scripts/vae/utils.py +40 -0
  52. eff_len-0.1.0/src/bin/eff_len +38 -0
  53. eff_len-0.1.0/src/bin/leff +41 -0
  54. eff_len-0.1.0/src/eff_len/__init__.py +2 -0
  55. eff_len-0.1.0/src/eff_len/div.py +262 -0
  56. eff_len-0.1.0/src/eff_len/utils.py +93 -0
  57. eff_len-0.1.0/src/setup.py +12 -0
@@ -0,0 +1,20 @@
1
+ name: Publish
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ publish:
9
+ runs-on: ubuntu-latest
10
+ environment: pypi
11
+ permissions:
12
+ id-token: write
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: actions/setup-python@v5
16
+ with:
17
+ python-version: "3.12"
18
+ - run: pip install build
19
+ - run: python -m build
20
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,5 @@
1
+ __pycache__/
2
+ *.egg-info/
3
+ dist/
4
+ build/
5
+ .ipynb_checkpoints/
eff_len-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,91 @@
1
+ Metadata-Version: 2.5
2
+ Name: eff-len
3
+ Version: 0.1.0
4
+ Summary: Spectral measure of diversity for multiple sequence alignments
5
+ Project-URL: Homepage, https://github.com/vaiteaopuu/effective_length
6
+ Project-URL: Issues, https://github.com/vaiteaopuu/effective_length/issues
7
+ Author-email: Vaitea Opuu <vaitea.opuu@cnrs.fr>
8
+ License-Expression: MIT
9
+ Keywords: bioinformatics,diversity,msa,sequence-alignment
10
+ Classifier: Intended Audience :: Science/Research
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
13
+ Requires-Python: >=3.9
14
+ Requires-Dist: numpy
15
+ Description-Content-Type: text/markdown
16
+
17
+ # eff_len
18
+
19
+ Spectral measure of diversity for multiple sequence alignments.
20
+
21
+ ## Overview
22
+
23
+ This repo contains the code to reproduce the results in *"A spectral framework for measuring diversity in multiple sequence alignments"*. It introduces a measure, `L_eff`, that estimates the diversity (or amount of information) contained in a multiple sequence alignment. `L_eff` allows a faithful comparison between MSAs, as well as between generated datasets.
24
+
25
+ ## Install
26
+
27
+ Requirements: NumPy.
28
+
29
+ ```bash
30
+ pip install eff_len
31
+ ```
32
+
33
+ From source:
34
+
35
+ ```bash
36
+ git clone https://github.com/vaiteaopuu/effective_length
37
+ cd effective_length
38
+ pip install .
39
+ ```
40
+
41
+ ## Usage
42
+
43
+ ### Python
44
+
45
+ ```python
46
+ from eff_len import read_fasta, msa_to_oh, effective_length
47
+
48
+ msa = read_fasta("data/RF00028.fa", seq_type="nuc")
49
+
50
+ msa_oh = msa_to_oh(msa, seq_type="nuc")
51
+ N, L, k = msa_oh.shape
52
+ L_eff = effective_length(msa_oh)
53
+
54
+ print(N, L, L_eff, L_eff / L)
55
+ # 2611 251 35.88477058938092 0.14296721350350963
56
+ ```
57
+
58
+ `cross_effective_length` and `leff` are also exported, for comparing two alignments and for the convenience wrapper respectively.
59
+
60
+ ## Repository content
61
+
62
+ | Path | Description |
63
+ | --- | --- |
64
+ | `src/eff_len/` | The package itself |
65
+ | `analysis/` | Notebooks and scripts |
66
+ | `data/` | Example alignments |
67
+ | `reproducibility.org` | Code snippets reproducing the figures in the paper |
68
+
69
+ ## Data sources
70
+
71
+ The data used in these analyses were extracted from:
72
+
73
+ - C. Lambert *et al.* (2025) *Nat. Commun.*
74
+ - F. Calvanese *et al.* (2024) *NAR*
75
+ - M. Mirdita *et al.* (2027) *NAR*
76
+
77
+ ## Citation
78
+
79
+ If you use this code, please cite:
80
+
81
+ ```bibtex
82
+ @article{opuu_spectral,
83
+ title = {A spectral framework for measuring diversity in multiple sequence alignments},
84
+ author = {Opuu, Vaitea},
85
+ year = {2026}
86
+ }
87
+ ```
88
+
89
+ ## License
90
+
91
+ MIT
@@ -0,0 +1,75 @@
1
+ # eff_len
2
+
3
+ Spectral measure of diversity for multiple sequence alignments.
4
+
5
+ ## Overview
6
+
7
+ This repo contains the code to reproduce the results in *"A spectral framework for measuring diversity in multiple sequence alignments"*. It introduces a measure, `L_eff`, that estimates the diversity (or amount of information) contained in a multiple sequence alignment. `L_eff` allows a faithful comparison between MSAs, as well as between generated datasets.
8
+
9
+ ## Install
10
+
11
+ Requirements: NumPy.
12
+
13
+ ```bash
14
+ pip install eff_len
15
+ ```
16
+
17
+ From source:
18
+
19
+ ```bash
20
+ git clone https://github.com/vaiteaopuu/effective_length
21
+ cd effective_length
22
+ pip install .
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ ### Python
28
+
29
+ ```python
30
+ from eff_len import read_fasta, msa_to_oh, effective_length
31
+
32
+ msa = read_fasta("data/RF00028.fa", seq_type="nuc")
33
+
34
+ msa_oh = msa_to_oh(msa, seq_type="nuc")
35
+ N, L, k = msa_oh.shape
36
+ L_eff = effective_length(msa_oh)
37
+
38
+ print(N, L, L_eff, L_eff / L)
39
+ # 2611 251 35.88477058938092 0.14296721350350963
40
+ ```
41
+
42
+ `cross_effective_length` and `leff` are also exported, for comparing two alignments and for the convenience wrapper respectively.
43
+
44
+ ## Repository content
45
+
46
+ | Path | Description |
47
+ | --- | --- |
48
+ | `src/eff_len/` | The package itself |
49
+ | `analysis/` | Notebooks and scripts |
50
+ | `data/` | Example alignments |
51
+ | `reproducibility.org` | Code snippets reproducing the figures in the paper |
52
+
53
+ ## Data sources
54
+
55
+ The data used in these analyses were extracted from:
56
+
57
+ - C. Lambert *et al.* (2025) *Nat. Commun.*
58
+ - F. Calvanese *et al.* (2024) *NAR*
59
+ - M. Mirdita *et al.* (2027) *NAR*
60
+
61
+ ## Citation
62
+
63
+ If you use this code, please cite:
64
+
65
+ ```bibtex
66
+ @article{opuu_spectral,
67
+ title = {A spectral framework for measuring diversity in multiple sequence alignments},
68
+ author = {Opuu, Vaitea},
69
+ year = {2026}
70
+ }
71
+ ```
72
+
73
+ ## License
74
+
75
+ MIT
@@ -0,0 +1 @@
1
+ (((((((..((....)).)))))))...((((((....((((((...((...((((((....))))))..))...))))))(((...(.((((((....)))))).)..)))...[.[[[[[...))))))((((...(((....)))..))))......]]]]]]..((.(((((....))))).....)).