diff --git a/docs/conf.py b/docs/conf.py index 391b701..28a89e1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,56 +1,82 @@ -# Configuration file for the Sphinx documentation builder. -# -# This file only contains a selection of the most common options. For a full -# list see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# -- Path setup -------------------------------------------------------------- +#!/bin/env python3 -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# -import os import sys -sys.path.insert(0, os.path.abspath('../../kmerdb')) - -print("Reading documentation from {0}".format(sys.path)) +import os +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information project = 'kmerdb' -copyright = '2022, Matt Ralston ' -author = 'Matt Ralston ' -# The full version, including alpha/beta/rc tags release = '0.8.6' - +author = 'Matt Ralston , and the kmerdb project contributors' +copyright = '2020, Matt Ralston ' +language = 'en' # -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = ['sphinx.ext.viewcode', 'sphinx.ext.autodoc'] - -# Add any paths that contain templates here, relative to this directory. -#templates_path = ['_templates'] +extensions = [] -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. +templates_path = ['_templates'] exclude_patterns = [] + # -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# html_theme = 'alabaster' +html_static_path = ['_static'] + + +#html_theme = 'sphinx_rtd_theme' +html_theme_options = { + 'logo_only': True, + 'navigation_depth': 5, +} +#html_context = {} + + + + + +extensions = [ + 'sphinx.ext.intersphinx', + 'sphinx.ext.autodoc', + 'sphinx.ext.autosummary', + 'sphinx.ext.mathjax', + 'sphinx.ext.viewcode', +# 'sphinx_rtd_theme', +] + +templates_path = ['_templates'] +source_suffix = '.rst' +exclude_patterns = [] +locale_dirs = ['locale/'] +gettext_compact = False + +master_doc = 'index' +suppress_warnings = ['image.nonlocal_uri'] +pygments_style = 'default' + +if sys.version_info < (3, 0): + tags.add("python2") +else: + tags.add("python3") + +intersphinx_mapping = { + 'biopython': ('https://biopython.readthedocs.io/en/latest', None), + 'numpy': ('https://numpy.readthedocs.io/en/latest', None), + 'scipy': ('https://scipy.readthedocs.io/en/latest', None), + 'kmerdb': ('https://kmerdb.readthedocs.io/en/latest/', None), + 'rtd': ('https://docs.readthedocs.io/en/stable/', None), + 'sphinx': ('https://www.sphinx-doc.org/en/master/', None), +} + -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -#html_static_path = ['_static'] diff --git a/docs/index.rst b/docs/index.rst deleted file mode 100644 index b67fae9..0000000 --- a/docs/index.rst +++ /dev/null @@ -1,115 +0,0 @@ - - -kmerdb -=================== - -- [ x ] [Homepage:](https://matthewralston.github.io/kmerdb) -- [ x ] [Quick Start guide](https://matthewralston.github.io/kmerdb/quickstart) -- [ x ] `kmerdb usage subcommand_name` - - `profile` - Make k-mer count vectors/profiles, calculate unique k-mer counts, total k-mer counts, nullomer counts. Import to read/write NumPy arrays from profile object attributes. - - `graph` - Make a weighted edge list of kmer-to-kmer relationships, akin to a De Bruijn graph. - - `usage` - Display verbose input file/parameter and algorithm details of subcommands. - - `help` - Display verbose input file/parameter and algorithm details of subcommands. - - `view` - View .tsv count/frequency vectors with/without preamble. - - `header` - View YAML formatted header and aggregate counts - - `matrix` - Collate multiple profiles into a count matrix for dimensionality reduction, etc. - - `kmeans` - k-means clustering on a distance matrix via Scikit-learn or BioPython with kcluster distances - - `hierarchical` - hierarchical clustering on a distance matrix via BioPython with linkage choices - - `distance` - Distance matrices (from kmer count matrices) including SciPy distances, a Pearson correlation coefficient implemented in Cython, and Spearman rank correlation included as additional distances. - - `index` - Create an index file for the kmer profile (Delayed:) - - `shuf` - Shuffle a k-mer count vector/profile (Delayed:) - - `version` - Display kmerdb version number - - `citation` - Silence citation suggestion -- [ x ] `kmerdb subcommand -h|--help` - - -k-mer counts from .fa(.gz)/.fq(.gz) sequence data can be computed and stored for access to metadata and count aggregation faculties. For those familiar with `.bam`, a `view` and `header` functions are provided. This file is compatible with `zlib`. - -Install with `pip install kmerdb` - - -Please see the [Quickstart guide](https://matthewralston.github.io/kmerdb/quickstart) for more information about the format, the library, and the project. - - - -Documentation -=================== - -:README.md: https://github.com/MatthewRalston/kmerdb - -:Mainpage: https://matthewralston.github.io/ - -:QuickStart Guide: https://matthewralston.github.io/kmerdb/quickstart/ - -:GitHub: https://github.com/MatthewRalston/kmerdb/ - -:Issue Tracker: https://github.com/MatthewRalston/kmerdb/issues/ - -:TODO: https://github.com/MatthewRalston/kmerdb/blob/main/TODO.org - -:License URI: https://github.com/MatthewRalston/kmerdb/blob/main/LICENSE.txt - -:License: Apache v2.0 - - - -IUPAC support -=================== - - - -:: - kmerdb profile -k $k -o output input.fa # This will simply discard k-mers containing non-IUPAC characters. - - - -IUPAC residues (ATCG+RYSWKM+BDHV) are kept throughout the k-mer counting. But non-IUPAC residues (N) and characters are trimmed from the sequences prior to k-mer counting. Non-standard IUPAC residues are counted as doublets or triplets. - - - -## Development - - -```bash -python setup.py test -``` - -## License - -Created by Matthew Ralston - [Scientist, Programmer, Musician](http://matthewralston.github.io) - [Email](mailto:mralston.development@gmail.com) - -Distributed under the Apache license. See `LICENSE.txt` for the copy distributed with this project. Open source software is not for everyone, and im the author and maintainer. cheers, on me. You may use and distribute this software, gratis, so long as the original LICENSE.txt is distributed along with the software. This software is distributed AS IS and provides no warranties of any kind. - -``` - Copyright 2020 Matthew Ralston - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -``` - -## Contributing - -1. Fork it () -2. Create your feature branch (`git checkout -b feature/fooBar`) -3. Commit your changes (`git commit -am 'Add some fooBar'`) -4. Push to the branch (`git push origin feature/fooBar`) -5. Create a new Pull Request - -## Acknowledgements - -Thanks mom and dad and my hometown, awesome hs, and the University of Delaware faculty for support and encouragement. Thanks to my former mentors, bosses, and coworkers. It's been really enjoyable anticipating what the metagenomics community might want from a tool that can handle microbial k-mers well. - -Thank you to the authors of kPAL and Jellyfish for the inspiration and bit shifting trick. And thank you to others for the encouragement along the way, who shall remain nameless. - -The intention is that more developers would want to add functionality to the codebase or even just utilize things downstream, but to build out directly with numpy and scipy/scikit as needed to suggest the basic infrastructure for the ML problems and modeling approaches that could be applied to such datasets. This project began under GPL v3.0 and was relicensed with Apache v2. Hopefully this project could gain some interest. I have so much fun working on this project. There's more to it than meets the eye. I'm working on a preprint, and the draft is included in some of the latest versions of the codebase, specifically .Rmd files. - -More on the flip-side. It's so complex with technology these days... diff --git a/docs/source/conf.py b/docs/source/conf.py index cc9c799..28a89e1 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,56 +1,82 @@ -# Configuration file for the Sphinx documentation builder. -# -# This file only contains a selection of the most common options. For a full -# list see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# -- Path setup -------------------------------------------------------------- +#!/bin/env python3 -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# -import os import sys -sys.path.insert(0, os.path.abspath('../../kmerdb')) - -print("Reading documentation from {0}".format(sys.path)) +import os +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information project = 'kmerdb' -copyright = '2022, Matt Ralston ' -author = 'Matt Ralston ' - -# The full version, including alpha/beta/rc tags -release = '0.7.2' +release = '0.8.6' +author = 'Matt Ralston , and the kmerdb project contributors' +copyright = '2020, Matt Ralston ' +language = 'en' # -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = ['sphinx.ext.viewcode', 'sphinx.ext.autodoc'] +extensions = [] -# Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. exclude_patterns = [] + # -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# html_theme = 'alabaster' - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] + + +#html_theme = 'sphinx_rtd_theme' +html_theme_options = { + 'logo_only': True, + 'navigation_depth': 5, +} +#html_context = {} + + + + + +extensions = [ + 'sphinx.ext.intersphinx', + 'sphinx.ext.autodoc', + 'sphinx.ext.autosummary', + 'sphinx.ext.mathjax', + 'sphinx.ext.viewcode', +# 'sphinx_rtd_theme', +] + +templates_path = ['_templates'] +source_suffix = '.rst' +exclude_patterns = [] +locale_dirs = ['locale/'] +gettext_compact = False + +master_doc = 'index' +suppress_warnings = ['image.nonlocal_uri'] +pygments_style = 'default' + +if sys.version_info < (3, 0): + tags.add("python2") +else: + tags.add("python3") + +intersphinx_mapping = { + 'biopython': ('https://biopython.readthedocs.io/en/latest', None), + 'numpy': ('https://numpy.readthedocs.io/en/latest', None), + 'scipy': ('https://scipy.readthedocs.io/en/latest', None), + 'kmerdb': ('https://kmerdb.readthedocs.io/en/latest/', None), + 'rtd': ('https://docs.readthedocs.io/en/stable/', None), + 'sphinx': ('https://www.sphinx-doc.org/en/master/', None), +} + + diff --git a/docs/source/index.rst b/docs/source/index.rst index f6cc754..e10a0b2 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,20 +1,132 @@ + +kmerdb +=================== + +- [ x ] [Homepage:](https://matthewralston.github.io/kmerdb) +- [ x ] [Quick Start guide](https://matthewralston.github.io/kmerdb/quickstart) +- [ x ] `kmerdb usage subcommand_name` + - `profile` - Make k-mer count vectors/profiles, calculate unique k-mer counts, total k-mer counts, nullomer counts. Import to read/write NumPy arrays from profile object attributes. + - `graph` - Make a weighted edge list of kmer-to-kmer relationships, akin to a De Bruijn graph. + - `usage` - Display verbose input file/parameter and algorithm details of subcommands. + - `help` - Display verbose input file/parameter and algorithm details of subcommands. + - `view` - View .tsv count/frequency vectors with/without preamble. + - `header` - View YAML formatted header and aggregate counts + - `matrix` - Collate multiple profiles into a count matrix for dimensionality reduction, etc. + - `kmeans` - k-means clustering on a distance matrix via Scikit-learn or BioPython with kcluster distances + - `hierarchical` - hierarchical clustering on a distance matrix via BioPython with linkage choices + - `distance` - Distance matrices (from kmer count matrices) including SciPy distances, a Pearson correlation coefficient implemented in Cython, and Spearman rank correlation included as additional distances. + - `index` - Create an index file for the kmer profile (Delayed:) + - `shuf` - Shuffle a k-mer count vector/profile (Delayed:) + - `version` - Display kmerdb version number + - `citation` - Silence citation suggestion +- [ x ] `kmerdb subcommand -h|--help` + + +k-mer counts from .fa(.gz)/.fq(.gz) sequence data can be computed and stored for access to metadata and count aggregation faculties. For those familiar with `.bam`, a `view` and `header` functions are provided. This file is compatible with `zlib`. + +Install with `pip install kmerdb` + + +Please see the [Quickstart guide](https://matthewralston.github.io/kmerdb/quickstart) for more information about the format, the library, and the project. + + + +Documentation +=================== + +:README.md: https://github.com/MatthewRalston/kmerdb + +:Mainpage: https://matthewralston.github.io/ + +:QuickStart Guide: https://matthewralston.github.io/kmerdb/quickstart/ + +:GitHub: https://github.com/MatthewRalston/kmerdb/ + +:Issue Tracker: https://github.com/MatthewRalston/kmerdb/issues/ + +:TODO: https://github.com/MatthewRalston/kmerdb/blob/main/TODO.org + +:License URI: https://github.com/MatthewRalston/kmerdb/blob/main/LICENSE.txt + +:License: Apache v2.0 + + + +IUPAC support +=================== + + + +:: + kmerdb profile -k $k -o output input.fa # This will simply discard k-mers containing non-IUPAC characters. + + + +IUPAC residues (ATCG+RYSWKM+BDHV) are kept throughout the k-mer counting. But non-IUPAC residues (N) and characters are trimmed from the sequences prior to k-mer counting. Non-standard IUPAC residues are counted as doublets or triplets. + + + +## Development + + +```bash +python setup.py test +``` + +## License + +Created by Matthew Ralston - [Scientist, Programmer, Musician](http://matthewralston.github.io) - [Email](mailto:mralston.development@gmail.com) + +Distributed under the Apache license. See `LICENSE.txt` for the copy distributed with this project. Open source software is not for everyone, and im the author and maintainer. cheers, on me. You may use and distribute this software, gratis, so long as the original LICENSE.txt is distributed along with the software. This software is distributed AS IS and provides no warranties of any kind. + +``` + Copyright 2020 Matthew Ralston + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +``` + +## Contributing + +1. Fork it () +2. Create your feature branch (`git checkout -b feature/fooBar`) +3. Commit your changes (`git commit -am 'Add some fooBar'`) +4. Push to the branch (`git push origin feature/fooBar`) +5. Create a new Pull Request + +## Acknowledgements + +Thanks mom and dad and my hometown, awesome hs, and the University of Delaware faculty for support and encouragement. Thanks to my former mentors, bosses, and coworkers. It's been really enjoyable anticipating what the metagenomics community might want from a tool that can handle microbial k-mers well. + +Thank you to the authors of kPAL and Jellyfish for the inspiration and bit shifting trick. And thank you to others for the encouragement along the way, who shall remain nameless. + +The intention is that more developers would want to add functionality to the codebase or even just utilize things downstream, but to build out directly with numpy and scipy/scikit as needed to suggest the basic infrastructure for the ML problems and modeling approaches that could be applied to such datasets. This project began under GPL v3.0 and was relicensed with Apache v2. Hopefully this project could gain some interest. I have so much fun working on this project. There's more to it than meets the eye. I'm working on a preprint, and the draft is included in some of the latest versions of the codebase, specifically .Rmd files. + +More on the flip-side. It's so complex with technology these days... + .. kmerdb documentation master file, created by - sphinx-quickstart on Wed Dec 28 16:20:08 2022. + sphinx-quickstart on Thu Aug 8 00:32:04 2024. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -Welcome to kmerdb's documentation! -================================== +kmerdb documentation +==================== + +Add your content using ``reStructuredText`` syntax. See the +`reStructuredText `_ +documentation for details. + .. toctree:: :maxdepth: 2 :caption: Contents: - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/docs/source/kmerdb.rst b/docs/source/kmerdb.rst deleted file mode 100644 index 970c77e..0000000 --- a/docs/source/kmerdb.rst +++ /dev/null @@ -1,93 +0,0 @@ -kmerdb package -============== - -Submodules ----------- - -kmerdb.config module --------------------- - -.. automodule:: kmerdb.config - :members: - :undoc-members: - :show-inheritance: - -kmerdb.distance module ----------------------- - -.. automodule:: kmerdb.distance - :members: - :undoc-members: - :show-inheritance: - -kmerdb.fileutil module ----------------------- - -.. automodule:: kmerdb.fileutil - :members: - :undoc-members: - :show-inheritance: - -kmerdb.index module -------------------- - -.. automodule:: kmerdb.index - :members: - :undoc-members: - :show-inheritance: - -kmerdb.kmer module ------------------- - -.. automodule:: kmerdb.kmer - :members: - :undoc-members: - :show-inheritance: - -kmerdb.parse module -------------------- - -.. automodule:: kmerdb.parse - :members: - :undoc-members: - :show-inheritance: - -kmerdb.probability module -------------------------- - -.. automodule:: kmerdb.probability - :members: - :undoc-members: - :show-inheritance: - -kmerdb.python\_distances module -------------------------------- - -.. automodule:: kmerdb.python_distances - :members: - :undoc-members: - :show-inheritance: - -kmerdb.seqparser module ------------------------ - -.. automodule:: kmerdb.seqparser - :members: - :undoc-members: - :show-inheritance: - -kmerdb.util module ------------------- - -.. automodule:: kmerdb.util - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: kmerdb - :members: - :undoc-members: - :show-inheritance: diff --git a/pyproject.toml b/pyproject.toml index 1a63d50..0ae9f0a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -104,7 +104,7 @@ dev = [ ######################################### 'docutils>=0.17', #'grip>=4.6.2', - 'sphinx>=4.3.2', + 'sphinx>=8.0.2', #'sphinx-autodoc', # These are kind of developmental things, there really cant be testing around a 5% tested codebase, this is open source at its worse, # and considering otherwise is toxic. diff --git a/requirements-dev.txt b/requirements-dev.txt index 5416853..893f109 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -13,7 +13,7 @@ setuptools>=61.3.1 ######################################### docutils>=0.17 #grip>=4.6.2 -sphinx>=4.3.2 +sphinx>=8.0.2 # sphinx-autodoc # These are kind of developmental things, there really cant be testing around a 5% tested codebase, this is open source at its worse, # and considering otherwise is toxic.