Thanks a lot, Manu and airan, I understand the command only outputs region range information.
Hi everyone,
I have a minor trouble when using bedtools complement. My gff3 file contains Chr start end strand etc. information. I want to use bedtools complement to extract other regions, however, the command bedtools complement -i gff_file -g genome_file gives me three columns: Chr, start, end. The output does not have strand information.
Thank you very much
2 answers
You can not get additional information about the complement regions of your interest regions. The main goal of executing bedtools complement command should be to get all off-target regions of your genome, not to "annotate" those regions.
Taking the complement of both strands separately worked for me.
grep -v '+$' sorted_gff_file | bedtools complement -i stdin -g genome_file | sed 's/$/\t-/' > complement_file
grep '+$' sorted_gff_file | bedtools complement -i stdin -g genome_file | sed 's/$/\t+/' >> complement_file
You can sort the complement file after this.
Log in to answer this question.
This tool would give you the regions of your
genome_filewhich are not in yourgff_file. What strand you expect from output?