Author Archives: Collin Closek

Models

Not fashion models…rather simulations for understanding complex interactions and environments!

Today Maya revealed the wonderment of models, the many types of models, and how might they be used.

We discussed four main types of models:

  1. Conceptual (Phenomenological) Model – processes are drawn out – vs. Mechanistic
  2. Dynamic Model – time is a variable (changes in time) – vs. Static
  3. Spatial – changes within location – vs. Nonspatial
  4. Stochastic – uncertainty included – vs. Deterministic

It was intriguing to learn about the different ways these models might be applied and how models are being used with modern technology. For example, in syndromic surveillance – one is able to detect the symptoms before they start (e.g. an increase in Google Flu Searches before CDC has reports of cases) or following cell signals to understand population interactions. We also went through a few simulations ourself, which was fun, because in essence as a colleague pointed out…models are video games on randomness!

First we “played” Wandering Elephants, a stochastic spatial model developed to simulate how many times an elephant becomes thirsty and comes in contact with water.

Screen Shot 2014-08-14 at 10.45.28 AM Screen Shot 2014-08-14 at 10.45.14 AM  Screen Shot 2014-08-14 at 10.47.30 AM

Then we also used a SIR model (Susceptible -> Infectious -> Removed) to model infections and susceptibility.

Screen Shot 2014-08-14 at 11.04.20 AM

Finally, we were able to tweak our own model which simulated oyster filtration of a parasite (e.g. laby) in the water column, essentially trying to find correct density of oysters to keep parasites low within the water column.

Screen Shot 2014-08-14 at 11.49.37 AM

 

Monkeying Around

Today there were some major advancements in our organization and plans towards focusing our efforts on the Sea Star transcriptome project. I ended up doing a bunch of what felt like monkey-work, but I think it has shed more light on our transcriptome.

In summary, the Pycnopodia helianthoides transcriptome sequences to the UniProtKB/Swiss-Prot database resulted in 30578 unique contigs. Nucleotide BLAST searches resulted in 8611 annotated as Eukaryotic contigs, of which 3947 were from sea urchin. In addition, 2117 were bacterial and 31 matched viral annotations.

Screen Shot 2014-08-14 at 1.02.10 AM

KNOW YOUR PATH…Python, Coral, and ISH

What an eclectic day with a common theme: PATH!

IPython NB was conquered today, as I was able to successfully install it once realizing a very important thing… the PATH needed to be rerouted. See below for the details on how to do that if interested.

In addition, the ISH group continued with the ISH protocol for both Sea Star and Coral samples. Test PCRs worked well for most of the samples, all coral except for 16S Eubacteria ones (*which turned out were never tested, because the wrong primers were used, ooops) and the Ehrlichiae primers were problematic even after a second run. We’ve gotten probes successfully attached and amplifying on the coral samples, however Sea Star has had a few more hurdles and did not amplify with the probes (see images below). SO we may have to go back to the drawing board for those and figure out what our path is going to be for the next few days.

photo2  photo1 (3)photo1 (2)

Also, we’ve begun to examine coral slides from various diseases and health states. They are absolutely beautiful, but they’re also really difficult to examine. Feast your eyes!

BTV 028 BTV 027 BTV 026 BTV 025

How to load IPython on your computer:

  • install Anaconda (http://continuum.io/downloads)
  • then check when it is and whether anaconda in correctly configured for your path
  • cvvvv:/ collin$ pwd

    /

    cvvvv:/ collin$ export PATH=/anaconda/bin:$PATH

  • then update Anaconda and IPython (http://ipython.org/install.html)

PCR-ISH

In an effort to run in situ hybridizations (ISH) on both coral and sea star samples, we tested 9 sets of primers today and multiple temperatures.

I ran Eubacterial primers, 27F & 1522R, and Ehrlichiae primers on coral samples. The coral DNA is from Sarah’s A. cervicornis white band samples. Below are the master mixes and annealing temps that were tested for the Ehrlichiae outside of the 55C temperature that we ran the Eubacteria primers on.

photo 2 photo 1

IPython & R had a baby…Rpy2 :)

Running R in IPython to run the WGCNA package. See the code below:

…Hopefully this is not the GoPRO Video that shows below:

Awesome, I know!

We also spent the AFTERNOON split into three teams to focus on different areas of analysis: 1) overall transcriptome, 2) DEG homology & consistency, and 3) enrichment analyses

Our group focused on the transcriptome overall; trying to mine taxon specific fields (i.e. bacteria-related only, fungi-related only, echinoderm-related only, etc…). In order to see what areas of the KEGG pathways our transcriptome covers (echinoderm-specific), I joined our 05 swissprot list with the blastnt list and mined for only contigs containing either “urchin”, “star”, or “echino” and then within SQLshare I took out only the swissprot IDs to load into iPATH2. Sadly, there’s still some issue an it wouldn’t run in iPATH2. But I hope to soon have results in a format similar to this…

 

