qdiv 4.0.0__py3-none-any.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.
Files changed (47) hide show
  1. qdiv/__init__.py +47 -0
  2. qdiv/citations.py +50 -0
  3. qdiv/data_object.py +1309 -0
  4. qdiv/diversity/__init__.py +25 -0
  5. qdiv/diversity/alpha_div.py +344 -0
  6. qdiv/diversity/beta_div.py +1507 -0
  7. qdiv/example_data/Modin2025_CoverM.tsv +306 -0
  8. qdiv/example_data/Modin2025_SingleM.ebd +8 -0
  9. qdiv/example_data/Modin2025_gtdbtk.ar53.summary.tsv +12 -0
  10. qdiv/example_data/Modin2025_gtdbtk.bac120.summary.tsv +294 -0
  11. qdiv/example_data/Modin2025_metadata.csv +27 -0
  12. qdiv/example_data/Modin2025_tree.nwk +1 -0
  13. qdiv/example_data/Saheb-Alam2019_meta.csv +17 -0
  14. qdiv/example_data/Saheb-Alam2019_seq_dada2.fasta +1344 -0
  15. qdiv/example_data/Saheb-Alam2019_seq_deblur.fasta +1904 -0
  16. qdiv/example_data/Saheb-Alam2019_tab_dada2.tsv +674 -0
  17. qdiv/example_data/Saheb-Alam2019_tab_deblur.tsv +954 -0
  18. qdiv/example_data/Saheb-Alam2019_tax_dada2.tsv +673 -0
  19. qdiv/example_data/Saheb-Alam2019_tax_deblur.tsv +953 -0
  20. qdiv/example_data/Saheb-Alam2019_tree_dada2.nwk +1 -0
  21. qdiv/example_data/Saheb-Alam2019_tree_deblur.nwk +1 -0
  22. qdiv/example_data/loader.py +12 -0
  23. qdiv/io/__init__.py +17 -0
  24. qdiv/io/files.py +965 -0
  25. qdiv/io/subset.py +892 -0
  26. qdiv/model/__init__.py +21 -0
  27. qdiv/model/null.py +994 -0
  28. qdiv/model/simulate.py +273 -0
  29. qdiv/plot/__init__.py +23 -0
  30. qdiv/plot/diversity_plots.py +897 -0
  31. qdiv/plot/ordination_plots.py +510 -0
  32. qdiv/plot/relative_abundance_plots.py +1006 -0
  33. qdiv/sequences/__init__.py +16 -0
  34. qdiv/sequences/accelerate.py +102 -0
  35. qdiv/sequences/sequence_comparisons.py +931 -0
  36. qdiv/stats/__init__.py +18 -0
  37. qdiv/stats/distance_tests.py +428 -0
  38. qdiv/stats/ordination_calculations.py +981 -0
  39. qdiv/utils/__init__.py +3 -0
  40. qdiv/utils/data_utils.py +491 -0
  41. qdiv/utils/phylo_utils.py +460 -0
  42. qdiv/utils/plot_utils.py +409 -0
  43. qdiv-4.0.0.dist-info/METADATA +68 -0
  44. qdiv-4.0.0.dist-info/RECORD +47 -0
  45. qdiv-4.0.0.dist-info/WHEEL +5 -0
  46. qdiv-4.0.0.dist-info/licenses/LICENSE +15 -0
  47. qdiv-4.0.0.dist-info/top_level.txt +1 -0
