Bug when running tutorial #163
Unanswered
incredible-maker
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi I am running tutorial for better understanding but I meet bug in one of the cell:
import os
import pickle
bed_paths = pickle.load(open(os.path.join(work_dir, 'scATAC/consensus_peak_calling/pseudobulk_bed_files/bed_paths.pkl'), 'rb'))
bw_paths = pickle.load(open(os.path.join(work_dir, 'scATAC/consensus_peak_calling/pseudobulk_bed_files/bw_paths.pkl'), 'rb'))
from pycisTopic.pseudobulk_peak_calling import peak_calling
macs_path='macs2'
Run peak calling
narrow_peaks_dict = peak_calling(macs_path,
bed_paths,
os.path.join(work_dir, 'scATAC/consensus_peak_calling/MACS/'),
genome_size='hs',
n_cpu=1,
input_format='BEDPE',
shift=73,
ext_size=146,
keep_dup = 'all',
q_value = 0.05,
_temp_dir = os.path.join(tmp_dir, 'ray_spill'))
2023-05-30 16:48:01,837 cisTopic INFO Calling peaks for B_cells with macs2 callpeak --treatment pbmc_tutorial/scATAC/consensus_peak_calling/pseudobulk_bed_files/B_cells.bed.gz --name B_cells --outdir pbmc_tutorial/scATAC/consensus_peak_calling/MACS/ --format BEDPE --gsize hs --qvalue 0.05 --nomodel --shift 73 --extsize 146 --keep-dup all --call-summits --nolambda
error:
CalledProcessError Traceback (most recent call last)
File ~/miniconda2/envs/scenicplus/lib/python3.8/site-packages/pycisTopic/pseudobulk_peak_calling.py:697, in MACSCallPeak.call_peak(self)
696 try:
--> 697 subprocess.check_output(args=cmd, shell=True, stderr=subprocess.STDOUT)
698 except subprocess.CalledProcessError as e:
File ~/miniconda2/envs/scenicplus/lib/python3.8/subprocess.py:415, in check_output(timeout, *popenargs, **kwargs)
413 kwargs['input'] = empty
--> 415 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
416 **kwargs).stdout
File ~/miniconda2/envs/scenicplus/lib/python3.8/subprocess.py:516, in run(input, capture_output, timeout, check, *popenargs, **kwargs)
515 if check and retcode:
--> 516 raise CalledProcessError(retcode, process.args,
517 output=stdout, stderr=stderr)
518 return CompletedProcess(process.args, retcode, stdout, stderr)
CalledProcessError: Command 'macs2 callpeak --treatment pbmc_tutorial/scATAC/consensus_peak_calling/pseudobulk_bed_files/B_cells.bed.gz --name B_cells --outdir pbmc_tutorial/scATAC/consensus_peak_calling/MACS/ --format BEDPE --gsize hs --qvalue 0.05 --nomodel --shift 73 --extsize 146 --keep-dup all --call-summits --nolambda' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
RuntimeError Traceback (most recent call last)
/home/jacky/pbmc_multiome_tutorial.ipynb Cell 50 in ()
6 macs_path='macs2'
...
702 )
703 )
704 self.narrow_peak = self.load_narrow_peak()
RuntimeError: command 'macs2 callpeak --treatment pbmc_tutorial/scATAC/consensus_peak_calling/pseudobulk_bed_files/B_cells.bed.gz --name B_cells --outdir pbmc_tutorial/scATAC/consensus_peak_calling/MACS/ --format BEDPE --gsize hs --qvalue 0.05 --nomodel --shift 73 --extsize 146 --keep-dup all --call-summits --nolambda' return with error (code 1): b'INFO @ Tue, 30 May 2023 16:48:02: \n# Command line: callpeak --treatment pbmc_tutorial/scATAC/consensus_peak_calling/pseudobulk_bed_files/B_cells.bed.gz --name B_cells --outdir pbmc_tutorial/scATAC/consensus_peak_calling/MACS/ --format BEDPE --gsize hs --qvalue 0.05 --nomodel --shift 73 --extsize 146 --keep-dup all --call-summits --nolambda\n# ARGUMENTS LIST:\n# name = B_cells\n# format = BEDPE\n# ChIP-seq file = ['pbmc_tutorial/scATAC/consensus_peak_calling/pseudobulk_bed_files/B_cells.bed.gz']\n# control file = None\n# effective genome size = 2.70e+09\n# band width = 300\n# model fold = [5, 50]\n# qvalue cutoff = 5.00e-02\n# The maximum gap between significant sites is assigned as the read length/tag size.\n# The minimum length of peaks is assigned as the predicted fragment length "d".\n# Larger dataset will be scaled towards smaller dataset.\n# Range for calculating regional lambda is: 10000 bps\n# Broad region calling is off\n# Paired-End mode is on\n# Searching for subpeak summits is on\n \nINFO @ Tue, 30 May 2023 16:48:02: #1 read fragment files... \nINFO @ Tue, 30 May 2023 16:48:02: #1 read treatment fragments... \nTraceback (most recent call last):\n File "/home/jacky/miniconda2/envs/scenicplus/bin/macs2", line 653, in \n main()\n File "/home/jacky/miniconda2/envs/scenicplus/bin/macs2", line 51, in main\n run( args )\n File "/home/jacky/miniconda2/envs/scenicplus/lib/python3.8/site-packages/MACS2/callpeak_cmd.py", line 64, in run\n if options.PE_MODE: (treat, control) = load_frag_files_options (options)\n File "/home/jacky/miniconda2/envs/scenicplus/lib/python3.8/site-packages/MACS2/callpeak_cmd.py", line 349, in load_frag_files_options\n tp = options.parser(options.tfile[0], buffer_size=options.buffer_size)\n File "MACS2/IO/Parser.pyx", line 330, in MACS2.IO.Parser.GenericParser.init\n File "/home/jacky/miniconda2/envs/scenicplus/lib/python3.8/gzip.py", line 58, in open\n binary_file = GzipFile(filename, gz_mode, compresslevel)\n File "/home/jacky/miniconda2/envs/scenicplus/lib/python3.8/gzip.py", line 173, in init\n fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')\nFileNotFoundError: [Errno 2] No such file or directory: 'pbmc_tutorial/scATAC/consensus_peak_calling/pseudobulk_bed_files/B_cells.bed.gz'\n'
I have tried fixing error but none of it work, much appreciate if someone could give some help&hints to fix it, thanks!
Beta Was this translation helpful? Give feedback.
All reactions