Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizhang committed Dec 28, 2024
1 parent d2c317d commit 7c152c8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ SnapATAC2: A Python/Rust package for single-cell epigenomics analysis
![Continuous integration](https://github.com/kaizhang/SnapATAC2/workflows/test-python-package/badge.svg)
![GitHub Repo stars](https://img.shields.io/github/stars/kaizhang/SnapATAC2?style=social)

> [!TIP]
> Got raw fastq files? Check out our new single-cell preprocessing package [precellar](https://github.com/regulatory-genomics/precellar)!
SnapATAC2 is a flexible, versatile, and scalable single-cell omics analysis framework, featuring:

- Scale to more than 10 million cells.
Expand Down
4 changes: 4 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
- Support python 3.13.
- Add Zarr backend support for AnnData.

### Breaking Changes:

- `pp.import_data` is removed in favor of `pp.import_fragments`.

## Release 2.8.0 (released December 13, 2024)

### Features:
Expand Down
8 changes: 2 additions & 6 deletions snapatac2-python/python/snapatac2/export/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def export_coverage(
exclude_for_norm: list[str] | Path = None,
min_frag_length: int | None = None,
max_frag_length: int | None = 2000,
counting_strategy: Literal['fragment', 'insertion', 'paired-insertion'] = 'fragment',
counting_strategy: Literal['fragment', 'insertion'] = 'fragment',
smooth_base: int | None = None,
out_dir: Path = "./",
prefix: str = "",
Expand Down Expand Up @@ -149,14 +149,10 @@ def export_coverage(
Maximum fragment length to be included in the computation.
counting_strategy
The strategy to compute feature counts. It must be one of the following:
"fragment", "insertion", or "paired-insertion". "fragment" means the
"fragment" or "insertion". "fragment" means the
feature counts are assigned based on the number of fragments that overlap
with a region of interest. "insertion" means the feature counts are assigned
based on the number of insertions that overlap with a region of interest.
"paired-insertion" is similar to "insertion", but it only counts the insertions
once if the pair of insertions of a fragment are both within the same region
of interest [Miao24]_.
Note that this parameter has no effect if input are single-end reads.
smooth_base
Length of the smoothing window in bases for the output of the bigwig/bedgraph file.
out_dir
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ def mnc_correct(
data
Matrice or AnnData object. Matrices should be shaped like n_obs x n_vars.
batch
Batch labels for cells. If a string, labels will be obtained from `obs`.
Batch labels for cells, stored as a list of strings, where each string
corresponds to the batch label for a cell. Alternatively, `batch` can be
a string, and in this case labels will be obtained from `.obs[`batch`]`.
n_neighbors
Number of mutual nearest neighbors.
n_clusters
Expand Down Expand Up @@ -70,6 +72,10 @@ def mnc_correct(

if isinstance(batch, str):
batch = adata.obs[batch]
elif isinstance(batch, list):
assert len(batch) == mat.shape[0], "When `batch` is a list of strings, \
it is interpreted as the batch labels of cells and it must \
have the same length as the number of cells."

if groupby is None:
mat = _mnc_correct_main(mat, batch, n_iter, n_neighbors, n_clusters)
Expand Down

0 comments on commit 7c152c8

Please sign in to comment.