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

Add publication figures #23

Merged
merged 2 commits into from
Jun 9, 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
Binary file added docs/about_sceptr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ And if your computer does have a `CUDA-enabled GPU <https://en.wikipedia.org/wik
sceptr's :ref:`API <api>` exposes three intuitive functions: :py:func:`~sceptr.calc_vector_representations`, :py:func:`~sceptr.calc_cdist_matrix`, and :py:func:`~sceptr.calc_pdist_vector`-- and it's all you need to make full use of the SCEPTR models.
What's even better is that they are fully compliant with `pyrepseq <https://pyrepseq.readthedocs.io>`_'s `tcr_metric <https://pyrepseq.readthedocs.io/en/latest/api.html#pyrepseq.metric.tcr_metric.TcrMetric>`_ API, so sceptr will fit snugly into the rest of your repertoire analysis toolkit.

.. figure:: about_sceptr.png
:width: 700px
:alt: Schematic diagrams showing a visual introduction to the architecture of SCEPTR, as well as how it was trained-- namely, autocontrastive learning and masked-language modelling.

A visual introduction to how SCEPTR works, taken from our SCEPTR preprint.
SCEPTR is a TCR language model (a,b) pre-trained using masked-language modelling and autocontrastive learning (c,d).
(a) The default model uses the ``<cls>`` pooling method, but there is also a variant that is trained to use average-pooling (see :py:func:`sceptr.variant.average_pooling`).
Please see the manuscript for more details.

.. toctree::
:maxdepth: 2
:caption: Contents:
Expand Down
2 changes: 1 addition & 1 deletion src/sceptr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def calc_pdist_vector(instances: DataFrame) -> ndarray:
Returns
-------
ndarray
A 2D numpy ndarray representing a pdist vector of distances between each pair of TCRs in `instances`.
A 1D numpy ndarray representing a pdist vector of distances between each pair of TCRs in `instances`.
The returned array will have shape :math:`(\frac{1}{2}N(N-1),)`, where :math:`N` is the number of TCRs in `instances`.
"""
return get_default_model().calc_pdist_vector(instances)
Expand Down
2 changes: 1 addition & 1 deletion src/sceptr/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def calc_pdist_vector(self, instances: DataFrame) -> ndarray:
Returns
-------
ndarray
A 2D numpy ndarray representing a pdist vector of distances between each pair of TCRs in `instances`.
A 1D numpy ndarray representing a pdist vector of distances between each pair of TCRs in `instances`.
The returned array will have shape :math:`(\frac{1}{2}N(N-1),)`, where :math:`N` is the number of TCRs in `instances`.
"""
representations = self._calc_torch_representations(instances)
Expand Down