Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
taillades committed Dec 15, 2023
1 parent 1b6d763 commit de5cdd7
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 95 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,5 +161,4 @@ test_demulti_scott.py
docker-data/*
update_headers.py
draw/data/
plots/
dreem-log*
44 changes: 3 additions & 41 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,33 +1,14 @@
=========================================================================
Welcome to DREEM's documentation!
Welcome to SEISMOGRAPH's documentation!
=========================================================================

DREEM stands for Detection of RNA folding Ensembles using Expectation-Maximization.
This method was published by the `Rouskin lab <https://www.rouskinlab.com>`_ in `Nature (2020) <https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7310298/>`_.
SEISMOGRAPH is a plotting library for SEISMIC output.

.. include:: overview/main.rst
.. include:: plots/get_started.rst

Table of Contents
=================

.. toctree::
:maxdepth: 3

overview/main.rst


.. toctree::
:caption: DREEM

dreem/installation.rst
dreem/examples.rst
dreem/reference.rst
dreem/IO.rst
dreem/formats/main.rst
dreem/dependencies.rst
dreem/data.rst
dreem/Logs.rst

.. _plots:

.. toctree::
Expand All @@ -38,22 +19,3 @@ Table of Contents
plots/gallery.rst
plots/create_a_plot.rst


.. toctree::
:maxdepth: 3
:caption: Modules

module/align/main.rst
module/vector/main.rst
module/aggregate/main.rst
module/seismograph/main.rst
module/cluster/main.rst
module/demultiplex/main.rst

.. toctree::
:maxdepth: 3
:caption: About

about/dms.rst
about/dreem.rst
about/about.rst
46 changes: 25 additions & 21 deletions docs/source/plots/create_a_plot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ You can write your own plots following these steps.

Use the ``study.get_df()`` method to get a filtered pandas DataFrame.

.. note::

If you don't know how to get a study object, please read the :ref:`plots_get_started` section.

.. code::
data = study.get_df(
Expand All @@ -33,7 +37,7 @@ Take a look at the filtering options in the ``Study.get_df()`` method documentat

.. dropdown:: :fa:`eye,mr-1` **DOCSTRING**: ``Study.get_df()``

.. autofunction:: dreem.draw.study.Study.get_df
.. autofunction:: seismograph.study.Study.get_df

2. Plot your data
******************
Expand Down Expand Up @@ -76,15 +80,15 @@ You'll get the following output:
:file: my_figure.html


3. Add your plot to DREEM
**************************
3. Add your plot to SEISMOGRAPH
*******************************

This project is community-driven. If you want to add your plot to DREEM, please follow these steps and send us `a pull request <https://github.com/rouskinlab/dreem/pulls>`_.
This project is community-driven. If you want to add your plot to SEISMOGRAPH, please follow these steps and send us `a pull request <https://github.com/rouskinlab/seismograph/pulls>`_.

1. Setup your development environment
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1. Fork the DREEM repository on GitHub.
1. Fork the SEISMOGRAPH repository on GitHub.
2. Clone your fork locally.
3. Open your favorite terminal and navigate to the cloned repository.
4. Create a new branch for your plot.
Expand All @@ -95,8 +99,8 @@ This project is community-driven. If you want to add your plot to DREEM, please
pip install -r requirements.txt
6. In your favorite IDE, open:
- ``dreem/dreem/draw/study.py``
- ``dreem/dreem/draw/plotter.py``
- ``seismograph/study.py``
- ``seismograph/plotter.py``
- ``docs/source/plots/gallery_generator.py``
- A Jupyter notebook

Expand All @@ -105,14 +109,14 @@ This project is community-driven. If you want to add your plot to DREEM, please
^^^^^^^^^^^


In this example, we'll add the plot :ref:`mutations_in_barcodes` to DREEM.
In this example, we'll add the plot :ref:`base_coverage` to SEISMOGRAPH.
You need to add your plot to the following files:

In ``dreem/draw/study.py``:
In ``seismograph/study.py``:

.. code::
# In dreem/draw/study.py
# In seismograph/study.py
@save_plot
@doc_inherit(save_plot, style=style_child_takes_over_parent)
@doc_inherit(default_arguments_multi_rows, style=style_child_takes_over_parent)
Expand All @@ -122,11 +126,11 @@ In ``dreem/draw/study.py``:
"""
return self.wrap_to_plotter(plotter.base_coverage, locals(), kwargs)
In ``dreem/draw/plotter.py``:
In ``seismograph/plotter.py``:

.. code::
# In dreem/draw/plotter.py
# In seismograph/plotter.py
def base_coverage(data):
fig = go.Figure()
[...]
Expand All @@ -148,23 +152,23 @@ In ``docs/source/plots/gallery_generator.py``:
3. Add your plot
^^^^^^^^^^^^^^^^^^

1. Add your plot function to ``dreem/draw/plotter.py``.
1. Add your plot function to ``seismograph/plotter.py``.

.. code::
# In dreem/draw/plotter.py
# In seismograph/plotter.py
def my_plot(data):
fig = go.Figure()
[...]
return {'fig': fig, 'data': data}
2. Add your plot to the ``Study`` class in ``dreem/draw/study.py``.
2. Add your plot to the ``Study`` class in ``seismograph/study.py``.
Use the wrapper: it loads the data for you while making sure that the inputs are valid.

.. code::
# In dreem/draw/study.py
# In seismograph/study.py
class Study:
[...]
def my_plot(self, **kwargs):
Expand All @@ -177,7 +181,7 @@ Use the wrapper: it loads the data for you while making sure that the inputs are

.. code::
# In dreem/draw/study.py
# In seismograph/study.py
class Study:
[...]
def my_plot(self, sample, reference, section='full', base_type=['A','C'], **kwargs):
Expand All @@ -199,7 +203,7 @@ When pushing the docs to GitHub Pages, this will add the docstring of the generi

.. code::
# In dreem/draw/study.py
# In seismograph/study.py
class Study:
[...]
# Use this decorator for plots that take one or multiple rows of the DataFrame (use by default).
Expand All @@ -216,7 +220,7 @@ Add also the documentation for these arguments. Keep the decorators in this orde

.. code::
# In dreem/draw/study.py
# In seismograph/study.py
class Study:
[...]
@save_plot
Expand All @@ -230,7 +234,7 @@ Add also the documentation for these arguments. Keep the decorators in this orde
.. code::
# In a Jupyter notebook
from dreem.draw import Study, load_dataset
from seismograph import Study, load_dataset
study = Study()
study.df = load_dataset()
# Plot the first row of the DataFrame
Expand Down Expand Up @@ -270,4 +274,4 @@ Make sure that it looks good!

11. Commit your changes and push them to GitHub. The docs will be automatically updated on GitHub Pages. Make sure that the docstrings are displayed and that the plot looks good.

12. Send us a pull request to the DREEM repository!
12. Send us a pull request to the SEISMOGRAPH repository!
16 changes: 0 additions & 16 deletions docs/source/plots/gallery.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,6 @@ Plot the mutation fraction of multiple mutation profiles.



.. _deltaG_vs_sub_rate:

DeltaG vs sub rate
------------------

Plot the Mutation fraction of each paired-expected base of the ROI for each reference of a sample, w.r.t the deltaG estimation.

.. raw:: html
:file: plots_figs/deltaG_vs_sub_rate.html

.. dropdown:: :fa:`eye,mr-1` **DOCSTRING**: deltaG_vs_sub_rate

.. autofunction:: dreem.seismograph.study.Study.deltaG_vs_sub_rate



.. _experimental_variable_across_samples:

Experimental variable across samples
Expand Down
6 changes: 0 additions & 6 deletions docs/source/plots/gallery_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,6 @@ def generate_html():
to_html = os.path.join(path_figs, 'mutation_fraction_identity.html')
)

study.deltaG_vs_sub_rate(
sample = sample,
section = 'ROI',
base_type = ['A','C'],
to_html = os.path.join(path_figs, 'deltaG_vs_sub_rate.html')
)

study.experimental_variable_across_samples(
experimental_variable = 'temperature_k',
Expand Down
19 changes: 9 additions & 10 deletions docs/source/plots/get_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,8 @@
Get started
=================

Install DREEM (if not already done)
---------------------------------------


.. note::

You don't need any non-pythonic dependency to use DREEM for plotting only. If you want to process your data with DREEM, you will need to install the :ref:`Dependencies`.

Install SEISMOGRAPH
-------------------

Install SEISMOGRAPH with pip. **Use Python >= 3.10**

Expand All @@ -25,7 +19,7 @@ Import your data into a study object

.. code::
from seismograph import study
from seismograph import Study
import json
# Define the list of samples you want to load
Expand All @@ -38,7 +32,7 @@ Import your data into a study object
data.append(json.load(f))
# Create a study object
my_study = study.Study(data)
my_study = Study(data)
# Print the list of available samples
print(my_study.get_samples())
Expand All @@ -56,6 +50,11 @@ Make a plot
cluster = 'pop_avg'
)
.. raw:: html
:file: plots_figs/mutation_fraction.html


.. note::

We regularly update the list of available plots. Make sure that you have the last version of DREEM.

0 comments on commit de5cdd7

Please sign in to comment.