I have a file in the following BED format
Chr1 1022071 1022105 +
Chr1 1022071 1022105 +
Chr1 1022072 1022106 -
Chr1 1022072 1022106 -
Chr1 1022072 1022106 -
Chr1 1022072 1022106 -
I am trying get the counts of each feature represented in this file.
mergeBed -i R5_chr.bed -n -s -d 0 > Output/R5_chr_counts.bed
I am interested in the counts of the features and I do not want to merge features by any number of base pairs. Then the output should be as follows
Chr1 1022071 1022105 2 +
Chr1 1022072 1022106 4 +
Any suggestions on how to achieve this using bedtools or in bash or awk? Thanks in advance!
Thank you very much!! This worked perfectly to my need :)