Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizhang committed Sep 11, 2023
1 parent e9ac8ad commit 766c570
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 7 deletions.
30 changes: 27 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- name: Install dependency
run: |
sudo apt-get install -y pandoc
sudo apt-get install -y pandoc jq
sudo pip install --upgrade pip
pip install --user sphinx==6.2.* pydata-sphinx-theme==0.13.* pandoc nbsphinx \
Pygments==2.14.0 sphinx-autodoc-typehints myst-parser \
Expand Down Expand Up @@ -66,12 +66,36 @@ jobs:
clean: true
target-folder: /version/dev/

- name: Deploy (version)
- name: Deploy (version) 🚀
uses: JamesIves/github-pages-deploy-action@v4
if: ${{ env.DEPLOY_VERSION == 'true' }}
with:
single-commit: true
branch: gh-pages
folder: _build/html
clean: true
target-folder: /version/${{ env.VERSION }}/
target-folder: /version/${{ env.VERSION }}/

- name: Fetch JSON and Get Preferred Version
run: |
JSON=$(curl -s "https://raw.githubusercontent.com/kaizhang/SnapATAC2/main/docs/_static/versions.json")
VERSION=$(echo "$JSON" | jq -r '.[] | select(.preferred == true) | .version')
echo "PREFERRED_VERSION=$VERSION" >> $GITHUB_ENV
echo "Preferred version is $VERSION"
- name: Checkout code from gh-pages branch into folder
uses: actions/checkout@v2
with:
ref: 'gh-pages'
path: 'gh-pages-folder'

- name: Deploy (preferred version)
uses: JamesIves/github-pages-deploy-action@v4
with:
single-commit: true
branch: gh-pages
folder: gh-pages-folder/version/${{ env.PREFERRED_VERSION }}
clean: true
clean-exclude: version


2 changes: 2 additions & 0 deletions snapatac2-python/snapatac2/preprocessing/_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ def import_data(
chrom_size = genome.chrom_sizes
if gene_anno is None:
gene_anno = genome.fetch_annotations()
if len(chrom_size) == 0:
raise ValueError("chrom_size cannot be empty")

if whitelist is not None:
if isinstance(whitelist, str) or isinstance(whitelist, Path):
Expand Down
3 changes: 1 addition & 2 deletions snapatac2-python/snapatac2/preprocessing/_knn.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def knn(
adata: AnnData | AnnDataSet | np.ndarray,
n_neighbors: int = 50,
use_dims: int | list[int] | None = None,
use_rep: str | None = None,
use_rep: str = 'X_spectral',
method: Literal['hora', 'pynndescent', 'exact'] = "hora",
n_jobs: int = -1,
inplace: bool = True,
Expand Down Expand Up @@ -51,7 +51,6 @@ def knn(
Otherwise, return a sparse matrix.
"""
if is_anndata(adata):
if use_rep is None: use_rep = "X_spectral"
data = adata.obsm[use_rep]
else:
inplace = False
Expand Down
4 changes: 2 additions & 2 deletions snapatac2-python/snapatac2/tools/_call_peaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def call_peaks(
if isinstance(groupby, str):
groupby = list(adata.obs[groupby])
out_dir = out_dir if out_dir is None else str(out_dir)
res = _snapatac2.call_peaks(adata, groupby, selections, q_value, nolambda,
shift, extsize, blacklist, out_dir)
res = _snapatac2.call_peaks(adata, groupby, q_value, nolambda,
shift, extsize, selections, blacklist, out_dir)
if inplace:
if adata.isbacked:
adata.uns[key_added] = res
Expand Down

0 comments on commit 766c570

Please sign in to comment.