{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# * Visualizing of genetic similarity with Lightning + GraphX *" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Setup lightning" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [] } ], "source": [ "%libraryDependencies += \"org.viz.lightning\" %% \"lightning-scala\" % \"0.1.6\"" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [] } ], "source": [ "%update" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [] } ], "source": [ "import org.viz.lightning._\n", "import org.apache.spark.graphx._" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [] }, { "data": { "text/plain": [ "org.viz.lightning.Lightning@7cd4a5c1" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "val lgn = Lightning(host=\"https://lightning-spark-summit.herokuapp.com\" )\n", "lgn.enableNotebook()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Load structure similarity data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Public data from http://www.brain-map.org/" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [] }, { "data": { "text/plain": [ "org.apache.spark.graphx.impl.GraphImpl@36afd257" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "val source = \"/Users/mathisonian/projects/spark-summit/notebooks/data/allen-connectivity.txt\"\n", "val g = GraphLoader.edgeListFile(sc, source)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Show the network (unlabeled)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "