This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Bedtools coverage not return every line in file A

It seems for some range in A, there is not corresponding return in result for bedtools coverage. Is there any way to force bedtools to return every range in A?

The command is:

bedtools coverage -sorted -hist -a A.tab.sort -b B.sort > A.res.tab

wc -l A.tab.sort

64800

wc -l A.res.tab

64441

bedtools

Sorry/forget to add the questions/Thanks.

Provide an example of both A and B as well as the expected and the given result, so that people can understand what your point/question is.

A and B are just bed format file. My previous running with similar file didn't give any such error(loss of some lines). So, I guess "example" file would not be useful.

1 answer

The default behavior will give you after the line of A feature

The number of features in B that overlapped (by at least one base pair) the A interval

So If it is 0 (Zero) it mean it is not covered.


You could use -d option

-d Reporting the per-base of coverage for each feature in the A file

One should use the “-d” option to create, for each interval in A, a detailed list of coverage at each of the positions across each A interval.

The output will consist of a line for each one-based position in each A feature, followed by the coverage detected at that position.

and also you may want to use -hist

-hist Creating a histogram of coverage for each feature in the A file

One should use the “-hist” option to create, for each interval in A, a histogram of coverage of the features in B across A.

In this case, each entire feature in A will be reported, followed by the depth of coverage, the number of bases at that depth, the size of the feature, and the fraction covered. After all of the features in A have been reported, a histogram summarizing the coverage among all features in A will be reported.

for more detailed answer you should provide the command you used.

Thanks for answering. Actually -d and -hist is not what I needed. I just need the information for each range in A, not every base. Bedtools return most ranges but fail to return some. I have try -hist the line number is the same as not use it.

Log in to answer this question.