The easiest way to get UTR sequence

I just figure out the way to query UTR sequences from ensembl by biomart tool.

It is very simple compared with using bioperl to parse gbk files to extract UTR sequences.

?View Code RSPLUS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require(biomaRt)
require(org.Hs.eg.db)
 
ensembl = useMart("ensembl", dataset = "hsapiens_gene_ensembl")
 
eg <- mappedkeys(org.Hs.egGO)
 
utr <- getSequence(id=eg, type="entrezgene", seqType="3utr", mart=ensembl)
 
outfile <- file("human-3utr.fa", "w")
for (i in 1:nrow(utr)) {
	h = paste(c(">", utr[i,2]), collapse="")
	writeLines(h, outfile)
	writeLines(utr[i,1], outfile)
}
close(outfile)

Related Posts

  1. 挑个错,应是"compared with"哟~

    Reply

    ygc China Unknow Browser Unknow Os Reply:

    那我改过来 :?: thanks!

    Reply

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>