{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Contribute a BioJupies Plugin | Python 3\n", "## Overview\n", "This notebook contains instructions for the submission of BioJupies RNA-seq data analysis plugins in Python 3.\n", "\n", "To submit your plugin, complete the following three steps:\n", "1. Add code to the **`analyze`** function.\n", "2. Add code to the **`plot`** function.\n", "3. **Test the code** using our example datasets, or use your own data.\n", "\n", "
\n", "\n", "
\n", "\n", "\n", "## 1. `analyze`\n", "The goal of the `analyze` function is to analyze an **RNA-seq dataset or signature** using one or more computational tools or techniques, and return the results of such analysis in a Python data structure." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "# Analysis function\n", "def analyze(dataset):\n", " print('Analyzing the dataset...')\n", " return ''" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 2. `plot`\n", "The goal of the `plot` function is to **visualize the results of the `analyze` function** in the Jupyter Notebook by using a plot, interactive visualization, or embedding downloadable results in the notebook itself." ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ "# Plot function\n", "def plot(analysis_results):\n", " print('Displaying analysis results...')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 3. Test the Plugin\n", "Once the `analyze` and `plot` functions have been completed, you can test them using the cells below." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "# Import modules\n", "import pandas as pd\n", "\n", "# Read the dataset\n", "example_dataset = pd.read_table('data/example_dataset.txt', index_col='gene_symbol')\n", "\n", "# Read the metadata\n", "example_metadata = pd.read_table('data/example_metadata.txt', index_col='Sample_geo_accession')\n", "\n", "# Read the signature\n", "example_signature = pd.read_table('data/example_signature.txt', index_col='gene_symbol')" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Analyzing the dataset...\n" ] } ], "source": [ "# Analyze the data\n", "results = analyze(dataset=example_dataset)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Displaying analysis results...\n" ] } ], "source": [ "# Plot the results\n", "plot(results)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.3" } }, "nbformat": 4, "nbformat_minor": 2 }