SnapATAC2 icon indicating copy to clipboard operation
SnapATAC2 copied to clipboard

When run “snap.tl.merge_peaks” error “No such file or directory”

Open franvz9 opened this issue 1 year ago • 2 comments

Hi, Sir,thanks for your works in this project,its an awesome tool! recently,when i use this tool to deal with scATAC data for peak merge,i find a problem: When I run “snap.tl.merge_peaks”,error “No such file or directory” would be appeared. i am sure use completed ref-genome or completed custom genome;

Do you know whats wrong with tihs problem?

error message `--------------------------------------------------------------------------- PanicException Traceback (most recent call last) Cell In[11], line 1 ----> 1 get_ipython().run_cell_magic('time', '', 'merged_peaks = snap.tl.merge_peaks(all_peaks,snap.genome.mm10)

File ~/miniconda3/envs/scvi-dcu/lib/python3.10/site-packages/IPython/core/interactiveshell.py:2543, in InteractiveShell.run_cell_magic(self, magic_name, line, cell) 2541 with self.builtin_trap: 2542 args = (magic_arg_s, cell) -> 2543 result = fn(*args, **kwargs) 2545 # The code below prevents the output from being displayed 2546 # when using magics with decorator @output_can_be_silenced 2547 # when the last Python token in the expression is a ';'. 2548 if getattr(fn, magic.MAGIC_OUTPUT_CAN_BE_SILENCED, False):

File ~/miniconda3/envs/scvi-dcu/lib/python3.10/site-packages/IPython/core/magics/execution.py:1370, in ExecutionMagics.time(self, line, cell, local_ns) 1368 st = clock2() 1369 try: -> 1370 exec(code, glob, local_ns) 1371 out = None 1372 # multi-line %%time case

File :1

File ~/miniconda3/envs/scvi-dcu/lib/python3.10/site-packages/snapatac2/tools/_call_peaks.py:235, in merge_peaks(peaks, chrom_sizes, half_width) 233 chrom_sizes = chrom_sizes.chrom_sizes if isinstance(chrom_sizes, Genome) else chrom_sizes 234 peaks = { k: pl.from_pandas(v) if isinstance(v, pd.DataFrame) else v for k, v in peaks.items()} --> 235 return _snapatac2.py_merge_peaks(peaks, chrom_sizes, half_width)

PanicException: called Result::unwrap() on an Err value: IO(Os { code: 2, kind: NotFound, message: "No such file or directory" })`

franvz9 avatar Aug 22 '25 03:08 franvz9

custom genome like: myCustomGenome = snap.genome.Genome( fasta='/public/home/niuxy/Project/MouseBrain/FR_workspace/gff_file/GRCm38.primary_assembly.genome.fa', annotation='/public/home/niuxy/Project/MouseBrain/FR_workspace/gff_file/gencode.vM25.basic.annotation.gff3.gz', chrom_sizes={ "chr1": 195471971, "chr2": 182113224, "chr3": 160039680, "chr4": 156508116, "chr5": 151834684, "chr6": 149736546, "chr7": 145441459, "chr8": 129401213, "chr9": 124595110, "chr10": 130694993, "chr11": 122082543, "chr12": 120129022, "chr13": 120421639, "chr14": 124902244, "chr15": 104043685, "chr16": 98207768, "chr17": 94987271, "chr18": 90702639, "chr19": 61431566, "chrX": 171031299, "chrY": 91744698, }, )

franvz9 avatar Aug 22 '25 03:08 franvz9

this custom genome was worked at steps before merge peaks

franvz9 avatar Aug 22 '25 03:08 franvz9