works like a charm! Thanks!
• 0 views
•
link
I have been using bedtools for a long time but I can't seem to quite figure the following operation. Hope someone can help!
cat test.bed
chr1 5 27
chr1 7 12
chr1 10 20
chr1 22 27
chr1 24 30
bedtools merge -i test.bed
chr1 5 30
Now I wish to conduct something that would like :
# first two lines
chr1 5 6 1 #only shown once
chr1 7 10 2 #shown twice
I can do it with coverage option by showing the base depth option, but surely there may be something that is even quicker!
You can try bedtools genomecov :
cat test.bed
chr1 5 27
chr1 7 12
chr1 10 20
chr1 22 27
chr1 24 30
cat chr.txt
chr1 50
bedtools genomecov -i test.bed -g chr.txt -bg
chr1 5 7 1
chr1 7 10 2
chr1 10 12 3
chr1 12 20 2
chr1 20 22 1
chr1 22 24 2
chr1 24 27 3
chr1 27 30 1
works like a charm! Thanks!
Log in to answer this question.