File: index.rst

package info (click to toggle)
python-skbio 0.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,924 kB
  • sloc: python: 67,527; ansic: 672; makefile: 225
file content (341 lines) | stat: -rw-r--r-- 9,910 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
.. remove right sidebar

:html_theme.sidebar_secondary.remove:


.. page style and classes

.. raw:: html

   <style>

     .bd-main .bd-content .bd-article-container {
       max-width: 100%;
     }

     details > summary {
       font-weight: bold;
     }

     .centered {
       text-align: center;
     }

     .subtitle {
       text-align: center;
       font-size: 1.2em;
       margin: 20px;
     }

     .heading {
       text-align: center;
       font-size: 1.5em;
       font-weight: 900;
     }

     .no-top-pardding {
       margin-top: 0;
       padding-top: 0;
     }

   </style>


.. hidden page title

.. title:: scikit-bio: Bioinformatics in Python


.. light/dark logo image

.. image:: _static/img/logo.svg
   :class: only-light
   :width: 600 px
   :align: center

.. image:: _static/img/logo_inv.svg
   :class: only-dark
   :width: 600 px
   :align: center


.. brief description of the project

.. rst-class:: subtitle

   A community-driven Python library for bioinformatics, providing versatile data structures, algorithms and educational resources.


.. toctree hidden from document but provides header links

.. toctree::
   :hidden:
   :maxdepth: 1

   Install <install>
   Learn <learn>
   Documentation <https://scikit.bio/docs/latest/index.html>
   Contribute <contribute>
   Community <https://github.com/scikit-bio/scikit-bio/discussions>
   Releases <https://github.com/scikit-bio/scikit-bio/blob/main/CHANGELOG.md>
   About <about>


.. grid:: 1 1 1 3

   .. grid-item-card::
      :class-header: centered

      **For Researchers** :octicon:`beaker;1.2em;sd-text-danger`
      ^^^

      Robust, performant and scalable algorithms tailored for the vast landscape of biological data analysis spanning genomics, microbiomics, ecology, evolutionary biology and more. Built to unveil the insights hidden in complex, multi-omic data.
      +++

      .. dropdown example code, implemented using raw html details instead of sphinx-design's dropdown, because the latter has extra edges

      .. raw:: html

         <details>
         <summary>Example</summary>

      .. code-block:: python

         from skbio.tree import TreeNode
         from skbio.diversity import beta_diversity
         from skbio.stats.ordination import pcoa

         data = pd.read_table('data.tsv', index_col=0)
         metadata = pd.read_table('metadata.tsv', index_col=0)
         tree = TreeNode.read('tree.nwk')

         bdiv = beta_diversity(
             'weighted_unifrac', data, ids=data.index, otu_ids=data.columns, tree=tree
         )

         ordi = pcoa(bdiv, number_of_dimensions=3)
         ordi.plot(metadata, column='bodysite')

      .. image:: _static/img/hmp1_pcoa.png
         :alt: PCoA plot

      .. raw:: html

         </details>

   .. grid-item-card::
      :class-header: centered
      
      **For Educators** :octicon:`mortar-board;1.2em;sd-text-info`
      ^^^

      Fundamental bioinformatics algorithms enriched by comprehensive documentation, examples and references, offering a rich resource for classroom and laboratory education (with proven `success <https://readiab.org/>`_). Designed to spark curiosity and foster innovation.
      +++

      .. raw:: html

         <details>
         <summary>Example</summary>

      .. code-block:: python

         from skbio.alignment import global_pairwise_align_protein
         from skbio.sequence.distance import hamming
         from skbio.stats.distance import DistanceMatrix
         from skbio.tree import nj

         def align_dist(seq1, seq2):
             aln = global_pairwise_align_protein(seq1, seq2)[0]
             return hamming(aln[0], aln[1])

         dm = DistanceMatrix.from_iterable(
            seqs, align_dist, keys=ids, validate=False
         )

         tree = nj(dm).root_at_midpoint()
         print(tree.ascii_art())

      ::

                   /-chicken
                  |
         -root----|                    /-rat
                  |          /--------|
                  |         |          \-mouse
                   \--------|
                            |          /-pig
                            |         |
                             \--------|                    /-chimp
                                      |          /--------|
                                       \--------|          \-human
                                                |
                                                 \-monkey


      .. raw:: html

         </details>

   .. grid-item-card::
      :class-header: centered

      **For Developers** :octicon:`git-merge;1.2em;sd-text-warning`
      ^^^

      Industry-standard, production-ready Python codebase featuring a stable, unit-tested API that streamlines development and integration. Licensed under the :repo:`3-Clause BSD <blob/main/LICENSE.txt>`, it provides an expansive platform for both academic research and commercial ventures.
      +++

      .. raw:: html

         <details>
         <summary>Example</summary>

      .. code-block:: python

         def centralize(mat):
             r"""Center data around its geometric average.

             Parameters
             ----------
             mat : array_like of shape (n_compositions, n_components)
                 A matrix of proportions.

             Returns
             -------
             ndarray of shape (n_compositions, n_components)
                 centered composition matrix.

             Examples
             --------
             >>> import numpy as np
             >>> from skbio.stats.composition import centralize
             >>> X = np.array([[.1, .3, .4, .2], [.2, .2, .2, .4]])
             >>> centralize(X)
             array([[ 0.17445763,  0.30216948,  0.34891526,  0.17445763],
                    [ 0.32495488,  0.18761279,  0.16247744,  0.32495488]])

             """
             mat = closure(mat)
             cen = gmean(mat, axis=0)
             return perturb_inv(mat, cen)

      .. raw:: html

         </details>

