This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Convert Bamtobed Score

Hey,

just a short question....is there a possibility to set the score in the bed file to "1" an not to the the alignment score?? arguments -tag and -ed only use BAM alignment tags... ?!? :/

Cheers!

bedtools scoring

1 answer

I suggest you use awk after bamToBed. If the score you want to replace is in column 4 you could use:

cat your_file.bed | awk '{ print $1"\t"$2"\t"$3"\t1\t"$5"\t"$6}'

I was looking for a one-step-solution within this tool....so this is what i would do if bamToBed really can't use a defined value as score :/ Thanks!

Whatch out Pierre: this trick doesn't output with tab-separated columns...

Log in to answer this question.