This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Bedtools Slop for Specific Features

I want to use Bedtools Slop on a GTF file, but only on specific features (for example only for those labeled as gene, or exon, ect.)

I have been trying to pipeline the command with awk, but to no avail:

awk '{ if ($3 == "gene") | bedtools slop -i A.bed -g my.genome -l 2 -r 3

Any help would be great!

bedtools awk

1 answer

Please give it like below

awk '$3=="gene"{print}' my.gtf | bedtools slop -i -  -g my.genome  -l 2 -r 3

Log in to answer this question.