This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Bedtools genomecov - Bam to bedgraph conversion

Dear all,

I would like to convert sorted and indexed bam file (~20GB) to an bedgraph file and used the following command:

bedtools genomecov -bg -split -strand - -ibam sorted.bam

It's been 3 days since I executed the command, still I couldn't get any result.

Here is the initial part of the bam file:

A00661:64:H5:1:2179:14687:29434 355 chr1    3206713 255 50M =   3206856 192 ATTCCAATATAAGATGCACACACCTGAGAATCTGAATCTCACTCTGTCCC FFFFFFFFF:FF,:F:FF:FF:F:FFFFF::FFF:,FFF:FF:FF::F,F   ZW:f:0.481137
A00661:64:H5:1:1466:24316:29418 355 chr1    3206713 255 50M =   3206856 192 ATTCCAATATAAGATGCACACACCTGAGAATCTGAATCTCACTCTGTCCC FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF   ZW:f:0.481137
A00661:64:H5:1:1276:8196:6637   355 chr1    3206713 255 50M =   3206856 192 ATTCCAATATAAGATGCACACACCTGAGAATCTGAATCTCACTCTGTCCC FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:FFFFFFFFFFFFFFF   ZW:f:0.481137

Any idea what could be the reason of taking so long? I would appreciate any input about it. Thanks!

bedgraph genomecov bedtools bam

try -strand "-" instead of -strand -?

2 answers

I updated Bedtools version (2.27.1 to 2.30.0), now it is working. Thanks.

the -i parameter is missing so your command is waiting for an input on STDIN. May be you want ... -ibam -i sorted.bam

Thanks for your input. I tested same command with other bam files, it is working as expected. -i is required for BED/GFF/VCF files, for bam, -ibam is used.

Log in to answer this question.