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

Update docs, add checks for formatting/docs building, and refactor modisco and utils modules #34

Merged
merged 40 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
bdf9d9f
rm old introduction notebook
LukasMahieu Oct 2, 2024
1788df6
updated introduction notebook
LukasMahieu Oct 2, 2024
45a3b8c
remove old docs
LukasMahieu Oct 2, 2024
3f2161b
rename prediction_bar
LukasMahieu Oct 2, 2024
c98f3d7
formatting
LukasMahieu Oct 2, 2024
c5f14c3
reformat
LukasMahieu Oct 2, 2024
c80f030
reformat
LukasMahieu Oct 4, 2024
d6500ae
docs building and ruff formatting check actions
LukasMahieu Oct 4, 2024
4f15fa8
reformat
LukasMahieu Oct 4, 2024
0c674ef
ruff dependency
LukasMahieu Oct 4, 2024
32991fa
ruff formatting
LukasMahieu Oct 4, 2024
bac1af6
fix import
LukasMahieu Oct 4, 2024
11bd71c
manual docs build action check
LukasMahieu Oct 4, 2024
c57c69d
anndata ref
LukasMahieu Oct 4, 2024
d824c8f
docs formatting
LukasMahieu Oct 4, 2024
ef0518f
rm comment
LukasMahieu Oct 4, 2024
3fc1b7b
fix docs action
LukasMahieu Oct 4, 2024
b2f8c1c
fix docs action
LukasMahieu Oct 4, 2024
d640385
fix docs action
LukasMahieu Oct 4, 2024
b0a1421
update python version
LukasMahieu Oct 4, 2024
573508f
fail on warning
LukasMahieu Oct 4, 2024
82d2d77
fail on warning
LukasMahieu Oct 4, 2024
b9812a0
fail on warning
LukasMahieu Oct 4, 2024
fbffd08
change import enhanceroptimizer
LukasMahieu Oct 4, 2024
cf82cdf
new main module 'utils'
LukasMahieu Oct 7, 2024
4c503fa
move logging to utils
LukasMahieu Oct 7, 2024
d306c09
function moved to utils
LukasMahieu Oct 7, 2024
0fd99f9
move modisco funcs into own module
LukasMahieu Oct 7, 2024
0b248fb
rename id_ to pattern_id for docs
LukasMahieu Oct 8, 2024
b07abe6
modisco to separate module under tools
LukasMahieu Oct 8, 2024
61bc3b9
fix some type hints & checks
LukasMahieu Oct 8, 2024
25ef544
update old function name
LukasMahieu Oct 8, 2024
cd0328d
small docfixes
LukasMahieu Oct 8, 2024
dd2a5fe
update locus scoring docs & remove unused parameter 'coordinates'
LukasMahieu Oct 8, 2024
36b3974
remove plot_ from function names (redundant) and rename plot_patterns…
LukasMahieu Oct 8, 2024
3ab9031
fix seaborn return type
LukasMahieu Oct 8, 2024
858ae02
add example plot images to api docs
LukasMahieu Oct 9, 2024
a8cfbb1
update function names and docstrings in ehnacer code analysis
LukasMahieu Oct 9, 2024
b01f757
Notebook check with new update
nkempynck Oct 9, 2024
ec31d34
Notebook check part 2
nkempynck Oct 9, 2024
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
51 changes: 51 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Check Sphinx Docs

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
docs:
name: Build Sphinx Documentation
runs-on: ubuntu-latest
defaults:
run:
shell: bash -eo pipefail {0} # Fail on error and enable pipefail

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: "pip"
cache-dependency-path: "**/pyproject.toml"

- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install ".[doc]"

- name: Build Documentation and Check for Issues
working-directory: docs
run: |
make clean
# Build the docs and capture output, treat warnings as errors (-W)
sphinx-build -b html -W . _build/html 2>&1 | tee sphinx-output.log

- name: Upload Documentation Artifacts (HTML Pages)
if: always()
uses: actions/upload-artifact@v3
with:
name: sphinx-docs
path: docs/_build/html

- name: Upload Log if Build Failed
if: failure()
uses: actions/upload-artifact@v3
with:
name: sphinx-output-log
path: docs/sphinx-output.log
16 changes: 16 additions & 0 deletions .github/workflows/ruff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Ruff

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "0 5 1,15 * *"

jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pip install torch
pip install crested
```

3. If you plan on doing motif analysis using the tf-modisco (lite) and tangermeme functionality inside CREsted, you will need to run the following additional install:
3. If you plan on doing motif analysis using the tf-modisco (lite) and tangermeme's tomtom functionality inside CREsted, you will need to run the following additional install:

```bash
pip install crested[tfmodisco]
Expand Down
Binary file added docs/_static/img/examples/hist_locus_scoring.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/img/examples/pattern_clustermap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ io
preprocessing
tools/index.md
plotting/index.md
logging
utils
```
14 changes: 0 additions & 14 deletions docs/api/logging.md

This file was deleted.

1 change: 1 addition & 0 deletions docs/api/plotting/hist.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ Plots for inspecting distributions of ground truth and predictions?
:toctree: _autosummary

distribution
locus_scoring
```
6 changes: 6 additions & 0 deletions docs/api/plotting/patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@ Plot contribution scores and analyze them using tfmodisco.

contribution_scores
modisco_results
selected_instances
class_instances
clustermap
clustermap_tf_motif
tf_expression_per_cell_type
similarity_heatmap
```
25 changes: 22 additions & 3 deletions docs/api/tools/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@

Crested
TaskConfig
tfmodisco
default_configs
```


```{toctree}
:maxdepth: 2
:hidden:
Expand All @@ -23,6 +21,7 @@ data
zoo
losses
metrics
modisco
```

## Data
Expand Down Expand Up @@ -59,4 +58,24 @@ metrics
metrics.PearsonCorrelation
metrics.PearsonCorrelationLog
metrics.ZeroPenaltyMetric
```
```

## Modisco

```{eval-rst}
.. autosummary::
modisco.tfmodisco
modisco.match_h5_files_to_classes
modisco.process_patterns
modisco.create_pattern_matrix
modisco.generate_nucleotide_sequences
modisco.pattern_similarity
modisco.find_pattern
modisco.find_pattern_matches
modisco.calculate_similarity_matrix
modisco.calculate_mean_expression_per_cell_type
modisco.generate_html_paths
modisco.read_motif_to_tf_file
modisco.create_pattern_tf_dict
modisco.create_tf_ct_matrix
```
27 changes: 27 additions & 0 deletions docs/api/tools/modisco.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Modisco `tl.modisco`

Tfmodisco (utility) functions. Requires the `modisco-lite` package to be installed.

```{eval-rst}
.. currentmodule:: crested.tl.modisco
```

```{eval-rst}
.. autosummary::
:toctree: _autosummary

tfmodisco
match_h5_files_to_classes
process_patterns
create_pattern_matrix
generate_nucleotide_sequences
pattern_similarity
find_pattern
find_pattern_matches
calculate_similarity_matrix
calculate_mean_expression_per_cell_type
generate_html_paths
read_motif_to_tf_file
create_pattern_tf_dict
create_tf_ct_matrix
```
18 changes: 18 additions & 0 deletions docs/api/utils.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Utils

CREsted provides a few utility function to help with sequence encoding, function optimization, ...

```{eval-rst}
.. currentmodule:: crested.utils
```

```{eval-rst}
.. autosummary::
:toctree: _autosummary

EnhancerOptimizer
extract_bigwig_values_per_bp
hot_encoding_to_sequence
one_hot_encode_sequence
setup_logging
```
4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
"anndata": ("https://anndata.readthedocs.io/en/stable/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"matplotlib": ("https://matplotlib.org/stable/", None),
"pandas": ("http://pandas.pydata.org/pandas-docs/stable/", None),
"seaborn": ("https://seaborn.pydata.org/", None),
}

# List of patterns, relative to source directory, that match files and
Expand Down Expand Up @@ -137,7 +139,9 @@
("py:class", "keras.metrics.Metric"),
("py:class", "keras.src.losses.loss.Loss"),
("py:class", "keras.src.metrics.metric.Metric"),
("py:class", "seaborn.matrix.ClusterGrid"),
]

suppress_warnings = [
"autosummary.import_cycle",
]
Loading
Loading