From 44b7cfb3dbe0b0be1446b6497ccc7707a5839787 Mon Sep 17 00:00:00 2001 From: Kai Zhang Date: Sun, 8 Oct 2023 14:00:46 +0800 Subject: [PATCH] update dependency --- ChangeLog.md | 6 +++--- docs/tutorials/integration.ipynb | 4 ++-- docs/tutorials/pbmc.ipynb | 4 ++-- snapatac2-python/setup.py | 4 ++-- snapatac2-python/snapatac2/tools/_call_peaks.py | 8 ++++++++ snapatac2-python/snapatac2/tools/_smooth.py | 6 +++--- snapatac2-python/src/call_peaks.rs | 2 +- 7 files changed, 21 insertions(+), 13 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 3fe2ad16b..d3a51521d 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -3,9 +3,9 @@ v2.5.0dev ## Breaking changes: -- Fragments are now stored in `.obms['fragment_single']` or `.obsm['fragment_paired']`. - The h5ad files generated prior to this version are no longer compatible. - We provide a script `scripts/XXX.py` to convert the old h5ad files to the new format. +- Fragments are now stored in `.obms['fragment_single']` or `.obsm['fragment_paired']`, + depending on whether the data is single-end or paired-end. + As a result, the h5ad files generated prior to this version are no longer compatible. - `tl.call_peaks` has been renamed to `tl.macs3`, and the underlying algorithm has been significantly improved, see #142. - `pp.import_data` now doesn't compute the TSS enrichment scores. Use `metrics.tsse` diff --git a/docs/tutorials/integration.ipynb b/docs/tutorials/integration.ipynb index a0f5fef12..d2cc30d0a 100644 --- a/docs/tutorials/integration.ipynb +++ b/docs/tutorials/integration.ipynb @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7b78b1bccf50a0fab7ed75b28b14b8b2bb90b5af9f9290b74f2463ff1ff06903 -size 312660 +oid sha256:8e3ddd3b0ab937f8f01182228c74221588ca62e97333c883173f6334775ce32e +size 354519 diff --git a/docs/tutorials/pbmc.ipynb b/docs/tutorials/pbmc.ipynb index e86ddeba3..09b110d4c 100644 --- a/docs/tutorials/pbmc.ipynb +++ b/docs/tutorials/pbmc.ipynb @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0cd5d67a3e0c266c60f1297ec06c428dd326eec57415672e6b4a9a5e652e606a -size 4419345 +oid sha256:db84e3fd44f45535ab365a7a79769d67a44b79c02a7c7f72ed8f7c12279cf0f9 +size 4305218 diff --git a/snapatac2-python/setup.py b/snapatac2-python/setup.py index 915dd8f1c..b7fb1235d 100644 --- a/snapatac2-python/setup.py +++ b/snapatac2-python/setup.py @@ -34,7 +34,7 @@ zip_safe=False, python_requires=">=3.7", install_requires=[ - "anndata>=0.8.0", + "anndata>=0.8.0, <0.10.0", "kaleido", "multiprocess", "MACS3==3.0.0b3", @@ -42,7 +42,7 @@ "numpy>=1.16.0", "pandas>=1.0", "plotly>=5.6.0", - "polars>=0.14.0, <=0.18.0", + "polars>=0.18.15, <0.20.0", "pooch>=1.6.0", "igraph>=0.10.0", "pynndescent", diff --git a/snapatac2-python/snapatac2/tools/_call_peaks.py b/snapatac2-python/snapatac2/tools/_call_peaks.py index 02c5fbe3c..46f46598a 100644 --- a/snapatac2-python/snapatac2/tools/_call_peaks.py +++ b/snapatac2-python/snapatac2/tools/_call_peaks.py @@ -81,6 +81,10 @@ def macs3( dict[str, 'polars.DataFrame'] | None If `inplace=True` it stores the result in `adata.uns[`key_added`]`. Otherwise, it returns the result as dataframes. + + See Also + -------- + merge_peaks """ from MACS3.Signal.PeakDetect import PeakDetect from math import log @@ -186,6 +190,10 @@ def merge_peaks( ------- 'polars.DataFrame' A dataframe with merged peaks. + + See Also + -------- + macs3 """ chrom_sizes = chrom_sizes.chrom_sizes if isinstance(chrom_sizes, Genome) else chrom_sizes return _snapatac2.py_merge_peaks(peaks, chrom_sizes, half_width) \ No newline at end of file diff --git a/snapatac2-python/snapatac2/tools/_smooth.py b/snapatac2-python/snapatac2/tools/_smooth.py index fd654d2cf..a86f4d8cc 100644 --- a/snapatac2-python/snapatac2/tools/_smooth.py +++ b/snapatac2-python/snapatac2/tools/_smooth.py @@ -3,10 +3,10 @@ import numpy as np import scipy.sparse as ss -from snapatac2._snapatac2 import AnnData, AnnDataSet +import snapatac2._snapatac2 as internal def smooth( - adata: Union[AnnData, AnnDataSet, ss.spmatrix], + adata: Union[internal.AnnData, internal.AnnDataSet, ss.spmatrix], distances: Optional[Union[str, ss.spmatrix]] = None, inplace: bool = True, ) -> Optional[np.ndarray]: @@ -30,7 +30,7 @@ def smooth( if distances is None: distances = "distances" if isinstance(str, distances): distances = adata.obsp[distances] - data = adata.X[:] if isinstance(AnnData, adata) or isinstance(AnnDataSet, adata) else adata + data = adata.X[:] if isinstance(internal.AnnData, adata) or isinstance(internal.AnnDataSet, adata) else adata data = data * make_diffuse_operator(distances) if inplace: adata.X = data diff --git a/snapatac2-python/src/call_peaks.rs b/snapatac2-python/src/call_peaks.rs index 46ec2d324..1d261d3cb 100644 --- a/snapatac2-python/src/call_peaks.rs +++ b/snapatac2-python/src/call_peaks.rs @@ -129,7 +129,7 @@ fn dataframe_to_narrow_peaks(df: &DataFrame) -> Result> { let starts = df.column("start").unwrap().u64()?; let ends = df.column("end").unwrap().u64()?; let names = df.column("name").unwrap().utf8()?; - let scores = df.column("score").unwrap().i32()?; + let scores = df.column("score").unwrap().u16()?; let strands = df.column("strand").unwrap().utf8()?; let signal_values = df.column("signal_value").unwrap().f64()?; let p_values = df.column("p_value").unwrap().f64()?;