Skip to content

Instantly share code, notes, and snippets.

@ruxi
Created June 3, 2016 15:57
Show Gist options
  • Save ruxi/f9756645525628026a35d33cf9a44d36 to your computer and use it in GitHub Desktop.
Save ruxi/f9756645525628026a35d33cf9a44d36 to your computer and use it in GitHub Desktop.
R_affy.ipynb
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"metadata": {},
"cell_type": "markdown",
"source": "# R affy"
},
{
"metadata": {
"ExecuteTime": {
"start_time": "2016-06-03T10:56:50.464473",
"end_time": "2016-06-03T10:56:51.501356"
},
"trusted": true,
"collapsed": false
},
"cell_type": "code",
"source": "import rpy2.ipython\n%load_ext rpy2.ipython\nimport warnings; warnings.filterwarnings(\"ignore\")",
"execution_count": 1,
"outputs": []
},
{
"metadata": {},
"cell_type": "markdown",
"source": "# R dependencies"
},
{
"metadata": {},
"cell_type": "markdown",
"source": "**for installation, it was done manually in a seperate terminal window. So, some pain**\n\nInstall/upgrade bioconductor\n\n```R\nsource(\"http://bioconductor.org/biocLite.R\")\nbiocLite()\n```\n\n```R\n## try http:// if https:// URLs are not supported\nsource(\"http://bioconductor.org/biocLite.R\")\nbiocLite(\"affy\")\nbiocLite(\"limma\")\nbiocLite(\"GEOquery\")\nbiocLite(\"oligo\")\nbiocLite(\"hgu133plus2.db\")\nbiocLite(\"annotate\")\nbiocLite(\"topGO\")\nbiocLite(\"genefilter\")\ninstall.packages(\"gplots\")\ninstall.packages(\"ggplot2\")\ninstall.packages(\"wesanderson\")\n```"
},
{
"metadata": {},
"cell_type": "markdown",
"source": "# check current work directory"
},
{
"metadata": {
"ExecuteTime": {
"start_time": "2016-06-03T10:57:23.775112",
"end_time": "2016-06-03T10:57:23.786421"
},
"trusted": true,
"collapsed": false
},
"cell_type": "code",
"source": "import os.path; os.getcwd()",
"execution_count": 5,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": "'/home/lewis/git/gist/Rnorm'"
},
"metadata": {},
"execution_count": 5
}
]
},
{
"metadata": {},
"cell_type": "markdown",
"source": "# Retrieve dataset"
},
{
"metadata": {
"ExecuteTime": {
"start_time": "2016-06-03T10:56:52.335606",
"end_time": "2016-06-03T10:56:52.387288"
},
"trusted": true,
"collapsed": false
},
"cell_type": "code",
"source": "# Assign GSE ascension number for download\n%R gse.asc <- \"GSE33580\"\n%R print(gse.asc)",
"execution_count": 2,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": "[1] \"GSE33580\"\n"
},
"metadata": {}
}
]
},
{
"metadata": {},
"cell_type": "markdown",
"source": "**GEO Platform (GPL)**\n> These files describe a particular type of microarray. They are annotation files.\n\n**GEO Sample (GSM)**\n> Files that contain all the data from the use of a single chip. For each gene there will be multiple scores including the main one, held in the VALUE column.\n\n**GEO Series (GSE)**\n> Lists of GSM files that together form a single experiment.\n\n**GEO Dataset (GDS)**\n> These are curated files that hold a summarised combination of a GSE file and its GSM files. They contain normalised expression levels for each gene from each sample (i.e. just the VALUE field from the GSM file)."
},
{
"metadata": {
"ExecuteTime": {
"start_time": "2016-06-03T10:54:51.744780",
"end_time": "2016-06-03T10:54:51.762445"
},
"trusted": true,
"collapsed": false
},
"cell_type": "code",
"source": "%%R\nlibrary(GEOquery)",
"execution_count": 6,
"outputs": []
},
{
"metadata": {
"ExecuteTime": {
"start_time": "2016-06-03T15:55:00.655Z"
},
"trusted": true,
"collapsed": true
},
"cell_type": "code",
"source": "%%R\ngse <- getGEO(gse.asc)",
"execution_count": null,
"outputs": []
},
{
"metadata": {
"ExecuteTime": {
"start_time": "2016-06-03T15:55:08.255Z"
},
"trusted": true,
"collapsed": true
},
"cell_type": "code",
"source": "%R filePaths = getGEOSuppFiles(gse.asc, baseDir=tmppath)",
"execution_count": null,
"outputs": []
},
{
"metadata": {
"trusted": true,
"collapsed": true
},
"cell_type": "code",
"source": "",
"execution_count": null,
"outputs": []
}
],
"metadata": {
"kernelspec": {
"name": "pythonpathkernel",
"display_name": "pythonpath (python)",
"language": "python"
},
"language_info": {
"version": "3.5.1",
"name": "python",
"pygments_lexer": "ipython3",
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"nbconvert_exporter": "python",
"file_extension": ".py",
"mimetype": "text/x-python"
},
"toc": {
"toc_window_display": false,
"toc_number_sections": true,
"toc_cell": false,
"toc_threshold": 6
},
"latex_envs": {
"eqNumInitial": 0,
"current_citInitial": 1,
"bibliofile": "biblio.bib",
"eqLabelWithNumbers": true,
"cite_by": "apalike"
},
"gist": {
"id": "",
"data": {
"description": "R_affy.ipynb",
"public": true
}
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment