Category Archives: Julia

Path BioAnalytics and Julia Computing Collaborate to Advance Precision Medicine and Drug Development for Cystic Fibrosis

Chapel Hill, NC – Path BioAnalytics (PBA) and Julia Computing today announced that they have entered into a research collaboration agreement to develop next-generation software supporting PBA’s Sphera organoid cell culture platform for precision medicine and drug development. The companies are focusing on applications in cystic fibrosis.

The companies bring together key domain knowledge and intellectual property to create a streamlined analysis pipeline that can be used to quantify drug response in organoid cultures in a high-throughput format.

“The software and analytical component of in/ex vitro assays is often overlooked. As a result, there are significant benefits that can be realized by adapting recent developments from other fields and integrating them with new cell culture systems and assays. PBA has developed proprietary analytics to maximize the value of its organoid platform, and is looking forward to further optimizing them with Julia, a high-level, high-performance dynamic programming language for numerical computing,” said Dr. John Mellnik, CEO of PBA. “Julia Computing will be a key partner as we seek to advance our precision medicine approach and accelerate the discovery, development and use of new medications for cystic fibrosis.”

About

Cystic Fibrosis (CF) is a rare, life-shortening genetic disease affecting approximately 30,000 in the United States and 75,000 people world-wide. CF is caused by a defective or missing CFTR protein resulting from mutations in the CFTR gene. Children must inherit two defective CFTR genes — one from each parent — to have CF. There are approximately 2,000 known mutations in the CFTR gene. Some of these mutations, which can be determined by a genetic test, or genotyping test, lead to CF by creating non-working or too few CFTR proteins at the cell surface. The defective function or absence of CFTR protein results in poor flow of salt and water into and out of the cell in a number of organs. In the lungs, this leads to the buildup of abnormally thick, sticky mucus that can cause chronic lung infections and progressive lung damage in many patients that eventually leads to death. The median age of death is in the mid-to-late 20s.

Path BioAnalytics (PBA) is an emerging biotech company based in Chapel Hill, NC. The company is developing assays and databases for drug development and precision medicine by combining innovative epithelial cell culture technology with proprietary analytics. These technologies are based on over 15 years of federally-funded research and have been used by multiple corporate partners to test their drugs in a target population prior to starting clinical trials, providing critical data for more accurate go/no-go decision. The company’s initial focus is on cystic fibrosis, COPD and asthma. Additional information is available at www.pathbioanalytics.com.

Julia is the fastest modern high performance open source computing language for data, analytics, algorithmic trading, machine learning and artificial intelligence. Julia combines the functionality and ease of use of Python, R, Matlab, SAS and Stata with the speed of C++ and Java. With more than 1 million downloads and +161% annual growth, Julia is one of the top programming languages developed on GitHub. Julia users, partners and employers hiring Julia programmers in 2017 include Amazon, Apple, BlackRock, Capital One, Citibank, Comcast, Disney, Facebook, Ford, Google, Grindr, IBM, Intel, KPMG, Microsoft, NASA, Oracle, PwC and Uber.

Julia Computing was founded in 2015 by the creators of the open source Julia language to develop products and provide support for businesses and researchers who use Julia. Additional information is available at www.juliacomputing.com.

My Julia workflow

By: Tamás K. Papp

Re-posted from: https://tamaspapp.eu/post/julia-workflow/

(edit 2017-10-22: fixed path for PkgDev.generate example)

This is a summary of the workflow I find ideal for working with Julia. Although the manual has a section on workflow, it does not mention all the tools that I find useful, so perhaps this will benefit some users of Julia.

I use Emacs, with julia-mode (for editing the source) and julia-repl (REPL integration). The latter is my own package; you can use ESS instead, which has some advantages (eg multiple inferior processes) and disadvantages (no ANSI terminal support). The choice of an editor is highly subjective: at the end of the day, all you need is one that is capable of sending code to the REPL and can, in turn, be used by the REPL to open a file at a particular point. I use

ENV["EDITOR"] = "emacsclient"

in ~/.juliarc.jl to ensure this. This helps me find code with the @edit macro.

Small code snippets and experiments below ~30 lines just go into files, from which I send regions of code to the REPL. Frequently, for throwaway code, I just open a file in /tmp/, which will get removed automatically after the next reboot.

Even very small projects get their own package. This way I get version control1 and a sensible structure for unit tests set up automatically. I put my own packages in their own directory, keeping them separate from Pkg.dir(). This allows me to use the same package across Julia versions, and makes Pkg.update() ignore them. I tell Julia where they are with

const LOCAL_PACKAGES = expanduser("~/src/julia-local-packages/")
push!(LOAD_PATH, LOCAL_PACKAGES)

I create local packages with

import PkgDev
PkgDev.generate("MyPkg", "MIT"; path = LOCAL_PACKAGES)

Then I open the file and start working on it with

using MyPkg

I use Revise.jl to automate reloading.2 This package has changed my workflow completely; it can cope with most changes, except for type redefinitions. For these, I need to restart the REPL.

To test my code, I use Pkg.test with RoguePkg.jl, which makes it find packages outside Pkg.dir() for testing and benchmarks:

Pkg.test(pkg_for"MyPkg")

  1. I use the amazing magit for interacting with git — having obtained funding on KickStarter recently, it is bound to become even more convenient. [return]
  2. You just need to set it up once according to its documentation, after that it is automatic. [return]

PyData Warsaw 2017 example

By: Bogumił Kamiński

Re-posted from: http://juliasnippets.blogspot.com/2017/10/pydata-warsaw-2017-example.html

Following several requests in this post I am presenting the Asian option pricing example that I have discussed during PyData Warsaw 2017 (after the first day of talks I highly recommend everyone to come tomorrow as it is an excellent event).

The problem is taken from the book Foundations and Methods of Stochastic Simulation by Barry Nelson where it is solved using VBA in section 4.5.

I will not repeat the whole discussion of the model, but focus on the numerical aspect. We are asked to calculate the value of the expression:

where X is generated by a continuous state geometric Brownian motion. We will use Monte Carlo simulation to approximate the above expected value.

A single pass of the Monte Carlo simulation is approximated by a discrete sum:

The parameters we will use in the simulation are: T=1, r=0.05, K=55, σ=0.3, m=1000 and starting value of X at time 0 is 50. We will run 100,000 replications of Monte Carlo simulation and calculate the average.

I want to compare five implementations of the above problem:

  • Julia using loops
  • Julia using vectorized code
  • Python using loops
  • Numba using loops
  • NumPy using vectorized code
First go the codes in Julia (running time is given in the comment at the end):
And here are the codes in Python:
Julia implementation is a bit more fancy as it promotes the arguments to a common type on the run and in Python I pass all values as floats (which is simpler). Also vectorized code in Julia uses in-place updating. In general I tried to make the implementations a normal code in respective languages.

The key take-aways are the following:

  • standard Python is a no-go solution for this problem;
  • loops in Julia are fastest;
  • somewhat surprisingly vectorized Julia code is faster than Numba although the former has to allocate more memory;
  • NumPy implementation is around three times slower than vectorized Julia;
  • Vectorized Julia code hugely benefits from in-place operations (that avoid memory allocation); however, even without these optimizations it was faster than Numba.