Hi all,
As the title suggests, is it possible to generate a bed12 file given a genomic range?
Here are some examples;
Standard bed file:
chr22 20564449 20566817 circrna 0 +
I would like to generate a bed12 file from the underlying sequence that would ultimately result in:
chr22 20564449 20566817 circrna 0 + 20564449 20564449 0,0,0 2 239,351 0,2017
Red: genomic range, Blue: GTF, Black: desired bed12 output
I have also considered if the genomic range is intronic, in which case the sequence is represented as 1 exon block:
The goal here is to use bedtools getfasta with the -split flag to retrieve the concatenated exon sequences / intron sequence.
Thanks,
Barry
1 answer
Try the script at the following location: https://github.com/BarryDigby/circrna/blob/master/bin/get_mature_seq.sh
Must supply GTF file as first argument to script (gencode)
Must have unwanted_biotypes.txt in same dir.
Logic:
|-- Checks circRNA for overlapping features in GTF file (protein coding, pseudogenes, lncRNA)
|-- Does the circRNA overlap any features?
|-- Yes:
| Attempts to fit circRNA to exon boundaries
|-- Does it fit exon boundaries?
|-- Yes:
| Make bed12 files
|-- No:
| Attempts to fit to 'best transcript' (underlying transcript that spans the circRNA region with most exon blocks)
|-- Does the circRNA fall within 200nt of underlying transcript boundary?
|-- Yes:
| use best transcript exon boundaries, make bed12
|-- No:
circRNA marked as EIciRNA, entire region treated as 1 block
|-- No:
no overlapping regions, circRNA treated as intronic
It perfectly recreates CircExplorer2 output, but that is to be expected as it is an annotation based circRNA discovery tool. De novo tool output might struggle using this script.
Log in to answer this question.


Since you answered your own question may want to add that as an answer instead of including it in the original post.
I intend to, just need to test it at a larger scale tomorrow before doing that.