Hello everyone!
I want to ask regarding bed file filtering.
So I have names of the genes I want to remove from my bed file. I am not interested in the length of the gene, start and end regions, I just want to fully remove all regions associated with the gene from my my gene_list.
So, for me, bed subtract option doesn't work.
I also tried to use grep but I guess there is a syntax error or something else, it didn't work (probably it is completely wrong grep -v --binary-files=text -f gene_list.txt my.bed > filtered_output.bed
)...
I have gene_list.txt
(file containing column of 174 gene names, which I want to remove from my bed file) and bed file itself (containing chr, start, end and gene name info)
Thank you!
if you also work in R, you can try the anti_join function of the dplyr package. Here is an example that you need to adapt to your context: