Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
zouter committed Oct 24, 2024
2 parents 8af342e + 248d79f commit 5ce88dd
Show file tree
Hide file tree
Showing 279 changed files with 36,621 additions and 11,651 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.9
cache: 'pip'
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- run: pip install torch # because torch_scatter contains import torch in the setup.py, we have to install torch first
- run: pip install torch==2.3.0 # because torch_scatter contains import torch in the setup.py, we have to install torch first
- run: pip install torch-scatter -f https://data.pyg.org/whl/torch-2.3.0+cpu.html # it seems a wheel is necessary to install torch-scatter
- name: regular install
run: pip install .
run: pip install .[full]
- name: attempt import
run: python -c "import chromatinhd"
- name: test install
run: pip install -e .[test]
- name: ruff
run: ruff check --format=github .
# - uses: jpetrucciani/ruff-check@main
- name: test
run: pytest
# - run: mkdocs gh-deploy --force
16 changes: 16 additions & 0 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,19 @@ software/
docs/source/quickstart/example/*
docs/source/quickstart/restats
*.code-workspace


*.zarr
*.zarr/*
*.hdf5
restats
docs/tex/overview.aux
docs/tex/overview.fdb_latexmk
docs/tex/overview.fls
docs/tex/overview.pdf
docs/tex/overview.synctex.gz

output/*


src/*.c
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.0.282
hooks:
- id: ruff
args: [., --fix, --exit-non-zero-on-fix ]
exclude: '(^scripts|^docs)/.*'
# - repo: https://github.com/astral-sh/ruff-pre-commit
# # Ruff version.
# rev: v0.0.282
# hooks:
# - id: ruff
# args: [., --fix, --exit-non-zero-on-fix ]
# exclude: '(^scripts|^docs)/.*'
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
Expand Down
Empty file modified LICENSE.md
100644 → 100755
Empty file.
3 changes: 3 additions & 0 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<a href="https://chromatinhd.eu">
<img src="https://raw.githubusercontent.com/DeplanckeLab/ChromatinHD/main/docs/source/static/logo.png" width="300" />
</a>
<a href="https://chromatinhd.eu">
<img src="https://raw.githubusercontent.com/DeplanckeLab/ChromatinHD/main/docs/source/static/comparison.gif" />
</a>
</p>

ChromatinHD analyzes single-cell ATAC+RNA data using the raw fragments as input,
Expand Down
10 changes: 10 additions & 0 deletions docs/override/main.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@
{% endif %}
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-copyright">
<div class="md-copyright__highlight">
<div class="container" style="display: flex;align-items: center;">
<img src="{{ base_url }}/static/eu.png" alt="European Flag" style="max-width: 100%;height: auto;margin-right: 20px;" width="100" height="70">
<div style="flex: 0 0 400px;">
This work was supported by the European Union's Horizon 2020 research and innovation program (Grant agreement 101028476).
</div>
</div>
</div>
</div>
{% include "partials/copyright.html" %}
{% if config.extra.social %}
{% include "partials/social.html" %}
Expand Down
Empty file modified docs/source/.pages
100644 → 100755
Empty file.
Empty file modified docs/source/CNAME
100644 → 100755
Empty file.
23 changes: 16 additions & 7 deletions docs/source/benchmark/diff/models.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@

# %%
genes_oi = transcriptome_original.var.sort_values("dispersions_norm", ascending=False).head(50).index
regions = fragments_original.regions.filter_genes(genes_oi)
fragments = fragments_original.filter_genes(regions)
regions = fragments_original.regions.filter(genes_oi)
fragments = fragments_original.filter_regions(regions)
fragments.create_cellxgene_indptr()
transcriptome = transcriptome_original.filter_genes(regions.coordinates.index)

Expand Down Expand Up @@ -80,6 +80,15 @@
model.train_model(fragments, clustering, fold, n_epochs=30)
models["original"] = model

# %%
model = chd.models.diff.model.cutnf.Model(
fragments,
clustering,
nbins = (32, 64, 128)
)
model.train_model(fragments, clustering, fold, n_epochs=30)
models["original_rev"] = model

# %%
model = chd.models.diff.model.cutnf.Model(
fragments,
Expand Down Expand Up @@ -242,24 +251,24 @@
model_info["ix"] = np.arange(model_info.shape[0])

# %%
fig = chd.grid.Figure(chd.grid.Wrap(padding_width=0.1))
fig = polyptich.grid.Figure(polyptich.grid.Wrap(padding_width=0.1))
height = len(scores) * 0.2

plotdata = scores.copy().loc[model_info.index]

panel, ax = fig.main.add(chd.grid.Ax((1, height)))
panel, ax = fig.main.add(polyptich.grid.Panel((1, height)))
ax.barh(plotdata.index, plotdata["lr_test"])
ax.axvline(0, color="black", linestyle="--", lw=1)
ax.set_title("Test")
ax.set_xlabel("Log-likehood ratio")

panel, ax = fig.main.add(chd.grid.Ax((1, height)))
panel, ax = fig.main.add(polyptich.grid.Panel((1, height)))
ax.set_yticks([])
ax.barh(plotdata.index, plotdata["lr_validation"])
ax.axvline(0, color="black", linestyle="--", lw=1)
ax.set_title("Validation")

panel, ax = fig.main.add(chd.grid.Ax((1, height)))
panel, ax = fig.main.add(polyptich.grid.Panel((1, height)))
ax.set_yticks([])
ax.barh(plotdata.index, plotdata["lr_train"])
ax.axvline(0, color="black", linestyle="--", lw=1)
Expand Down Expand Up @@ -295,7 +304,7 @@
genepositional.score(fragments, clustering, [models[model_id]], force=True, genes=transcriptome.gene_id([symbol]))

# %%
fig = chd.grid.Figure(chd.grid.Grid(padding_height=0.05, padding_width=0.05))
fig = polyptich.grid.Figure(polyptich.grid.Grid(padding_height=0.05, padding_width=0.05))
width = 10

region = fragments.regions.coordinates.loc[transcriptome.gene_id(symbol)]
Expand Down
Loading

0 comments on commit 5ce88dd

Please sign in to comment.