Skip to content

Commit

Permalink
update dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizhang committed Oct 8, 2023
1 parent 8accb32 commit 44b7cfb
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 13 deletions.
6 changes: 3 additions & 3 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/integration.ipynb
Git LFS file not shown
4 changes: 2 additions & 2 deletions docs/tutorials/pbmc.ipynb
Git LFS file not shown
4 changes: 2 additions & 2 deletions snapatac2-python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
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",
"natsort",
"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",
Expand Down
8 changes: 8 additions & 0 deletions snapatac2-python/snapatac2/tools/_call_peaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
6 changes: 3 additions & 3 deletions snapatac2-python/snapatac2/tools/_smooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion snapatac2-python/src/call_peaks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ fn dataframe_to_narrow_peaks(df: &DataFrame) -> Result<Vec<NarrowPeak>> {
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()?;
Expand Down

0 comments on commit 44b7cfb

Please sign in to comment.