Bedtools coverage not return every line in file A
1
0
Entering edit mode
6.4 years ago
yuewu_mike • 0

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 • 1.9k views
ADD COMMENT
1
Entering edit mode

Is this a statement or question or .. ? Whatever it is, more information regarding your thread would be helpful for everyone. May be you can take a look at

ADD REPLY
0
Entering edit mode

Sorry/forget to add the questions/Thanks.

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode
6.4 years ago
Medhat 9.7k

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.

ADD COMMENT
0
Entering edit mode

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.

ADD REPLY

Login before adding your answer.

Traffic: 2385 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6