This is a test version of Biostars. For the public version, visit https://www.biostars.org.
bedtools closest return no output!

Dear all,

I'm trying to get the upstream and downstream genes of a specific long non-coding RNA (lncRNA) in rat. To this end, I download the rat GTF file from Ensembl and converted to bed format by fgrep -w gene rat.gtf | sed 's/[";]//g;' | awk '{OFS="\t"; print $1, $3, $4-4,$5,$12,0,$7,$18,$14,$10}' > gene.bed. Then, sort the file with sort -k1,1 -k2,2n and finally used bedtools closest -a myfile.bed -b gene_sorted.bed But, I have not got any output, the tool also returned no error. How is it possible no genes around my lncRNA of interest? Could you please let me know what's wrong?

Thanks

bedtools nearest gene gtf

Please show a head of all relevant files. Maybe different chromosome identifiers, 1 vs chr1.

Thanks, the files have not such a problem that you mentioned. I tried bedtools window and worked well. Sorry, what's the main difference between these two options, closest and window?

FYI bedtools can take GTF/GFF files instead of BED files, so there's not need to convert your GTF. As ATpoint said, if you show us the first few lines of each file it would help to figure out the error.

0 answers

No answers yet.

Log in to answer this question.