diff --git a/.gitignore b/.gitignore index f55fd239..b4eff8db 100644 --- a/.gitignore +++ b/.gitignore @@ -161,5 +161,4 @@ test_demulti_scott.py docker-data/* update_headers.py draw/data/ -plots/ dreem-log* \ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst index 04cfc821..ff8d12f9 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -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 `_ in `Nature (2020) `_. +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:: @@ -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 diff --git a/docs/source/plots/create_a_plot.rst b/docs/source/plots/create_a_plot.rst index 11e4f56a..f9177e37 100644 --- a/docs/source/plots/create_a_plot.rst +++ b/docs/source/plots/create_a_plot.rst @@ -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( @@ -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 ****************** @@ -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 `_. +This project is community-driven. If you want to add your plot to SEISMOGRAPH, please follow these steps and send us `a pull request `_. 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. @@ -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 @@ -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) @@ -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() [...] @@ -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): @@ -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): @@ -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). @@ -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 @@ -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 @@ -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! diff --git a/docs/source/plots/gallery.rst b/docs/source/plots/gallery.rst index 65e5135e..63bc4cb2 100644 --- a/docs/source/plots/gallery.rst +++ b/docs/source/plots/gallery.rst @@ -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 diff --git a/docs/source/plots/gallery_generator.py b/docs/source/plots/gallery_generator.py index 2bca4d22..fb09756c 100644 --- a/docs/source/plots/gallery_generator.py +++ b/docs/source/plots/gallery_generator.py @@ -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', diff --git a/docs/source/plots/get_started.rst b/docs/source/plots/get_started.rst index d539a8c7..390f23cb 100644 --- a/docs/source/plots/get_started.rst +++ b/docs/source/plots/get_started.rst @@ -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** @@ -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 @@ -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()) @@ -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.