This is a test version of Biostars. For the public version, visit https://www.biostars.org.
bedtools merge with strandedness giving now output

Hello, I have a bed file and need to merge with strand specificity, but I am not getting an output. My command is:

bedtools merge -i input.bed -s > merged.bed

My bed file looks like :

chr1    65702     65714     +
chr1    71879     71891     -
chr1    97442     97454     -
chr1    97552     97564     -
chr1    125938    125950    +
chr1    134489    134501    -
chr1    165663    165675    -
chr1    173419    173431    +
chr1    176257    176269    +
chr1    176263    176275    +
bedtools

1 answer

Try this:

awk '{OFS="\t"; print $1,$2,$3,".",".",$4}' INPUT.bed | bedtools merge -i - -s

Bed format contains strand information in column 6.

Awesome! Thank you :)

Log in to answer this question.