This file contains hidden or 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
| ## Get pathway edit history from wikipathways.org and export as gource log file | |
| ## Run using: | |
| ## python wikipathways2gource.py wikipathways.log | |
| ## View in gourse using: | |
| ## gource -1280x720 -a 3 --seconds-per-day 0.01 --hide dirnames,filenames --user-filter MaintBot --key wikipathways.log | |
| ## Create video with gource using: | |
| ## gource -1280x720 -a 2 --seconds-per-day 0.005 --hide dirnames,filenames --user-filter MaintBot --key --stop-at-end -o - wikipathways.log | ffmpeg -y -r 30 -f image2pipe -vcodec ppm -i - -vcodec libvpx -b 10000K wikipathways.webm | |
| ## Known issues/shortcomings: | |
| ## - Pathway ontology terms can have multiple parents, this is ignored, only first is taken here to prevent pathways from showing multiple times in the visualization |
This file contains hidden or 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
| ## Fill out your own dbNP user / pass here | |
| authenticate("****", "****", "****") | |
| studies = getStudies() | |
| studyName = "NutriTechHIS" | |
| study = studies[[grep(studyName, sapply(studies, function(x) x$code))]] | |
| studyToken = study['token'] |
This file contains hidden or 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
| ## Test script to get NutriTech data from dbNP | |
| ## Crashes with: | |
| ## > source('~/projects/nutritech/code/dbnp.test.R') | |
| ## Clinical Chemistry | |
| ## Questionnaire Physical Activity | |
| ## Error in x$name : $ operator is invalid for atomic vectors | |
| require(GSCFClient) | |
| require(GSCFRUtils) |
This file contains hidden or 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
| library(limma) | |
| library(lumiMouseAll.db) | |
| nu.ids = rownames(data) ## A list of lumi nuIDS | |
| nu.annot = nuID2IlluminaID(nu.ids, lib.mapping = "lumiMouseIDMapping", idType = "All") | |
| ## Get entrez ids and gene names | |
| geneNames = as.character(as.list(lumiMouseAllGENENAME)[nu.ids]) | |
| entrezIds = as.character(as.list(lumiMouseAllENTREZID)[nu.ids]) |
This file contains hidden or 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
| ############################# | |
| #### Apply functions #### | |
| ############################# | |
| matrixData = matrix(1:40, nrow = 10, ncol = 4) | |
| ### Median of rows | |
| ## Using for loop | |
| rowm = rep(NA, nrow(matrixData)) | |
| for(r in 1:nrow(matrixData)) { | |
| rowm[r] = median(matrixData[r,]) |
This file contains hidden or 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
| ## Only first time: install bioconductor package for your affy array | |
| ## Find the proper package here: http://www.bioconductor.org/packages/release/data/annotation/ | |
| source("http://bioconductor.org/biocLite.R") | |
| biocLite("hgu95d.db") | |
| ## Load the affy annotation library | |
| library(hgu95d.db) | |
| ids = read.delim("omzetten ids.txt", as.is=T, header=T) |