Screen Shot 2014-08-08 at 5.27.01 PM

I will have to tinker with it. Below is my notebook, outlining all the steps taken (besides those steps done in SQLshare).

 

Today…Mush!

Today was exploratory…we’re attempting to mine the SS data by exploring the various tools out there that we discussed yesterday. I spent most of the day trying to merge files and examining the individual sample response, rather than the log2 fold change.

Of those significant genes we had 1629 with negative expression (ranging from log2 FC from -6.94 to -0.93), while 2103 had a positive expression (ranging from log2 FC 0.88 to 10.87). We’ll look into what that means per sample and condition in the upcoming days.

 The obvious trends occurring across all of the data at the GO level is below.

Screen Shot 2014-08-07 at 5.20.25 PM

My IPNotebook is below:

Screen Shot 2014-08-07 at 5.03.40 PM

DAVID & IPython

It’s different from the story you’re used to. This one involves many sweet electronic databases and coding to get the job done. See below for all the awesome coding we did today within IPython to filter our transcripts and get them to a format that can be loaded into DAVID to functionally annotate our results and mine them for further ontologies:

And for your viewing pleasure there are also some pretty awesome graphics that were created in REVIGO to represent the number of differentially expressed functions in reference to size:

Screen Shot 2014-08-06 at 9.53.20 PM Screen Shot 2014-08-06 at 9.50.02 PM

Lastly, here are some top GO terms and  cool genes that resulted from our first run through DAVID today:

Screen Shot 2014-08-06 at 4.39.58 PMScreen Shot 2014-08-06 at 5.37.39 PMScreen Shot 2014-08-06 at 5.38.03 PM

 

More IPython Fun

Below is some of the code we wrote today in class to begin visualizing our transcriptomic data. To be beautified…

Notebook

<!-- Custom stylesheet, it must be in the same directory as the html file -->

<!-- Loading mathjax macro -->
<!-- Load mathjax -->
<!-- MathJax configuration -->//
<!-- End of mathjax configuration -->

&nbsp;
<div id="notebook" class="border-box-sizing">
<div id="notebook-container" class="container">
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In [1]:</div>
<div class="inner_cell">
<div class="input_area">
<div class="highlight">
<pre><span class="kn">import</span> <span class="nn">pandas</span> <span class="kn">as</span> <span class="nn">pd</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In [11]:</div>
<div class="inner_cell">
<div class="input_area">
<div class="highlight">
<pre><span class="n">jslim</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">read_csv</span><span class="p">(</span><span class="s">'GOSlim_query_P.csv'</span><span class="p">)</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In [12]:</div>
<div class="inner_cell">
<div class="input_area">
<div class="highlight">
<pre><span class="n">jslim</span><span class="o">.</span><span class="n">groupby</span><span class="p">(</span><span class="s">'GOSlim_bin'</span><span class="p">)</span><span class="o">.</span><span class="n">Column1</span><span class="o">.</span><span class="n">count</span><span class="p">()</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">kind</span><span class="o">=</span><span class="s">'bar'</span><span class="p">)</span>
</pre>
</div>
</div>
</div>
</div>
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="prompt output_prompt">Out[12]:</div>
<div class="output_text output_subarea output_pyout">
<pre>&lt;matplotlib.axes.AxesSubplot at 0x108355410&gt;
</pre>
</div>
</div>
<div class="output_area"></div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In [6]:</div>
<div class="inner_cell">
<div class="input_area">
<div class="highlight">
<pre><span class="n">pylab</span> <span class="n">inline</span> 
</pre>
</div>
</div>
</div>
</div>
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="prompt"></div>
<div class="output_subarea output_stream output_stdout output_text">
<pre>Populating the interactive namespace from numpy and matplotlib

</pre>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In [13]:</div>
<div class="inner_cell">
<div class="input_area">
<div class="highlight">
<pre><span class="n">jslim</span><span class="o">.</span><span class="n">groupby</span><span class="p">(</span><span class="s">'GOSlim_bin'</span><span class="p">)</span><span class="o">.</span><span class="n">Column1</span><span class="o">.</span><span class="n">count</span><span class="p">()</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">kind</span><span class="o">=</span><span class="s">'pie'</span><span class="p">)</span>
</pre>
</div>
</div>
</div>
</div>
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="prompt output_prompt">Out[13]:</div>
<div class="output_text output_subarea output_pyout">
<pre>&lt;matplotlib.axes.AxesSubplot at 0x1086652d0&gt;
</pre>
</div>
</div>
<div class="output_area"></div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In [14]:</div>
<div class="inner_cell">
<div class="input_area">
<div class="highlight">
<pre><span class="o">!</span>ipython nbconvert <span class="o">{</span>nbloc<span class="o">}{</span>nb<span class="o">}</span> --to html --template full  --output <span class="o">{</span>nb<span class="o">}{</span>date<span class="o">}</span>
</pre>
</div>
</div>
</div>
</div>
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="prompt"></div>
<div class="output_subarea output_stream output_stdout output_text">
<pre>[NbConvertApp] Using existing profile dir: u'/Users/fhlguest/.ipython/profile_default'

