r3fang / SnapATAC

Analysis Pipeline for Single Cell ATAC-seq
GNU General Public License v3.0
300 stars 125 forks source link

Error adding Pmat to SnapATAC object #128

Open emdann opened 4 years ago

emdann commented 4 years ago

Hello, I am following the vignette for scATAC and scRNA integration and I got stuck in Step 14 (Create a cell-by-peak matrix). I used snaptools to add my cell-by-peak matrix in the snap object with snaptools snap-add-pmat, but when I try to add it to the R object I get the following error

> snap.out <- addPmatToSnap(snap.out)
Epoch: reading cell-peak count matrix session ...
Error in value[[3L]](cond) : 
  Warning @readSnap: 'PM/idx' not found in  /home/jovyan/my_data/cellranger-atac110_count_30439_WSSS8038360_GRCh38-1_1_0.snap

Doing some debugging I figured this might have something to do with memory requirements, but I keep getting the same error if I clean everything and if I subset the data.

My dataset:

> snap.out
number of barcodes: 5793
number of bins: 539584
number of genes: 33517
number of peaks: 0
number of motifs: 0

My peaks:

> head(read.table('~/my_data/Tcells_peaks/peaks.combined.bed'))
    V1     V2     V3
1 chr1 181587 181787
2 chr1 778495 779474
3 chr1 826864 827206
4 chr1 827388 827870
5 chr1 838489 838715
6 chr1 844273 844856

Any suggestions? Thanks, Emma

r3fang commented 4 years ago

Hi Emma,

Have you add the pmat to the snap file? In order to let SnapATAC load the cell-by-peak matrix, you will need to first add the pmat to the snap file. You can do it with the following command:

snaptools snap-add-pmat \
    --snap-file /home/jovyan/my_data/cellranger-atac110_count_30439_WSSS8038360_GRCh38-1_1_0.snap \
    --peak-file peaks.combined.bed

Once you add the cell-by-peak matrix into the snap file, you should be able to load the pmat by addPmatToSnap in R.

leeanapeters commented 3 years ago

Is there a way to export the snap object as a snap file? I am performing this analysis using 3 samples integrated together but started with three individual snap files.

Thanks

gengbaobao commented 6 months ago

Hello, Did you solve this question? I also get this error and I perform analysis on 8 samples.