Commit 4908db59 authored by Martin Larralde's avatar Martin Larralde
Browse files

Fix build of documentation in ReadTheDocs environment

parent edc1eafd
API Reference
=============
.. autoclass:: peptides.Peptide
Peptide
-------
.. autoclass:: peptides.Peptide(Sequence[str])
:special-members: __init__
:members:
Descriptors
-----------
.. autoclass:: peptides.BLOSUMIndices
.. autoclass:: peptides.CrucianiProperties
.. autoclass:: peptides.FasgaiVectors
.. autoclass:: peptides.KideraFactors
.. autoclass:: peptides.MSWHIMScores
.. autoclass:: peptides.ProtFPDescriptors
.. autoclass:: peptides.STScales
.. autoclass:: peptides.TScales
.. autoclass:: peptides.VHSEScales
.. autoclass:: peptides.ZScales
......@@ -10,6 +10,7 @@ import configparser
import datetime
import os
import sys
import types
import re
import shutil
import semantic_version
......@@ -25,6 +26,11 @@ docssrc_dir = os.path.dirname(os.path.abspath(__file__))
project_dir = os.path.dirname(docssrc_dir)
sys.path.insert(0, project_dir)
# Mock dynamically generated Python files so that we can build the documentation
# without having build these files first (e.g on ReadTheDocs)
sys.modules['peptides.data.tables'] = types.ModuleType('peptides.data.tables')
sys.modules['peptides.data.lut'] = types.ModuleType('peptides.data.lut')
# -- Sphinx Setup ------------------------------------------------------------
......@@ -37,6 +43,7 @@ def setup(app):
# -- Project information -----------------------------------------------------
import peptides
# extract the project metadata from the module itself
......
......@@ -117,7 +117,7 @@ class ZScales(typing.NamedTuple):
z5: float
class Peptide(object):
class Peptide(typing.Sequence[str]):
# --- Class constants ----------------------------------------------------
......@@ -150,26 +150,26 @@ class Peptide(object):
organism, or using k-mer shuffling.
Arguments:
length (`int`): The desired length for the generated peptide.
frequencies (`str`): The name of the amino-acid frequency table
to use: either *KingJukes* to use the amino-acid frequencies
for vertebrate organisms reported in King & Jukes (1969),
or *SwissProt2021* to use the amino-acid frequencies in all
the proteins from the January 2021 release of SwissProt.
length (`int`): The desired length for the generated peptide.
frequencies (`str`): The name of the amino-acid frequency table
to use: either *KingJukes* to use the amino-acid frequencies
for vertebrate organisms reported in King & Jukes (1969),
or *SwissProt2021* to use the amino-acid frequencies in all
the proteins from the January 2021 release of SwissProt.
Returns:
`~peptides.Peptide`: A new peptide. The first amino-acid will
always be a Methionine for biological accuracy.
References:
- King, J. L., and T. H. Jukes.
*Non-Darwinian Evolution*.
Science. May 1969;164(3881):788–98.
doi:10.1126/science.164.3881.788. PMID:5767777.
- The UniProt Consortium.
*UniProt: The Universal Protein Knowledgebase in 2021*.
Nucleic Acids Research. Jan 2021;49(D1):D480–89.
doi:10.1093/nar/gkaa1100. PMID:33237286.
- King, J. L., and T. H. Jukes.
*Non-Darwinian Evolution*.
Science. May 1969;164(3881):788–98.
doi:10.1126/science.164.3881.788. PMID:5767777.
- The UniProt Consortium.
*UniProt: The Universal Protein Knowledgebase in 2021*.
Nucleic Acids Research. Jan 2021;49(D1):D480–89.
doi:10.1093/nar/gkaa1100. PMID:33237286.
"""
table = tables.AA_FREQUENCIES.get(frequencies)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment