Skip to content
Snippets Groups Projects
Commit 2ebf7a24 authored by Melanie Schneider's avatar Melanie Schneider
Browse files

Merge branch 'master' of ssh://git-srv1/local/git/bioinformatics

parents 08a3bee1 9b972130
No related branches found
No related tags found
No related merge requests found
...@@ -42,7 +42,7 @@ devtools::source_url("https://dl.dropboxusercontent.com/u/113630701/datautils/R/ ...@@ -42,7 +42,7 @@ devtools::source_url("https://dl.dropboxusercontent.com/u/113630701/datautils/R/
devtools::source_url("https://dl.dropboxusercontent.com/u/113630701/datautils/R/ggplot_commons.R") devtools::source_url("https://dl.dropboxusercontent.com/u/113630701/datautils/R/ggplot_commons.R")
require(cummeRbund) require(cummeRbund)
devtools::source_url("https://dl.dropboxusercontent.com/u/113630701/datautils/R/bio/cummerutils.R") devtools::source_url("https://dl.dropboxusercontent.com/u/113630701/datautils/R/bio/diffex_commons.R")
#knitr::opts_knit$set(root.dir = getwd()) #knitr::opts_knit$set(root.dir = getwd())
...@@ -286,62 +286,12 @@ save(degs, file=".degs.RData") ...@@ -286,62 +286,12 @@ save(degs, file=".degs.RData")
#' ## Term enrichment #' ## Term enrichment
#+ echo=FALSE #+ echo=FALSE
#fpkmMatrix(genes(cuff)) %>% head()
ontologies <- c(
"GOTERM_CC_FAT",
"GOTERM_MF_FAT",
"GOTERM_BP_FAT",
"PANTHER_PATHWAY",
"REACTOME_PATHWAY",
"KEGG_PATHWAY",
"GOTERM_CC_FAT",
"GOTERM_MF_FAT",
"GOTERM_BP_FAT"
)
#' This analysis was performed using [David](http://david.abcc.ncifcrf.gov/). The following ontologies were tested: `r paste(ontologies, collapse=', ')` #' This analysis was performed using [David](http://david.abcc.ncifcrf.gov/). The following ontologies were tested: `r paste(ontologies, collapse=', ')`
require(RDAVIDWebService) ## just works if installed on non-network-drive (e.g. /tmp/)
geneLists <- degs %>% geneLists <- degs %>%
# transmute(ensembl_gene_id, list_id=paste(sample_1, "vs", sample_2, "ovex", sample_1_overex, sep="_")) # transmute(ensembl_gene_id, list_id=paste(sample_1, "vs", sample_2, "ovex", sample_1_overex, sep="_"))
transmute(ensembl_gene_id, list_id=paste(sample_1, "vs", sample_2)) transmute(ensembl_gene_id, list_id=paste(sample_1, "vs", sample_2))
## http://www.bioconductor.org/packages/release/bioc/vignettes/RDAVIDWebService/inst/doc/RDavidWS-vignette.pdf
## e.g. getClusterReport --> plot2D
davidAnnotationChart <- function(someGenes){ ## expexted to have a column with gene_id
# echo("processing list with", length(someGenes), "genes")
# someGenes <- degs$ensembl_gene_id
if(length(someGenes)>1500){
someGenes <- sample(someGenes) %>% head(1500)
}
david<-DAVIDWebService$new(email="brandl@mpi-cbg.de")
# getTimeOut(david)
setTimeOut(david, 80000) ## http://www.bioconductor.org/packages/release/bioc/vignettes/RDAVIDWebService/inst/doc/RDavidWS-vignette.pdf
result<-addList(david, someGenes, idType="ENSEMBL_GENE_ID", listName=paste0("list_", sample(10000)[1]), listType="Gene")
david %>% setAnnotationCategories(ontologies)
annoChart <-getFunctionalAnnotationChart(david)
# clusterReport <-getClusterReport(david)
return(annoChart %>% subset(select=-Genes))
}
grpdDegs <- if(split_hit_list){ grpdDegs <- if(split_hit_list){
degs %>% group_by(sample_1, sample_2, sample_1_overex) degs %>% group_by(sample_1, sample_2, sample_1_overex)
}else{ }else{
...@@ -350,6 +300,7 @@ grpdDegs <- if(split_hit_list){ ...@@ -350,6 +300,7 @@ grpdDegs <- if(split_hit_list){
enrResults <- grpdDegs %>% do(davidAnnotationChart(.$ensembl_gene_id)) enrResults <- grpdDegs %>% do(davidAnnotationChart(.$ensembl_gene_id))
write.delim(enrResults, file="enrResults.txt") write.delim(enrResults, file="enrResults.txt")
# enrResults <- read.delim("enrResults.txt") # enrResults <- read.delim("enrResults.txt")
#' [Enrichment Results](enrResults.txt) #' [Enrichment Results](enrResults.txt)
......
...@@ -287,7 +287,7 @@ cp -r . $tmpDbDir ...@@ -287,7 +287,7 @@ cp -r . $tmpDbDir
genome=$(echo $gtfFile | cut -f7 -d'/'); echo "genome is $genome" genome=$(echo $gtfFile | cut -f7 -d'/'); echo "genome is $genome"
## make sure to use temp-r to avoid file locking problems ## make sure to use temp-r to avoid file locking problems
R_LIBS=/tmp/r_index export R_LIBS=/tmp/r_index
echo ' echo '
require(cummeRbund) require(cummeRbund)
......
...@@ -70,8 +70,19 @@ cssHeader=' ...@@ -70,8 +70,19 @@ cssHeader='
max-width: 90%; max-width: 90%;
} }
</style> </style>
<!-- add jquery datatable support -->
<link rel="stylesheet" type="text/css" href="http://cdn.datatables.net/1.10.4/css/jquery.dataTables.css">
<script type="text/javascript" charset="utf8" src="http://code.jquery.com/jquery-2.1.2.min.js"></script>
<script type="text/javascript" charset="utf8" src="http://cdn.datatables.net/1.10.4/js/jquery.dataTables.js"></script>
' '
#<!-- add bootstrap support -->
#<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet">
#<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
## custom title http://stackoverflow.com/questions/14124022/setting-html-meta-elements-with-knitr ## custom title http://stackoverflow.com/questions/14124022/setting-html-meta-elements-with-knitr
opts_chunk$set( opts_chunk$set(
cache = spin_opts$c, cache = spin_opts$c,
......
spinsnip(){
if [ $# -ne 1 ]; then
>&2 echo "Usage: spinsnip <report name> [other args]*"
return
fi
reportName=$1
tmpR=$(echo $reportName | tr " " "_").R
## http://stackoverflow.com/questions/11454343/pipe-output-to-bash-function
cat | sed 's/#>/#'"'"'/g' > $tmpR
echo "spining $tmpR..."
shift
spin.R $tmpR $*
rm $tmpR
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment