Fetching Gene Cartoon With BioGroovy

EntrezGene provides a gene cartoon which shows the coding regions and untranslated regions for a gene. This informative cartoon shows the mRNA and the resulting protein for a particular gene. In this BioGroovy example, I’ll show you how to fetch the cartoon.

Suppose in this case, that we have a list of EntrezGene IDs and we want to fetch
the cartoon for each ID.

def list = [123, 456, 789]
list.each(){
def eUrl = “http://www.ncbi.nlm.nih.gov/entrez/sutils/geneprod.fcgi?geneid=${it}”;
println “Fetching ${it}”

def file = new FileOutputStream(new File(“/Users/markfortner/Documents/pancreatic_cancer/data/${it}.gif”));
def out = new BufferedOutputStream(file)
out << new URL(eUrl).openStream()
out.close()
}

Advertisements

About aspenbio

I write software for scientists. I'm interested in Java/Groovy/Grails, the Semantic Web and Cancer Biology.
This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s