daler / pybedtools

Python wrapper -- and more -- for BEDTools (bioinformatics tools for "genome arithmetic")
http://daler.github.io/pybedtools
Other
302 stars 102 forks source link

pybedtools multi_bam_coverage assistance #395

Closed erinyoung closed 1 year ago

erinyoung commented 1 year ago

I don't think this is an error of pybedtools, I think I'm just not understanding how to use it.

My script (I have a bedfile and some sam files, but I'm trying to get it to work for one sam file initially) where I want to get the coverage of each region specified in the bedfile:

from pybedtools import BedTool

bedtools_bed = BedTool('dge/tmp.bed')
bedtools_bed.multi_bam_coverage(bams='dge/tmp.map-ont.sorted.sam')

The error :

NotImplementedError: "multiBamCov" does not appear to be installed or on the path, so this method is disabled.  Please install a more recent version of BEDTools and re-import to use this method.

I am using version 0.9.1.

daler commented 1 year ago

Have you installed bedtools, and is it on your $PATH at the time the lines above are run?

erinyoung commented 1 year ago

I didn't realized I needed to install bedtools as well. My apologies! I just installed pybedtools via pip.