qdiv/__init__.py ADDED
@@ -0,0 +1,47 @@
1
+ """
2
+ qdiv: Microbial diversity analysis with Hill numbers
3
+ ====================================================
4
+
5
+ This package provides tools for diversity analysis, including:
6
+
7
+ - **Data structures**: Easily filter and manipulate abundance tables, taxonomic data, and phylogenetic trees.
8
+ - **Diversity calculations**: Compute alpha and beta diversity metrics, focusing on the Hill number framework.
9
+ - **Statistics**: Perform multivariate tests and generate null models.
10
+ - **Visualization**: Create plots for ordinations, diversity metrics, and relative abundance.
11
+
12
+ Subpackages
13
+ -----------
14
+ .. autosummary::
15
+ :toctree: _autosummary
16
+
17
+ qdiv.sequences
18
+ qdiv.stats
19
+ qdiv.diversity
20
+ qdiv.plot
21
+ qdiv.model
22
+
23
+ """
24
+
25
+ __version__ = "4.0.0"
26
+ __author__ = "Oskar Modin"
27
+ __docformat__ = "restructuredtext"
28
+
29
+ # Public API imports
30
+ from .data_object import MicrobiomeData
31
+ from .citations import citations
32
+ from . import sequences
33
+ from . import stats
34
+ from . import diversity
35
+ from . import plot
36
+ from . import model
37
+
38
+ __all__ = [
39
+ "MicrobiomeData",
40
+ "citations",
41
+ "sequences",
42
+ "stats",
43
+ "diversity",
44
+ "plot",
45
+ "model"
46
+ ]
47
+
qdiv/citations.py ADDED
@@ -0,0 +1,50 @@
1
+ def citations(f="all") -> None:
2
+ """
3
+ Function to show key references that were important for developing qdiv.
4
+
5
+ Parameters
6
+ ----------
7
+ f : str, optional
8
+ Define for which function references will be displayed. The default is "all".
9
+
10
+ Returns
11
+ -------
12
+ None.
13
+ """
14
+
15
+ if f == "all" or f == "qdiv":
16
+ print("qdiv package:")
17
+ print("Modin, O. https://github.com/omvatten/qdiv")
18
+ if f == "all" or f in ["diversity.naive_alpha", "diversity.naive_beta", "diversity.naive_multi_beta", "naive"]:
19
+ print("\nNaive diversity:")
20
+ print("Hill, M. O. (1973). Ecology 54(2): 427-432.")
21
+ print("Jost, L. (2006). OIKOS 113(2): 363-375.")
22
+ print("Jost, L. (2007). Ecology 88(10): 2427-2439.")
23
+ if f == "all" or f in ["diversity.phyl_alpha", "diversity.phyl_beta", "diversity.phyl_multi_beta", "phyl"]:
24
+ print("\nPhylogenetic diversity:")
25
+ print("Chao, A., C.-H. Chiu and L. Jost (2010). Philosophical Transactions of the Royal Society B: Biological Sciences 365(1558): 3599-3609.")
26
+ print("Chiu, C. H., L. Jost and A. Chao (2014). Ecological Monographs 84(1): 21-44.")
27
+ if f == "all" or f in ["diversity.func_alpha", "diversity.func_beta", "diversity.func_multi_beta", "func"]:
28
+ print("\nFunctional diversity:")
29
+ print("Chiu, C. H. and A. Chao (2014). PLoS One 9(7): e100014.")
30
+ if f == "all" or f in ["diversity.evenness", "diversity.dissimilarity_by_feature", "plot.dissimilarity_contributions"]:
31
+ print("\nEvenness:")
32
+ print("Chao, A. and C. Ricotta (2019). Ecology 100(12): e02852.")
33
+ if f == "all" or f in ["model.rcq"]:
34
+ print("\nRCq null model:")
35
+ print("Raup, D. M. and R. E. Crick (1979). Journal of Paleontology 53(5): 1213-1227.")
36
+ print("Chase, J. M., N. J. B. Kraft, K. G. Smith, M. Vellend and B. D. Inouye (2011). Ecosphere 2(2): 24.")
37
+ print("Stegen, J. C., X. Lin, J. K. Fredrickson, X. Chen, D. W. Kennedy, C. J. Murray, M. L. Rockhold and A. Konopka (2013). ISME Journal 7(11): 2069-2079.")
38
+ print("Modin, O., R. Liébana, S. Saheb-Alam, B.-M. Wilén, C. Suarez, M. Hermansson and F. Persson (2020). Microbiome 8, 132, DOI: 10.1186/s40168-020-00909-7")
39
+ if f == "all" or f in ["model.nriq", "model.ntiq"]:
40
+ print("\nNRI and NTI:")
41
+ print("Webb, C. O., D. D. Ackerly, M. A. McPeek and M. J. Donoghue (2002). Annual Review of Ecology and Systematics 33(1): 475-505.")
42
+ if f == "all" or f in ["model.beta_nriq", "model.beta_ntiq"]:
43
+ print("\nbeta NRI and beta NTI:")
44
+ print("Fine, P. V. A. and S. W. Kembel (2011). Ecography 34: 552-565.")
45
+ if f == "all" or f in ["stats.mantel"]:
46
+ print("\nMantel test:")
47
+ print("Mantel, N. (1967). Cancer Research 27(2): 209-220.")
48
+ if f == "all" or f in ["stats.permanova"]:
49
+ print("\nPermanova test:")
50
+ print("Anderson, M. (2001). Austral Ecology 26(1): 32-46.")