scverse / scverse/SnapATAC2

Empty peak matrix

Open
#422 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
323
Forks
43
PR merge metrics
No merged PRs in 30d

Description

Hello,
Having issues running the peak calling pipeline.
Here is everything

import  scanpy as sc
import snapatac2 as snap
from MACS3.Signal.PeakDetect import PeakDetect
snap.__version__

if __name__ == '__main__':
    data = snap.read(h5ad_input, backed=None)
    group_by = 'class'
    replicate = 'sample'
    n_jobs=30
    print("Started: Find Peaks")
    # Call ATAC-seq peaks using MACS
    snap.tl.macs3(data, groupby=group_by,
                  replicate=replicate,
                  n_jobs=n_jobs)
    print("Finished: Find Peaks")
    print("Started: Merge Peaks")
    merged_peaks = snap.tl.merge_peaks(data.uns['macs3'],
                                                                   chrom_sizes=snap.genome.hg38)
    print("Finished: Merge Peaks")
    print("Started: Make_peak_matrix")
    peak_mat = snap.pp.make_peak_matrix(data, use_rep=merged_peaks['Peaks'])
    print("Finished: Make_peak_matrix")
    print("Started: write_h5ad")
    peak_mat.write_h5ad(output_h5ad, compression="gzip")

Seems to run fine


Started: Find Peaks
100%|██████████| 6/6 [45:43:01<00:00, 27430.32s/it]
... storing 'sample' as categorical
... storing 'class' as categorical
Finished: Find Peaks

Started: Merge Peaks
Finished: Merge Peaks

Started: Make_peak_matrix
Finished: Make_peak_matrix

Started: write_h5ad
Started: write_h5ad

The matrix is empty
AnnData object with n_obs × n_vars = 618362 × 0

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported entry points snap.tl.macs3, snap.tl.merge_peaks, and snap.pp.make_peak_matrix. Inspect the contents of data.uns['macs3'] and merged_peaks['Peaks'] before matrix creation, then reproduce the run and confirm whether make_peak_matrix produces nonzero variables.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
bioinformatics, data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.