Skip to content

Commit

Permalink
Restructure example gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
padix-key committed Apr 19, 2024
1 parent e92aedb commit 315b10d
Show file tree
Hide file tree
Showing 99 changed files with 80 additions and 38 deletions.
17 changes: 14 additions & 3 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@
version = biotite.__version__
release = biotite.__version__

exclude_patterns = ["build"]
exclude_patterns = [
# These are automatically incorporated by sphinx_gallery
"examples/scripts/**/README.rst",
# Execution times are not reported to the user
"sg_execution_times.rst",
]

pygments_style = "sphinx"

Expand Down Expand Up @@ -156,8 +161,14 @@
}

sphinx_gallery_conf = {
"examples_dirs" : "examples/scripts",
"gallery_dirs" : "examples/gallery",
"examples_dirs" : [
"examples/scripts/sequence",
"examples/scripts/structure"
],
"gallery_dirs" : [
"examples/gallery/sequence",
"examples/gallery/structure"
],
"within_subsection_order" : FileNameSortKey,
# Do not run example scripts with a trailing '_noexec'
"filename_pattern" : "^((?!_noexec).)*$",
Expand Down
13 changes: 13 additions & 0 deletions doc/examples/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
########
Examples
########

This gallery shows how to perform different kind of analyses on real data using
*Biotite*.
Some of them are real world examples, others are fictional applications.

.. toctree::
:maxdepth: 1

gallery/sequence/index
gallery/structure/index
4 changes: 0 additions & 4 deletions doc/examples/scripts/README.txt

This file was deleted.

2 changes: 2 additions & 0 deletions doc/examples/scripts/sequence/1_homology/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Homology and alignment
----------------------
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import biotite.sequence.io.fasta as fasta

# Path to the data files
array_seq_path = "../../download/Array_Seq.txt"
array_seq_path = "../../../download/Array_Seq.txt"

fasta_file = fasta.FastaFile.read(array_seq_path)

Expand Down Expand Up @@ -99,8 +99,8 @@ def read_scan(filename, pep_len=20, score_res=20):
return df

# Load epitope scan data
fcr3_file_path = "../../download/FCR3_10ug.csv"
nf54_file_path = "../../download/NF54_10ug.csv"
fcr3_file_path = "../../../download/FCR3_10ug.csv"
nf54_file_path = "../../../download/NF54_10ug.csv"

# Define the score residues on the arrays
files = [fcr3_file_path, nf54_file_path]
Expand Down
2 changes: 2 additions & 0 deletions doc/examples/scripts/sequence/2_sequencing/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Sequence read quality control and mapping
-----------------------------------------
2 changes: 2 additions & 0 deletions doc/examples/scripts/sequence/3_profile/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Sequence profiles
-----------------
2 changes: 2 additions & 0 deletions doc/examples/scripts/sequence/4_annotation/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Features and annotations
------------------------
File renamed without changes.
2 changes: 2 additions & 0 deletions doc/examples/scripts/sequence/5_misc/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Miscellaneous
-------------
2 changes: 2 additions & 0 deletions doc/examples/scripts/sequence/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Sequence examples
=================
2 changes: 0 additions & 2 deletions doc/examples/scripts/sequence/README.txt

This file was deleted.

2 changes: 2 additions & 0 deletions doc/examples/scripts/structure/1_protein/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Protein backbone and secondary structure
----------------------------------------
2 changes: 2 additions & 0 deletions doc/examples/scripts/structure/2_nucleotide/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Nucleic acid base pairs and secondary structure
-----------------------------------------------
2 changes: 2 additions & 0 deletions doc/examples/scripts/structure/3_molecule/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Small molecules
---------------
2 changes: 2 additions & 0 deletions doc/examples/scripts/structure/4_contacts/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Proximity and contacts
----------------------
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

# The bilayer structure file can be downloaded from
# http://www.charmm-gui.org/archive/pure_bilayer/dppc.tar.gz
PDB_FILE_PATH = "../../download/dppc_n128.pdb"
PDB_FILE_PATH = "../../../download/dppc_n128.pdb"


def find_leaflets(structure, head_atom_mask,
Expand Down
2 changes: 2 additions & 0 deletions doc/examples/scripts/structure/6_modeling/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Molecular dynamics and docking
------------------------------
File renamed without changes
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
import matplotlib.pyplot as plt

# Put here the path of the downloaded files
templ_file_path = "../../download/lysozyme_md.pdb"
traj_file_path = "../../download/lysozyme_md.xtc"
templ_file_path = "../../../download/lysozyme_md.pdb"
traj_file_path = "../../../download/lysozyme_md.xtc"

# Gromacs does not set the element symbol in its PDB files,
# but Biotite guesses the element names from the atom names,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import os.path

# Put here the path of the downloaded trajectory file
xtc_file_path = "../../download/lysozyme_md.xtc"
xtc_file_path = "../../../download/lysozyme_md.xtc"

xtc_file = xtc.XTCFile.read(xtc_file_path)
coord = xtc_file.get_coord()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@


# A CSV file containing the eigenvectors for the CA atoms
VECTOR_FILE = "../../download/glycosylase_anm_vectors.csv"
VECTOR_FILE = "../../../download/glycosylase_anm_vectors.csv"
# The corresponding structure
PDB_ID = "1MUG"
# The normal mode to be visualized
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
import biotite.structure.io as strucio

# Put here the path of the downloaded files
templ_file_path = "../../download/waterbox_md.pdb"
traj_file_path = "../../download/waterbox_md.xtc"
templ_file_path = "../../../download/waterbox_md.pdb"
traj_file_path = "../../../download/waterbox_md.xtc"

# Load the trajectory
traj = strucio.load_structure(traj_file_path, template=templ_file_path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@


# Put here the path of the downloaded files
templ_file_path = "../../download/lysozyme_md.pdb"
traj_file_path = "../../download/lysozyme_md.xtc"
templ_file_path = "../../../download/lysozyme_md.pdb"
traj_file_path = "../../../download/lysozyme_md.xtc"


xtc_file = xtc.XTCFile.read(traj_file_path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
However, the trajectories are based of publicly accessible structures
of the open (PDB: 7NP3) and closed (PDB: 7NP4) state.
.. image:: ../../scripts/structure/water_exchange.png
.. image:: ../../../scripts/structure/6_modeling/water_exchange.png
"""

# Code source: Daniel Bauer, Patrick Kunzmann
Expand Down
2 changes: 2 additions & 0 deletions doc/examples/scripts/structure/7_misc/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Miscellaneous
-------------
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions doc/examples/scripts/structure/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Structure examples
==================
2 changes: 0 additions & 2 deletions doc/examples/scripts/structure/README.txt

This file was deleted.

28 changes: 14 additions & 14 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Biotite documentation

.. grid-item::

.. button-ref:: examples/gallery/index
.. button-ref:: examples/index
:color: primary
:outline:
:expand:
Expand All @@ -83,12 +83,12 @@ Biotite documentation
:gutter: 2

.. grid-item-card::
:link: examples/gallery/sequence/lexa_conservation.html
:img-background: /examples/gallery/sequence/images/sphx_glr_lexa_conservation_002.png
:link: examples/gallery/sequence/1_homology/lexa_conservation.html
:img-background: /examples/gallery/sequence/1_homology/images/sphx_glr_lexa_conservation_002.png

.. grid-item-card::
:link: examples/gallery/structure/transketolase_sse.html
:img-background: /examples/gallery/structure/images/sphx_glr_transketolase_sse_004.png
:link: examples/gallery/structure/1_protein/transketolase_sse.html
:img-background: /examples/gallery/structure/1_protein/images/sphx_glr_transketolase_sse_004.png


.. raw:: html
Expand All @@ -112,8 +112,8 @@ Biotite documentation
representations, ranging from sequence alignments to feature maps.

.. card::
:img-background: /examples/gallery/sequence/images/sphx_glr_avidin_alignment_001.png
:link: examples/gallery/sequence/avidin_alignment.html
:img-background: /examples/gallery/sequence/1_homology/images/sphx_glr_avidin_alignment_001.png
:link: examples/gallery/sequence/1_homology/avidin_alignment.html

.. grid-item::

Expand All @@ -131,8 +131,8 @@ Biotite documentation


.. card::
:img-background: /examples/gallery/structure/images/sphx_glr_contact_sites_001.png
:link: examples/gallery/structure/contact_sites.html
:img-background: /examples/gallery/structure/4_contacts/images/sphx_glr_contact_sites_001.png
:link: examples/gallery/structure/4_contacts/contact_sites.html

.. grid-item::

Expand All @@ -146,8 +146,8 @@ Biotite documentation
instead of learning the respective REST API.

.. card::
:img-background: /examples/gallery/structure/images/sphx_glr_pdb_statistics_001.png
:link: examples/gallery/structure/pdb_statistics.html
:img-background: /examples/gallery/structure/7_misc/images/sphx_glr_pdb_statistics_001.png
:link: examples/gallery/structure/7_misc/pdb_statistics.html

.. grid-item::

Expand All @@ -164,8 +164,8 @@ Biotite documentation
File creation and command line execution are handled under the hood.

.. card::
:img-background: /examples/gallery/structure/images/sphx_glr_docking_002.png
:link: examples/gallery/structure/docking.html
:img-background: /examples/gallery/structure/6_modeling/images/sphx_glr_docking_002.png
:link: examples/gallery/structure/6_modeling/docking.html


.. raw:: html
Expand Down Expand Up @@ -218,7 +218,7 @@ Biotite documentation
tutorial/index
install
apidoc/index
examples/gallery/index
examples/index
extensions
contribute
logo

0 comments on commit 315b10d

Please sign in to comment.