----


.. grid:: 1 1 1 2

   .. grid-item::
      :columns: 12 12 5 5
      :padding: 0 0 4 4

      .. rst-class:: heading

         Install

      .. tab-set::
         :class: no-top-pardding

         .. tab-item:: Conda

            .. code-block:: bash

               conda install -c conda-forge scikit-bio

         .. tab-item:: PyPI

            .. code-block:: bash

               pip install scikit-bio

         .. tab-item:: Dev

            .. code-block:: bash

               pip install git+https://github.com/scikit-bio/scikit-bio.git

         .. tab-item:: More

            See detailed :doc:`instructions <install>` on installing scikit-bio on various platforms.

   .. grid-item::
      :columns: 12 12 7 7
      :padding: 0 0 4 4

      .. rst-class:: heading

         News

      .. card-carousel:: 3

         .. card::

            Latest release (2025-01-13):

            .. button-link:: https://github.com/scikit-bio/scikit-bio/releases/tag/0.6.3
               :color: success
               :shadow:

               scikit-bio 0.6.3

         .. card::

            Thrilled with completion of `scikit-bio workshop <https://www.iscb.org/ismb2024/programme-schedule/tutorials#ip3>`_ at ISMB 2024. Materials are `publicly available <https://github.com/scikit-bio/scikit-bio-tutorials>`_.

         .. card::

            New `DOE award <https://genomicscience.energy.gov/compbioawards2023/#Expanding>`_ for scikit-bio development in multi-omics and complex modeling.

         .. card::

            New website: `scikit.bio <https://scikit.bio>`_ and organization: https://github.com/scikit-bio are online.

----


.. rst-class:: heading

   Feature Highlights

.. grid:: 1 2 3 3
   :padding: 0 0 4 4
   :gutter: 3

   .. grid-item-card::

      :fa:`dna;fa-2x sd-text-success`

      **Biological sequences**: Efficient data structure with a :docs:`flexible grammar <sequence.GrammaredSequence>` for easy manipulation, :docs:`annotation <sequence.GrammaredSequence.has_positional_metadata>`, :docs:`alignment <alignment.global_pairwise_align>`, and conversion into :docs:`motifs <sequence.GrammaredSequence.find_motifs>` or :docs:`k-mers <sequence.GrammaredSequence.iter_kmers>` for in-depth analysis.

   .. grid-item-card::

      :fa:`tree;fa-2x sd-text-success`

      **Phylogenetic trees**: Scalable :docs:`tree structure <tree.TreeNode>` tailored for evolutionary biology, supporting diverse operations in :docs:`navigation <tree.TreeNode.lca>`, :docs:`manipulation <tree.TreeNode.root_at_midpoint>`, :docs:`comparison <tree.TreeNode.compare_rfd>`, and :docs:`construction <tree.nj>`.

   .. grid-item-card::

      :fa:`chart-column;fa-2x sd-text-success`

      **Community diversity** analysis for ecological studies, with an extensive suite of metrics such as :docs:`UniFrac <diversity.beta.weighted_unifrac>` and :docs:`PD <diversity.alpha.faith_pd>`, optimized to handle large-scale community datasets.

   .. grid-item-card::

      :fa:`compass-drafting;fa-2x sd-text-success`

      **Ordination methods**, such as :docs:`PCoA <stats.ordination.pcoa>`, :docs:`CA <stats.ordination.ca>`, and :docs:`RDA <stats.ordination.rda>`, to uncover patterns underlying high-dimensional data, facilitating insightful visualization.

   .. grid-item-card::

      :fa:`arrow-up-right-dots;fa-2x sd-text-success`

      **Multivariate statistical tests**, such as :docs:`PERMANOVA <stats.distance.permanova>`, :docs:`BIOENV <stats.distance.bioenv>`, and :docs:`Mantel <stats.distance.mantel>`, to decode complex relationships across data matrices and sample properties.

   .. grid-item-card::

      :fa:`chart-pie;fa-2x sd-text-success`

      **Compositional data** processing and analysis, such as :docs:`CLR <stats.composition.clr>` transform and :docs:`ANCOM <stats.composition.ancom>`, built for various omic data types from high-throughput experiments.