querying 5'UTR, first exon, and flanking sequences
2
0
Entering edit mode
5.9 years ago
2015rpro • 0

I am trying to help my PI with a project. He gave me a list of 2700 hgnc_ids and wants me to obtain the sequence of 1000 bases upstream of TSS of each of the 2700 genes, and the first exon of each gene, and the sequence of the 1000 bases downstream of the first exon(the intron).

I tried ensembl with BiomaRt with R bioconductor, however, i am only able to obtain the 1000 upstream flanking sequences and the exons, but ensembl does not have introns sequence function.

I also tried BioString and BSgenome but it seems I could only query one gene at a time and it didn't work with all 2700 genes at once.

Does any body know what I could do?

exon introns 5'utr flanking sequences • 2.1k views
0
Entering edit mode
5.9 years ago

Another way could be,

1) download the whole gene coordinates from Biomart (for all 2700 genes).

2) Repeat the same step but with exons as output.

use subtractBed to fetch the intron list, using above two file (Gene-Exons)

So, now you have exon and intron co-ordinates, you could write small code in R/perl to do whatever you want (get the respective co-ordinates). Make sure, you whatever you do, do it strand specifically (if -ve strand, TSS and TTS are other way around).

Finally, if you want sequences (FASTA), use getFasta

HTH

0
Entering edit mode
5.9 years ago
Tariq Daouda ▴ 210

Hi,

If you convert your hgnc_ids to ensembl ids using biomart and don't mind a bit of python, pyGeno allows you to do that quite easily by querying genes/transcripts/exons by ids. Here are some example snipets.

To get the 5' UTR of a transcript:

print trans.UTR5


To get the first exon:

print trans.exons[0].sequence


To get the flanking regions:

chro = trans.chromosome
exon = trans.exons[0]

print chro.getSequence(exon.start - 1000, exon.end + 1000)