bedops / bedops

:microscope: BEDOPS: high-performance genomic feature operations
https://bedops.readthedocs.io/
Other
295 stars 59 forks source link

bedmap (bedops) will consider strand? and bed12 (blocked) files supported? #211

Closed Linhua-Sun closed 5 years ago

Linhua-Sun commented 5 years ago

Hi, I am wondering if bedmap will consider the strand info from bed6 file. Or if there any options about the control of strand. And I didn't google any useful info about the questions. Another question: is bed12 (blocked bed file) supported when calculating the overlap? It seems that it is not supported yet. Thank you!

alexpreynolds commented 5 years ago

One way to deal with stranded BED is to pipe the output of awk to bedops, bedmap, etc. which accept standard input from upstream processes, e.g.:

$ awk '($6=="+")' in.bed | bedops --merge - > out.for.bed
$ awk '($6=="-")' in.bed | bedops --element-of 1 genes.bed - > out.rev.bed

Use the - hyphen to represent standard input from an upstream source. It can be placed to substitute either map or reference files.

I don't know if BED12 support is coming. It is usually possible to rewrite text files into BED3+ to do necessary operations, however.

Hope this helps!

Linhua-Sun commented 5 years ago

Thank you very much! Nice answer.