Xinglab / CLAM

CLIP-seq Analysis of Multi-mapped reads
GNU General Public License v3.0
28 stars 6 forks source link

CLAM peak_annotator error: TypeError: catching classes that do not inherit from BaseException is not allowed #18

Closed sherkinglee closed 4 years ago

sherkinglee commented 4 years ago

When I used the command to annotate narrow peaks generated by CLAM peakcaller, the error occurred. Please tell me how to solve it. Thanks.

$ CLAM peak_annotator -i narrow_peak.unique.bed -g hg38 -o annotate.txt Loading peaks... Peak file loaded. Loading genome annotation... Genome annotation loaded. Intersecting peaks with genome annotation... Traceback (most recent call last): File "/Share2/home/lifj/Software/anaconda3/lib/python3.7/site-packages/CLAM-1.2.0-py3.7.egg/CLAM/peak_annotator.py", line 38, in parser File "/Share2/home/lifj/Software/anaconda3/lib/python3.7/site-packages/CLAM-1.2.0-py3.7.egg/CLAM/peak_annotator.py", line 100, in intersect_gtf_regions File "/Share2/home/lifj/Software/anaconda3/lib/python3.7/site-packages/pybedtools/bedtool.py", line 917, in decorated result = method(self, *args, **kwargs) File "/Share2/home/lifj/Software/anaconda3/lib/python3.7/site-packages/pybedtools/bedtool.py", line 401, in wrapped decode_output=decode_output, File "/Share2/home/lifj/Software/anaconda3/lib/python3.7/site-packages/pybedtools/helpers.py", line 455, in call_bedtools raise BEDToolsError(subprocess.list2cmdline(cmds), stderr) pybedtools.helpers.BEDToolsError: Command was:

    bedtools sort -i /tmp/pybedtools.7vq0uqf8.tmp

Error message was: Error: The requested bed file (/tmp/pybedtools.7vq0uqf8.tmp) could not be opened. Exiting!

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Share2/home/lifj/Software/CLAM-1.2.0/bin/CLAM", line 326, in main() File "/Share2/home/lifj/Software/CLAM-1.2.0/bin/CLAM", line 74, in main peak_annotator.parser(args) File "/Share2/home/lifj/Software/anaconda3/lib/python3.7/site-packages/CLAM-1.2.0-py3.7.egg/CLAM/peak_annotator.py", line 39, in parser TypeError: catching classes that do not inherit from BaseException is not allowed

wkdeng commented 4 years ago

Thanks for your feedback!

This is a pybedtools related problem. There are two possible reason for this issue:

  1. you dont have writing permission to write to global temporary folder /tmp. To verify this, you can check if there's a file name /tmp/pybedtools.7vq0uqf8.tmp. If this is the case, you will need to update your pybedtools to latest version, they fixed this.
  2. If this file exists, but it's an empty file, it could be in-compatible chromosome names between your annotation file and our pre-generated file. In our pre-generated annotation file, chromosome names start with 'chr', i.e., chrX. If this is the case, you will need to use genome annotation compatible with our annotation file.

Feel free to re-open this issue if my suggestions do not work, thanks!