<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Jean-David Harrouet · Jupyter Blog</title>
    <link>https://jupyter.org/medium-archive/hugo/authors/jean-david-harrouet/</link>
    <description>The Project Jupyter blog: news, releases, and community stories, archived from blog.jupyter.org.</description>
    <generator>Hugo</generator>
    <lastBuildDate>Mon, 08 Feb 2021 13:29:55 &#43;0000</lastBuildDate>
    <atom:link href="https://jupyter.org/medium-archive/hugo/authors/jean-david-harrouet/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>Genomic data visualization in Jupyter</title>
      <link>https://jupyter.org/medium-archive/hugo/posts/2021/genomic-data-visualization-in-jupyter/</link>
      <pubDate>Mon, 08 Feb 2021 13:29:55 &#43;0000</pubDate>
      <dc:creator>Jean-David Harrouet</dc:creator>
      <guid>https://jupyter.org/medium-archive/hugo/posts/2021/genomic-data-visualization-in-jupyter/</guid>
      <description>If there is one thing that recent events tell us, it is that genomic is a large source of data, and that its manipulation and…</description>
      <content:encoded>&lt;p&gt;If there is one thing that recent events tell us, it is that genomics is a large source of data, and that its manipulation and understanding allow for the quick development of new drugs and… vaccines.&lt;/p&gt;
