Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit bf761a4
Showing
8 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
BrainStars API client for R | ||
|
||
Itoshi NIKAIDO <dritoshi@gmail.com> | ||
Copyright (C) 2009. Itoshi NIKAIDO. GPL 2 | ||
|
||
This R library can search and get gene expression data and plots | ||
from BrainStars (or B*, http://brainstars.org/). | ||
|
||
BrainStars is a quantitative expression database of the adult | ||
mouse brain. The database has genome-wide expression profile at 51 | ||
adult mouse CNS regions. | ||
|
||
For 51 CNS regions, slices (0.5-mm thick) of mouse brain were cut on a | ||
Mouse Brain Matrix, frozen, and the specific regions were punched out | ||
bilaterally with a microdissecting needle (gauge 0.5 mm) under a | ||
stereomicroscope. For each region, we took samples every 4 hours, | ||
starting at ZT0 (Zeitgaber time 0; the time of lights on), for 24 | ||
hours (6 time-point samples for each region), and we pooled the | ||
samples from the different time points. We independently sampled each | ||
region twice (n=2). | ||
|
||
These samples were purified their RNA, and measured with Affymetrix | ||
GeneChip Mouse Genome 430 2.0 arrays. Expression values were then | ||
summarized with the RMA method. After several analysis with the | ||
expression data, the data and analysis results were stored in the | ||
BrainStars database. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
task :default => [:demo] | ||
|
||
desc "Run demo" | ||
task :demo do | ||
sh "R -q -f run_brainstars.r" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# | ||
# R Library for BrainStars http://brainstars.org/ | ||
# | ||
# Itoshi NIKAIDO <dritoshi@gmail.com> | ||
# Copyright (C) 2009. Itoshi NIKAIDO. GPL 2 | ||
# | ||
|
||
getBrainStarsExpression <- function(gene) { | ||
base.url <- "http://brainstars.org/probeset/" | ||
url.options <- "/exprvalues.csv" | ||
url <- paste(base.url, gene, url.options, sep="") | ||
|
||
expr <- read.csv(url, row.names=1) | ||
return(expr) | ||
} | ||
|
||
getBrainStarsFigure <- function(gene, url.option) { | ||
require("RCurl") | ||
|
||
base.url <- "http://brainstars.org/probeset/" | ||
url.option.list <- c("exprgraph", "exprmap", "switchgraph", "switchhist", "switchmap") | ||
|
||
if (sum(url.option.list == url.option) != 1) { | ||
error.meg <- "Specify figure type." | ||
error.meg <- paste(error.meg, paste(url.option.list, collapse=", ")) | ||
stop(warn=error.meg) | ||
} | ||
|
||
cat("Downloading...\n") | ||
url <- paste(base.url, gene, "/", url.option, ".png", sep="") | ||
file.name <- paste(gene, ".", url.option, ".png", sep="") | ||
plot <- getBinaryURL(url) | ||
cat("Done.\n") | ||
|
||
writeBin(plot, file.name) | ||
invisible(plot) | ||
} | ||
|
||
getBrainStarsSearch <- function(keyword) { | ||
require("RCurl") | ||
|
||
base.url <- "http://brainstars.org/search/" | ||
|
||
# if (sum(keyword) != 1) { | ||
# error.meg <- "Input keyword type." | ||
# error.meg <- paste(error.meg, paste(keyword, collapse=", ")) | ||
# stop(warn=error.meg) | ||
# } | ||
|
||
cat("Downloading...\n") | ||
url <- paste(base.url, keyword, sep="") | ||
cat("Done.\n") | ||
results <- getURL(url) | ||
results <- unlist(strsplit(results, "\n")) | ||
return(results) | ||
|
||
# writeBin(plot, file.name) | ||
# invisible(plot) | ||
} | ||
|
||
getBrainStarsMarker <- function(keyword) { | ||
require("RCurl") | ||
|
||
base.url <- "http://brainstars.org/marker/" | ||
json.option <- "?content-type=application/json" | ||
|
||
cat("Downloading...\n") | ||
url <- paste(base.url, keyword, json.option, sep="") | ||
cat(url, "\n") | ||
cat("Done.\n") | ||
results <- getURL(url) | ||
#results <- unlist(strsplit(results, "\n")) | ||
return(results) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
source("brainstars.r") | ||
|
||
# Search API | ||
receptors <- getBrainStarsSearch("receptor/10,5") | ||
num.receptors <- getBrainStarsSearch("receptor/count") | ||
cat(receptors, "\n") | ||
cat(num.receptors, "\n") | ||
|
||
# Marker API | ||
r.json <- getBrainStarsMarker("high/LS/count") | ||
cat(r.json, "\n") | ||
|
||
# Expression API | ||
expression <- getBrainStarsExpression("1439627_at") | ||
print(expression) | ||
|
||
# Graph API | ||
getBrainStarsFigure("1439627_at", "exprgraph") | ||
getBrainStarsFigure("1439627_at", "exprmap") | ||
getBrainStarsFigure("1439627_at", "switchgraph") | ||
#getBrainStarsFigure("1439627_at", "switchhist") | ||
getBrainStarsFigure("1439627_at", "switchmap") |