Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update doc links to new Bloom lab webpage #184

Merged
merged 3 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ polyclonal

Model mutational escape from polyclonal antibodies using deep mutational scanning data.

``polyclonal`` is a Python package written by `the Bloom lab <https://research.fhcrc.org/bloom/en.html>`_.
``polyclonal`` is a Python package written by `the Bloom lab <https://jbloomlab.org>`_.

See `Yu et al (2022) <https://doi.org/10.1093/ve/veac110>`_ for an explanation of the approach implemented in ``polyclonal``.

Expand Down
2 changes: 1 addition & 1 deletion docs/acknowledgments.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Acknowledgements
-----------------
``polyclonal`` is written by `the Bloom lab <https://research.fhcrc.org/bloom/en.html>`_.
``polyclonal`` is written by `the Bloom lab <https://jbloomlab.org>`_.

The citation for ``polyclonal`` is `Yu et al (2022) <https://doi.org/10.1093/ve/veac110>`_.

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
# General information about the project.
project = "polyclonal"
copyright = f"2019--{datetime.datetime.now().year}" # noqa: A001
author = "`the Bloom lab <https://research.fhcrc.org/bloom/en.html>`_"
author = "`the Bloom lab <https://jbloomlab.org/>`_"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -192,7 +192,7 @@
master_doc,
"polyclonal.tex",
"polyclonal Documentation",
"`the Bloom lab <https://research.fhcrc.org/bloom/en.html>`_",
"`the Bloom lab <https://jbloomlab.org>`_",
"manual",
),
]
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

``polyclonal`` is a Python package for modeling mutational escape from polyclonal antibodies using deep mutational scanning data.

It is written by `the Bloom lab <https://research.fhcrc.org/bloom/en.html>`_.
It is written by `the Bloom lab <https://jbloomlab.org>`_.

See `Yu et al (2022) <https://doi.org/10.1093/ve/veac110>`_ for an explanation of the approach implemented in ``polyclonal``.

Expand Down
13 changes: 6 additions & 7 deletions polyclonal/polyclonal.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ class Polyclonal:

>>> model_data.mutations
('M1C', 'G2A', 'A4K', 'A4L')
>>> dict(sorted(model_data.mutations_times_seen.items()))
>>> {key: int(val) for (key, val) in sorted(model_data.mutations_times_seen.items())}
{'A4K': 4, 'A4L': 3, 'G2A': 6, 'M1C': 6}

The activities are evenly spaced from 1 to 0, while the mutation escapes
Expand Down Expand Up @@ -1652,8 +1652,7 @@ def _scaled_pseudo_huber(delta, r, calc_grad=False):
... lambda r: Polyclonal._scaled_pseudo_huber(2, r, False)[0],
... lambda r: Polyclonal._scaled_pseudo_huber(2, r, True)[1],
... [2])
>>> err < 1e-7
True
>>> assert err < 1e-7

"""
if delta <= 0:
Expand All @@ -1672,7 +1671,7 @@ def _loss_dloss(self, params, delta):
)
assert pred_pvs.shape == self._pvs.shape
assert dpred_pvs_dparams.shape == (len(params), len(self._pvs))
assert type(dpred_pvs_dparams) == scipy.sparse.csr_matrix
assert type(dpred_pvs_dparams) is scipy.sparse.csr_matrix
residuals = pred_pvs - self._pvs
loss, dloss_dr = self._scaled_pseudo_huber(delta, residuals, True)
assert loss.shape == dloss_dr.shape == self._pvs.shape
Expand All @@ -1684,7 +1683,7 @@ def _loss_dloss(self, params, delta):
dloss_dr = dloss_dr * self._weights
dloss_dparams = dpred_pvs_dparams.dot(dloss_dr)
assert dloss_dparams.shape == params.shape
assert type(dloss_dparams) == numpy.ndarray
assert type(dloss_dparams) is numpy.ndarray
return (loss, dloss_dparams)

def _reg_escape(self, params, weight, delta):
Expand Down Expand Up @@ -3104,7 +3103,7 @@ def _compute_pv(self, params, bmap, cs, calc_grad=False):
dpvc_dbetaparams = dpevc_dbeta.reshape(
bmap.binarylength * len(self.epitopes), n_vc
)
assert type(dpvc_dbetaparams) == scipy.sparse.coo_matrix
assert type(dpvc_dbetaparams) is scipy.sparse.coo_matrix
# combine to make dpvc_dparams, noting activities before betas
# in params
dpvc_dparams = scipy.sparse.vstack(
Expand All @@ -3115,7 +3114,7 @@ def _compute_pv(self, params, bmap, cs, calc_grad=False):
dpvc_dbetaparams.tocsr(),
]
)
assert type(dpvc_dparams) == scipy.sparse.csr_matrix
assert type(dpvc_dparams) is scipy.sparse.csr_matrix
assert dpvc_dparams.shape == (len(params), n_vc)
return p_vc, dpvc_dparams

Expand Down
5 changes: 3 additions & 2 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
select = [
lint.select = [
"E", # pycodestyle
"F", # pyflakes
"UP", # pyupgrade
"D", # pydocstyle
]
line-length = 89
extend-exclude = [
"tests",
"build",
"dist",
"docs/_build",
Expand All @@ -14,7 +15,7 @@ extend-exclude = [
"optimization_benchmarks",
".*",
]
ignore = [
lint.ignore = [
"D203",
"D205",
"D212",
Expand Down