[NbConvertApp] WARNING | pattern u'{nbloc}{nb}' matched no files

This application is used to convert notebook files (*.ipynb) to various other

formats.



WARNING: THE COMMANDLINE INTERFACE MAY CHANGE IN FUTURE RELEASES.



Options

-------



Arguments that take values are actually convenience aliases to full

Configurables, whose aliases are listed on the help line. For more information

on full configurables, see '--help-all'.



--debug

    set log level to logging.DEBUG (maximize logging output)

--init

    Initialize profile with default config files.  This is equivalent

    to running `ipython profile create &lt;profile&gt;` prior to startup.

--quiet

    set log level to logging.CRITICAL (minimize logging output)

--stdout

    Write notebook output to stdout instead of files.

--profile=&lt;Unicode&gt; (BaseIPythonApplication.profile)

    Default: u'default'

    The IPython profile to use.

--reveal-prefix=&lt;Unicode&gt; (RevealHelpPreprocessor.url_prefix)

    Default: 'reveal.js'

    The URL prefix for reveal.js. This can be a a relative URL for a local copy

    of reveal.js, or point to a CDN.

    For speaker notes to work, a local reveal.js prefix must be used.

--ipython-dir=&lt;Unicode&gt; (BaseIPythonApplication.ipython_dir)

    Default: u''

    The name of the IPython directory. This directory is used for logging

    configuration (through profiles), history storage, etc. The default is

    usually $HOME/.ipython. This options can also be specified through the

    environment variable IPYTHONDIR.

--writer=&lt;DottedObjectName&gt; (NbConvertApp.writer_class)

    Default: 'FilesWriter'

    Writer class used to write the  results of the conversion

--log-level=&lt;Enum&gt; (Application.log_level)

    Default: 30

    Choices: (0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL')

    Set the log level by value or name.

--to=&lt;CaselessStrEnum&gt; (NbConvertApp.export_format)

    Default: 'html'

    Choices: ['custom', 'html', 'latex', 'markdown', 'python', 'rst', 'slides']

    The export format to be used.

--template=&lt;Unicode&gt; (TemplateExporter.template_file)

    Default: u'default'

    Name of the template file to use

--output=&lt;Unicode&gt; (NbConvertApp.output_base)

    Default: ''

    overwrite base name use for output files. can only  be use when converting

    one notebook at a time.

--post=&lt;DottedOrNone&gt; (NbConvertApp.postprocessor_class)

    Default: u''

    PostProcessor class used to write the  results of the conversion

--config=&lt;Unicode&gt; (BaseIPythonApplication.extra_config_file)

    Default: u''

    Path to an extra config file to load.

    If specified, load this config file in addition to any other IPython config.

--profile-dir=&lt;Unicode&gt; (ProfileDir.location)

    Default: u''

    Set the profile location directly. This overrides the logic used by the

    `profile` option.



To see all available configurables, use `--help-all`



Examples

--------



    The simplest way to use nbconvert is

    

    &gt; ipython nbconvert mynotebook.ipynb

    

    which will convert mynotebook.ipynb to the default format (probably HTML).

    

    You can specify the export format with `--to`.

    Options include ['custom', 'html', 'latex', 'markdown', 'python', 'rst', 'slides']

    

    &gt; ipython nbconvert --to latex mynotebook.ipynb

    

    Both HTML and LaTeX support multiple output templates. LaTeX includes

    'base', 'article' and 'report'.  HTML includes 'basic' and 'full'. You

    can specify the flavor of the format used.

    

    &gt; ipython nbconvert --to html --template basic mynotebook.ipynb

    

    You can also pipe the output to stdout, rather than a file

    

    &gt; ipython nbconvert mynotebook.ipynb --stdout

    

    A post-processor can be used to compile a PDF

    

    &gt; ipython nbconvert mynotebook.ipynb --to latex --post PDF

    

    You can get (and serve) a Reveal.js-powered slideshow

    

    &gt; ipython nbconvert myslides.ipynb --to slides --post serve

    

    Multiple notebooks can be given at the command line in a couple of 

    different ways:

    

    &gt; ipython nbconvert notebook*.ipynb

    &gt; ipython nbconvert notebook1.ipynb notebook2.ipynb

    

    or you can specify the notebooks list in a config file, containing::

    

        c.NbConvertApp.notebooks = ["my_notebook.ipynb"]

    

    &gt; ipython nbconvert --config mycfg.py




</pre>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In []:</div>
<div class="inner_cell"></div>
</div>
</div>
</div>
</div>
&nbsp;