This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Find the transcripts of genomic coordinates

Hello everyone

I have a bed file with genomic coordinates, how can I identify the corresponding transcripts?

python

Do you mean identify transcripts that overlap with the coordinates in your BED file? It looks like you want to use Python to accomplish this. You could use PyRanges to read in your BED coordinates, and a GTF file of transcripts, and ask for overlaps. Did you want to use some other language? Or command-line tools? What form are your transcripts in?

1 answer

If you mean the way of fetching the sequence of the transcripts from the bed file, how about using getfasta in bedtools? You can use as follows:

$ cat test.fa
>chr1
AAAAAAAACCCCCCCCCCCCCGCTACTGGGGGGGGGGGGGGGGGG

$ cat test.bed
chr1 5 10

$ bedtools getfasta -fi test.fa -bed test.bed
>chr1:5-10
AAACC

(ref: https://bedtools.readthedocs.io/en/latest/content/tools/getfasta.html)

Log in to answer this question.