&lt;p&gt;We decided to build upon the Jupyter ecosystem and enrich its capabilities in this space, with a genomics data visualization widget.&lt;/p&gt;
&lt;p&gt;In doing so, we chose to leverage the &lt;a href=&#34;https://github.com/igvteam/igv.js/&#34;&gt;&lt;code&gt;igv.js&lt;/code&gt;&lt;/a&gt; JavaScript library, developped by the &lt;a href=&#34;https://igv.org/&#34;&gt;Integrative Genomics Viewer (IGV)&lt;/a&gt; team, and used by &lt;a href=&#34;https://igv.org/app/&#34;&gt;the web app of the same name&lt;/a&gt;. This is all done thanks for the power of &lt;code&gt;ipywidgets&lt;/code&gt; , which helps linking the JS genomic representation object to our Jupyter notebook.&lt;/p&gt;
&lt;p&gt;Hence, we are proud to announce the release of &lt;a href=&#34;https://github.com/QuantStack/ipyigv&#34;&gt;&lt;code&gt;ipyigv&lt;/code&gt;&lt;/a&gt;, a Jupyter widget to render genomics data, based on &lt;code&gt;igv.js&lt;/code&gt;!&lt;/p&gt;
&lt;h2 id=&#34;installing-ipyigv&#34;&gt;Installing ipyigv&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;ipyigv&lt;/code&gt; is available on PyPI and conda-forge. It can be installed with both pip and &lt;a href=&#34;https://github.com/mamba-org/mamba&#34;&gt;mamba&lt;/a&gt; / &lt;a href=&#34;https://github.com/conda/conda&#34;&gt;conda&lt;/a&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;mamba install -c conda-forge ipyigv
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can find additional installation instruction on the &lt;a href=&#34;https://github.com/QuantStack/ipyigv&#34;&gt;project&amp;rsquo;s page on GitHub&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;rendering-genomic-data&#34;&gt;Rendering genomic data&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;igv.js&lt;/code&gt; consumes genomic data in two chunks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the genome itself as documented &lt;a href=&#34;https://github.com/igvteam/igv.js/wiki/Reference-Genome&#34;&gt;here&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;specificities of the genome underlined as &lt;code&gt;Tracks&lt;/code&gt;, which are displayed alongside or on top of the genome&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;ipyigv&lt;/code&gt; uses the same logic, with a helper function to use the public genomes available. Data is then displayed in an &lt;code&gt;IgvBrowser&lt;/code&gt; widget, a wrapper for the &lt;code&gt;igv.js&lt;/code&gt; browser.&lt;/p&gt;
&lt;p&gt;To make things easier, there are a few public genomes made directly available via a helper &lt;code&gt;Bunch&lt;/code&gt; , &lt;code&gt;PUBLIC_GENOMES&lt;/code&gt; .&lt;/p&gt;
&lt;p&gt;Here is what it looks like:&lt;/p&gt;
&lt;figure&gt;
&lt;video src=&#34;https://jupyter.org/medium-archive/hugo/medium-archive/hugo/posts/2021/genomic-data-visualization-in-jupyter/images/001-1_fxJcZt6CBqZodRKm-k9vBA.mp4&#34; poster=&#34;/medium-archive/hugo/posts/2021/genomic-data-visualization-in-jupyter/images/001-1_fxJcZt6CBqZodRKm-k9vBA-poster.webp&#34; width=&#34;800&#34; height=&#34;326&#34; preload=&#34;none&#34; loop muted playsinline controls aria-label=&#34;Creating a genome browser with data from a public genome&#34;&gt;&lt;/video&gt;
&lt;figcaption&gt;Creating a genome browser with data from a public genome&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Now that we have created a genome browser, we may add tracks to it. Tracks may be of different sorts, about ten according to &lt;a href=&#34;https://github.com/igvteam/igv.js/wiki/Tracks-2.0&#34;&gt;the &lt;code&gt;igv.js&lt;/code&gt; documentation&lt;/a&gt;. Describing all the kinds of tracks is out of the scope of this article, but it should be noted that:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a common &lt;code&gt;Track&lt;/code&gt; class is defined with all the common properties. Each track type corresponds to a subclass inheriting &lt;code&gt;Track&lt;/code&gt; .&lt;/li&gt;
&lt;li&gt;in order to ease things out, some class introspection was introduced in order to identify the type of &lt;code&gt;Track&lt;/code&gt; based on the extension of the containing file. As shown below, this allows for instantiating a track by just using the &lt;code&gt;Track&lt;/code&gt; constructor, without knowing the name of the actual subclass being instantiated (e.g. &lt;code&gt;AnnotationTrack&lt;/code&gt; in the example below). Type inference is made through the type of file, or by specifying a &lt;code&gt;type&lt;/code&gt; property.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now, let&amp;rsquo;s add a &lt;code&gt;Track&lt;/code&gt; to our browser, then remove it:&lt;/p&gt;
&lt;figure&gt;
&lt;video src=&#34;https://jupyter.org/medium-archive/hugo/medium-archive/hugo/posts/2021/genomic-data-visualization-in-jupyter/images/002-1_681fIddZAaQc8w72MmmIiw.mp4&#34; poster=&#34;/medium-archive/hugo/posts/2021/genomic-data-visualization-in-jupyter/images/002-1_681fIddZAaQc8w72MmmIiw-poster.webp&#34; width=&#34;800&#34; height=&#34;488&#34; preload=&#34;none&#34; loop muted playsinline controls aria-label=&#34;Adding and removing a track to/from our browser&#34;&gt;&lt;/video&gt;
&lt;figcaption&gt;Adding and removing a track to/from our browser&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;In this first version, two other functions come in as handy:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;browser.search(&#39;chr3:1-190,100,300&#39;)&lt;/code&gt; would position the browser at the requested position in the genome;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;browser.dump_json()&lt;/code&gt; prepares a JSON representing the configuration of the browser. Handy if you would like to reinstantiate another browser with the same configuration without redoing it manually. Use &lt;code&gt;browser.out&lt;/code&gt; to output the JSON content.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We hope you&amp;rsquo;ll have fun manipulating genome data in Jupyter, and sharing visual knowledge thanks to &lt;code&gt;ipyigv&lt;/code&gt;!&lt;/p&gt;
&lt;h2 id=&#34;acknowledgments&#34;&gt;Acknowledgments&lt;/h2&gt;
&lt;p&gt;The development of ipyigv by &lt;a href=&#34;https://twitter.com/Harr0uet&#34;&gt;Jean-David Harrouet&lt;/a&gt; at &lt;a href=&#34;https://twitter.com/QuantStack&#34;&gt;QuantStack&lt;/a&gt; was funded as part of the &lt;a href=&#34;https://twitter.com/PlasmaBio&#34;&gt;PLASMA&lt;/a&gt; project, led by &lt;a href=&#34;https://twitter.com/CVandiedonck&#34;&gt;Claire Vandiedonck&lt;/a&gt;, &lt;a href=&#34;https://twitter.com/pierrepo&#34;&gt;Pierre Poulain&lt;/a&gt;, and &lt;a href=&#34;https://twitter.com/SCaburet&#34;&gt;Sandrine Caburet&lt;/a&gt;, associate professors at Université de Paris.&lt;/p&gt;
&lt;p&gt;Sponsors to the PLASMA initiative include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://twitter.com/iledefrance&#34;&gt;Région Île-de-France&lt;/a&gt;, via the “Trophées franciliens de l’innovation numérique dans le supérieur” (&lt;a href=&#34;https://www.iledefrance.fr/trophees-franciliens-de-linnovation-numerique-dans-le-superieur-les-laureats-2018&#34;&gt;EdTech 2018&lt;/a&gt;) grant program,&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://twitter.com/Univ_Paris&#34;&gt;Université de Paris&lt;/a&gt;, via the &lt;a href=&#34;https://u-paris.fr/en/the-initiative-of-excellence-idex-label/&#34;&gt;Initiative of Excellence (IdEx) Label&lt;/a&gt; and its “inovating teaching” grant program,&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://twitter.com/EURGENEPARIS&#34;&gt;EUR G.E.N.E.&lt;/a&gt;, the graduate school on Genetics and Epigenetics,&lt;/li&gt;
&lt;li&gt;the university training “Création, analyse et valorisation de données biologiques omiques” (&lt;a href=&#34;https://omics-school.net/&#34;&gt;DU Omiques&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;about-the-author&#34;&gt;About the author&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;https://www.linkedin.com/in/harrouet/&#34;&gt;Jean-David Harrouet&lt;/a&gt; is an innovator helping companies with their digital transformation.&lt;/p&gt;
&lt;p&gt;He believes that the right mix of coding and business acumen is a way to make life better for many people.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://jupyter.org/medium-archive/hugo/medium-archive/hugo/posts/2021/genomic-data-visualization-in-jupyter/images/003-1_wACAwVx0PZAsEH8myXyUqg.jpeg&#34; width=&#34;600&#34; height=&#34;667&#34; loading=&#34;lazy&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
</content:encoded>
    </item>
    
  </channel>
</rss>
