bedtools icon indicating copy to clipboard operation
bedtools copied to clipboard

Add a 'flip' tool.

Open arq5x opened this issue 13 years ago • 6 comments

Like bit flipping, this would flip the strand of every interval.

arq5x avatar Nov 28 '12 17:11 arq5x

this and shift seem like a job for awk, no?

brentp avatar Nov 28 '12 17:11 brentp

Agree, but harder for BAM files. It's is certainly debatable though.

arq5x avatar Nov 28 '12 17:11 arq5x

Also, for flip, I wanted to have a random strand assignment function which would be (slightly) harder for most folks with awk.

arq5x avatar Nov 28 '12 17:11 arq5x

There is a lot of tools in there already.

random assignment is simple with awk:

awk 'BEGIN{FS=OFS="\t"}{ $6 = int(rand() + 0.5) == 0 ? "-" : "+"; print }'

brentp avatar Nov 28 '12 17:11 brentp

In general, I agree but: GFF? GTF? BAM? TABIX? BAM in particular requires literal bit flipping.

arq5x avatar Nov 28 '12 17:11 arq5x

As for too many tools, I don't really see that as an issue. It is more about better documentation, which is lagging badly and I am aware of it.

arq5x avatar Nov 28 '12 17:11 arq5x