arq5x / bedtools

A powerful toolset for genome arithmetic.
http://code.google.com/p/bedtools/
GNU General Public License v2.0
139 stars 86 forks source link

Add a 'flip' tool. #41

Open arq5x opened 11 years ago

arq5x commented 11 years ago

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

brentp commented 11 years ago

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

arq5x commented 11 years ago

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

arq5x commented 11 years ago

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

brentp commented 11 years ago

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 }'
arq5x commented 11 years ago

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

arq5x commented 11 years ago

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.