Skip to content

Commit

Permalink
Merge pull request #23 from yutanagano/add_publication_figures
Browse files Browse the repository at this point in the history
Add publication figures
  • Loading branch information
yutanagano authored Jun 9, 2024
2 parents a644959 + d6d3455 commit 49a4f7a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
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

0 comments on commit 49a4f7a

Please sign in to comment.