This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to include strand information in the result when running bedtools complement?

Hi everyone,

I am using bedtools complement to find the regions not covered in a GFF file.

Genome file is as follows.

chr1    12222

GFF file likes below.

chr1    db      exon    1       45      .       +       .       ID=gene1
chr1    db      exon    90      450     .       +       .       ID=gene2
chr1    db      exon    1       30      .       -       .       ID=gene99

I run complementBed -i <gff_file> -g <genome_file> and got the following result.

chr1    45      89
chr1    450     12222

This is not what I expected. I hope to get the following information, which includes strand symbol. Could anyone help? Thank you very much!

chr1    45      89       +
chr1    450     12222    + 
chr1    30      12222    -
bedtools

1 answer

Sorry but this is the same question you asked some time ago? problem with bedtools complement: how to extract strand information?

Hi airan, thank you for your comment. Too bad memory I have :) I will separate the strands and then do bedtools.

No problem :)

Log in to answer this question.